Frieder Schrempf | 9569c93 | 2024-02-15 15:00:35 +0100 | [diff] [blame] | 1 | blkloadfdt=fatload ${device} ${devnum}:${partnum} ${fdt_addr} ${load_fdt_file} |
| 2 | blkloadimage=fatload ${device} ${devnum}:${partnum} ${loadaddr} ${load_image} |
| 3 | boot_devices=usb mmc ubi |
| 4 | bootargs_base=vt.global_cursor_default=0 consoleblank=0 cma=200M fbcon=rotate:1 |
| 5 | bootdelay=3 |
| 6 | bootdir= |
| 7 | console=ttymxc1,115200 |
| 8 | ethact=FEC0 |
| 9 | fdt_addr=0x18000000 |
| 10 | fdt_file_legacy=imx6dl_sielaff.dtb |
| 11 | fdt_file=imx6dl-sielaff.dtb |
| 12 | fdt_high=0xffffffff |
| 13 | image_legacy=zImage |
| 14 | image=fitImage |
| 15 | initrd_high=0xffffffff |
| 16 | ip_dyn=no |
| 17 | loadaddr=0x12000000 |
| 18 | mmcargs=setenv bootargs ${bootargs_base} console=${console} root=${mmcroot} |
| 19 | mmcroot=/dev/mmcblk2p2 rootwait rw |
| 20 | ramdisk_addr=0x18C00000 |
| 21 | script=boot.scr |
| 22 | touch_rst_gpio=2 |
| 23 | touch_irq_gpio=146 |
| 24 | ubiargs=setenv bootargs ${bootargs_base} console=${console} rootfstype=ubifs ubi.mtd=0 root=ubi0_0 rw |
| 25 | ubiloadfdt=ubifsload ${fdt_addr} /boot/${load_fdt_file} |
| 26 | ubiloadimage=ubifsload ${loadaddr} /boot/${load_image} |
| 27 | usb_pgood_delay=2000 |
| 28 | usbargs=setenv bootargs ${bootargs_base} console=${console} root=${usbroot} |
| 29 | usbroot=/dev/sda2 rootwait rw |
| 30 | |
| 31 | bootcmd= |
| 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 | |
| 47 | boot= |
| 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 | |
| 65 | detect_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 | |
| 85 | mmcboot= |
| 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 | |
| 95 | ubiboot= |
| 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 | |
| 105 | usbboot= |
| 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; |