blob: 9aafa3c9984a6ce1caf979665650a66b72f549fa [file] [log] [blame]
Frieder Schrempf9569c932024-02-15 15:00:35 +01001blkloadfdt=fatload ${device} ${devnum}:${partnum} ${fdt_addr} ${load_fdt_file}
2blkloadimage=fatload ${device} ${devnum}:${partnum} ${loadaddr} ${load_image}
3boot_devices=usb mmc ubi
4bootargs_base=vt.global_cursor_default=0 consoleblank=0 cma=200M fbcon=rotate:1
5bootdelay=3
6bootdir=
7console=ttymxc1,115200
8ethact=FEC0
9fdt_addr=0x18000000
10fdt_file_legacy=imx6dl_sielaff.dtb
11fdt_file=imx6dl-sielaff.dtb
12fdt_high=0xffffffff
13image_legacy=zImage
14image=fitImage
15initrd_high=0xffffffff
16ip_dyn=no
17loadaddr=0x12000000
18mmcargs=setenv bootargs ${bootargs_base} console=${console} root=${mmcroot}
19mmcroot=/dev/mmcblk2p2 rootwait rw
20ramdisk_addr=0x18C00000
21script=boot.scr
22touch_rst_gpio=2
23touch_irq_gpio=146
24ubiargs=setenv bootargs ${bootargs_base} console=${console} rootfstype=ubifs ubi.mtd=0 root=ubi0_0 rw
25ubiloadfdt=ubifsload ${fdt_addr} /boot/${load_fdt_file}
26ubiloadimage=ubifsload ${loadaddr} /boot/${load_image}
27usb_pgood_delay=2000
28usbargs=setenv bootargs ${bootargs_base} console=${console} root=${usbroot}
29usbroot=/dev/sda2 rootwait rw
30
31bootcmd=
32 for b in ${boot_devices}; do
33 if test ${b} = mmc; then
34 run mmcboot;
35 fi;
36 if test ${b} = net; then
37 run netboot;
38 fi;
39 if test ${b} = ubi; then
40 run ubiboot;
41 fi;
42 if test ${b} = usb; then
43 run usbboot;
44 fi;
45 done;
46
47boot=
48 load_image=${image};
49 run loadimagecmd;
50 if test $? = 0; then
51 imxtract ${loadaddr} fdt-${fdt_file} ${fdt_addr};
52 run detect_touch;
53 bootm ${loadaddr} - ${fdt_addr};
54 else
55 load_image=${image_legacy};
56 load_fdt_file=${fdt_file_legacy};
57 run loadimagecmd;
58 run loadfdtcmd;
59 if test $? = 0; then
60 run detect_touch;
61 bootz ${loadaddr} - ${fdt_addr};
62 fi;
63 fi;
64
65detect_touch=
66 gpio clear ${touch_irq_gpio};
67 gpio clear ${touch_rst_gpio};
68 sleep 0.02;
69 gpio set ${touch_rst_gpio};
70 sleep 0.1;
71 gpio input ${touch_irq_gpio};
72 i2c dev 2;
73 fdt addr ${fdt_addr};
74 if i2c probe 0x55; then
75 echo 'Detected Sitronix Touch';
76 fdt set /soc/bus@2100000/i2c@21a8000/touchscreen@55 status okay;
77 else
78 if i2c probe 0x5d; then
79 echo 'Detected Goodix Touch';
80 fdt set /soc/bus@2100000/i2c@21a8000/touchscreen@5d status okay;
81 fi;
82 fi;
83 gpio clear ${touch_rst_gpio};
84
85mmcboot=
86 echo Booting from MMC ...;
87 run mmcargs;
88 device=mmc;
89 devnum=2;
90 partnum=1;
91 setenv loadimagecmd ${blkloadimage};
92 setenv loadfdtcmd ${blkloadfdt};
93 run boot;
94
95ubiboot=
96 echo Booting from NAND (UBI);
97 run ubiargs;
98 ubi part rootfs;
99 ubifsmount ubi0;
100 setenv loadimagecmd ${ubiloadimage};
101 setenv loadfdtcmd ${ubiloadfdt};
102 load_image=${image};
103 run boot;
104
105usbboot=
106 echo Booting from USB Storage ...;
107 run usbargs;
108 usb start;
109 device=usb;
110 devnum=0;
111 partnum=1;
112 setenv loadimagecmd ${blkloadimage};
113 setenv loadfdtcmd ${blkloadfdt};
114 run boot;