[TEZI] Custom boot

Dear all,

We have followed the example described Custom Boot panel on TEZI dedicated web page but boot.scr file doen not seem to work. Our goal is to enabled touchscreen using LVDS channel and USB TS (through USB OTG port). The script is placed on root of sdCard and this is its content :

# Set timings for 10" multitouch
setenv bootargs console=ttymxc0,115200 quiet video=mxcfb0:dev=ldb,if=LVDS888 rootfstype=squashfs root=/dev/ram autoinstall fullscreen ${teziargs}

# Reenable fdt relocation since in place fdt edits corrupt the ramdisk
# in a FIT image...
setenv fdt_high

# Load FIT image from location as detected by distroboot
load ${devtype} ${devnum}:${distro_bootpart} ${ramdisk_addr_r} ${prefix}tezi.itb

bootm start ${ramdisk_addr_r} && bootm loados && bootm ramdisk && bootm fdt

# Enable and set touchscreen parameter
#backlight
fdt set /backlight default-brightness-level 7
fdt set /backlight enable-gpios &gpio3 13 GPIO_ACTIVE_HIGH

#fb@0
fdt set /fb@0 interface_pix_fmt RGB24
fdt set /fb@0 mode_str LDB-WXGA
fdt set /fb@0 default_bpp 32

bootm prep && bootm go

When I use cat command on interface_pix_fmt parameter for examle it returns RGB666 (default value).
What could be wrong ?

Is there a way to put the boot.scr script on USB stick instead of SDcard ?

Thanks for your advice,

BR

HI @VincentB

Could you provide the version of the hardware and software of your module?
Which carrier Board are you using?

When I use cat command on interface_pix_fmt parameter for examle it returns RGB666 (default value).

Is this working, if you use the same settings on the regular Bsp Lxde Image?

Best regards,
Jaski

Dear @jaski.tx ,

I’ve noticed that I made some mistakes, I’m currently working on them and post here in some hours/days to bring some answers or other questions with more details.

BR,

Vincent

Ok, thanks for your input.

So, it appears that it’s not possible to set direclty node property like this :

fdt set /backlight pwms <&pwm4 0 1000000>

those commands work from uboot prompt and from boot.scr :

fdt set /fb@0 interface_pix_fmt RGB24
fdt set /fb@0 mode_str LDB-WXGA
fdt set /fb@0 default_bpp 32

When I try this way directly in uboot after loaded devicetree from tezi.itb I have this error :

fdt set /backlight pwms <&pwm4 0 1000000>
syntax error
Apalis iMX6 # 
Apalis iMX6 # fdt set /backlight pwms '<&pwm4 0 1000000>'
Sorry, I could not convert "&pwm4 0 1000000>"

But when I use this syntax it works :

fdt set /backlight pwms <0 0 1000000> 

So, it appears that fdt set command from uboot does not understand “alias” value but need to be set with hexadecimal value (at least for array variable cause status variable understands “okay” or “disabled” value).

Is there a way to get hexadecimal value for example &pwm4 value ? I don’t find it… Maybe the customisation of device tree is limited by this way.

Could I try by compiling a brand new device tree from 4.1 kernel used for tezi image and replace it in uboot with fdt commands and bootm arguments ?

BR,

Vincent

For test purpose I have deflattened a device tree blob to get flattened value of differents nodes.
Work in progress

Hi Vincent,
You cannot indeed use phandles in a dtb in this way, as the dt compiler has already done its work with them. You have to manually add the phandle and/or linux,phandle property in the pwm node with a value of your own and then use that value in the pwms property of the backlight node. Here’s how I did it in a colibri imx6:

fdt resize 0x100
fdt set /soc/aips-bus@02000000/pwm@02080000 linux,phandle <0x00001000>
fdt set /backlight pwms <0x00001000 0 10000000 0>

Hi,

Could we have the dts file used by TEZI ?

BR, Vincent

Have a look at the following recipe bb append:

https://github.com/toradex/meta-toradex-tezi/blob/morty/recipes-kernel/linux/linux-toradex_4.1-2.0.x.bbappend

Basically, check out resp. source revision of resp. source branch and apply the following patch:

https://github.com/toradex/meta-toradex-tezi/blob/morty/recipes-kernel/linux/linux-toradex-4.1-2.0.x/0002-ARM-dts-imx6qdl-apalis-eval-disable-PWM-1-2-3.patch

We are not able to enable our TouchScreen with TEZI.

We have followed this topic:
https://www.toradex.com/community/questions/22442/custom-device-tree-for-toradex-easy-installer.html

imx6qdl-apalis.dtsi file is patched with this file

We then add our modifications (our device tree works with our linux distribution):

&backlight {
	pwms = <&pwm4 0 1000000>;
	brightness-levels = <0 4 8 16 32 64 128 255>;
	default-brightness-level = <7>;
	pinctrl-names = "default";
	enable-gpios = <&gpio3 13 GPIO_ACTIVE_HIGH>;
	status = "okay";
};

&ldb {
	status = "okay";
	lvds-channel@0 {
		fsl,data-width = <24>;
	};
};
&mxcfb1 { 
	interface_pix_fmt = "RGB24";	
	mode_str ="LDB-WXGA";
	default_bpp = <32>;
	status = "okay";
};

In uboot, vidargs is set to :
vidargs=video=mxcfb0:dev=ldb,if=RGB24 video=mxcfb1:off video=mxcfb2:off video=mxcfb3:off fbmem=32M

tezi.itb + boot.scr (default one) are placed on a USB stick and the we start we run distro_bootcmd

The touchscreen remains black. Have you some advices ?

BR

What exact hardware (module and carrier board) and software (Toradex Easy Installer) versions of things are you talking about?

@marcel.tx ,

We are working on a Apalis imx6q board with a custom carrier board. The latest test has been done with TEZI 1.8 version.

hi @VincentB

Sorry for the delayed reply. Could you please share your tezi.itb + boot.scr.

Thanks and best regards,
Jaski

Hi @jaski.tx,

Don’t worry. Please find attached requested files.
link text

Hi @jaski.tx ,

Do you have any clue following attached files ?

BR, Vincent

HI @VincentB

Thanks for the files.
In boot.scr, you did not have setup the output to LVDS screen. And additonally in U-boot Environment you need to add ldb=sin0 to the vidargs variable.

Best regards,
Jaski

you did not have setup the output to
LVDS
You mean in vidargs variable ?

Yeah, I mean in the vidargs variable.

@jaski.tx

To keep you in touch:
boot.scr file:

setenv vidargs video=mxcfb0:dev=ldb,if=RGB24 ldb=sin0 video=mxcfb1:off video=mxcfb2:off video=mxcfb3:off
setenv bootargs console=ttymxc0,115200 quiet ${vidargs} rootfstype=squashfs root=/dev/ram autoinstall fullscreen ${teziargs}

Extract of dts file:

&backlight {
	pwms = <&pwm4 0 1000000>;
	brightness-levels = <0 4 8 16 32 64 128 255>;
	default-brightness-level = <7>;
	status = "okay";
};

&mxcfb1 { /*IPU1	mxcfb0	/dev/fb0	/dev/fb1 */
	interface_pix_fmt = "RGB24";
	mode_str ="LDB-XGA";
	default_bpp = <32>;
	status = "okay";
};

&ldb {
	status = "okay";
	lvds-channel@0 {
		fsl,data-width = <24>;
		display-timings {
			native-mode = <&timing_wxga>;
		};
	};
};

&pwm4 {
	status = "okay";
};

dtb file is compiled under linux toradex_4.1-2.0.x-imx branch. Apalis toradex easy installer is 1.8 version.

dtb file is packaged in itb file using .its file from meta-tezi. Both tezi.itb and boot.scr files are placed on USB file. Under u-boot, we run “run distro_bootcmd” and TEZI correctly starts.

Result :

[    0.268429] /backlight: arguments longer than property
[    0.268446] pwm-ba[link text][1]cklight backlight: unable to request PWM, trying legacy API

We still have black screen. What we have missed ?

Attached file : dts file, boot.cmd file, tezi.its file and tezi.itb file.

HI @VincentB

Thanks for the files.

I will check on them and come back to you next week.

Best regards,
Jaski