Lukasz Majewski | 678cfb6 | 2024-01-15 14:51:28 +0100 | [diff] [blame] | 1 | bootmode=update |
| 2 | bootpri=mmc_mmc |
| 3 | bootsec=sf_swu |
| 4 | consdev=ttyAMA0 |
| 5 | baudrate=115200 |
| 6 | dtbfile=imx28-xea.dtb |
| 7 | rootdev=/dev/mmcblk0p2 |
| 8 | netdev=eth0 |
| 9 | swufile=swupdate-image-xea-upd.itb |
| 10 | sf_kernel_offset=0xA0000 |
| 11 | sf_swu_size=0xF40000 |
| 12 | ethact=FEC |
| 13 | arch=xea |
| 14 | lwe_env= |
| 15 | if dhcp ${loadaddr} ${hostname}/${lwe_uenv} ; then |
| 16 | source ${loadaddr}; |
| 17 | fi |
| 18 | lwe_uenv=env_uboot_xea.bin |
| 19 | do_update_mmc= |
| 20 | if mmc rescan ; then |
| 21 | mmc dev 0 ${update_mmc_part} ; |
| 22 | if dhcp ${hostname}/${update_filename} ; then |
| 23 | setexpr fw_sz ${filesize} / 0x200 ; |
| 24 | setexpr fw_sz ${fw_sz} + 1 ; |
| 25 | mmc write ${loadaddr} ${update_offset} ${fw_sz} ; |
| 26 | fi ; |
| 27 | fi |
| 28 | do_update_sf= |
| 29 | if sf probe ; then |
| 30 | if dhcp ${hostname}/${update_filename} ; then |
| 31 | sf erase ${update_offset} +${filesize} ; |
| 32 | sf write ${loadaddr} ${update_offset} ${filesize} ; |
| 33 | fi ; |
| 34 | fi |
| 35 | factory_reset= |
| 36 | if sf probe ; then |
| 37 | run update_swu ; |
| 38 | setenv bootmode update ; |
| 39 | saveenv ; |
| 40 | fi |
| 41 | update_spl_filename=u-boot.sb |
| 42 | update_spl= |
| 43 | setenv update_filename ${update_spl_filename} ; |
| 44 | setenv update_offset 0 ; |
| 45 | run do_update_sf |
| 46 | update_uboot_filename=u-boot.img |
| 47 | update_uboot= |
| 48 | setenv update_filename ${update_uboot_filename} ; |
| 49 | setenv update_offset 0x10000 ; |
| 50 | run do_update_sf ; |
| 51 | setenv update_mmc_part 1 ; |
| 52 | setenv update_offset 0 ; |
| 53 | run do_update_mmc ; |
| 54 | setenv update_mmc_part 2 ; |
| 55 | run do_update_mmc |
| 56 | update_kernel_filename=uImage |
| 57 | update_kernel= |
| 58 | setenv update_mmc_part 1 ; |
| 59 | setenv update_filename ${update_kernel_filename} ; |
| 60 | setenv update_offset 0x800 ; |
| 61 | run do_update_mmc ; |
| 62 | setenv update_filename ${dtbfile} ; |
| 63 | setenv update_offset 0x400 ; |
| 64 | run do_update_mmc |
| 65 | update_swu= |
| 66 | setenv update_filename ${swufile} ; |
| 67 | setenv update_offset ${sf_kernel_offset} ; |
| 68 | run do_update_sf |
| 69 | addcons= |
| 70 | setenv bootargs ${bootargs} |
| 71 | console=${consdev},${baudrate} |
| 72 | addip= |
| 73 | setenv bootargs ${bootargs} |
| 74 | ip=${ipaddr}:${serverip}:${gatewayip}: |
| 75 | ${netmask}:${hostname}:${netdev}:off |
| 76 | addmisc= |
| 77 | setenv bootargs ${bootargs} ${miscargs} |
| 78 | addargs=run addcons addmisc |
| 79 | mmcload= |
| 80 | mmc rescan ; |
| 81 | mmc dev 0 1 ; |
| 82 | mmc read ${loadaddr} 0x800 0x2000 ; |
| 83 | mmc read ${dtbaddr} 0x400 0x80 |
| 84 | netload= |
| 85 | dhcp ${loadaddr} ${hostname}/${bootfile} ; |
| 86 | tftp ${dtbaddr} ${hostname}/${dtbfile} |
| 87 | usbload= |
| 88 | usb start ; |
| 89 | load usb 0:1 ${loadaddr} ${bootfile} |
| 90 | miscargs=panic=1 |
| 91 | mmcargs=setenv bootargs root=${rootdev} rw rootwait |
| 92 | nfsargs= |
| 93 | setenv bootargs root=/dev/nfs rw |
| 94 | nfsroot=${serverip}:${rootpath},v3,tcp |
| 95 | mmc_mmc= |
| 96 | if run mmcload mmcargs addargs ; then |
| 97 | bootm ${loadaddr} - ${dtbaddr} ; |
| 98 | fi |
| 99 | mmc_nfs= |
| 100 | if run mmcload nfsargs addip addargs ; then |
| 101 | bootm ${loadaddr} - ${dtbaddr} ; |
| 102 | fi |
| 103 | sf_mmc= |
| 104 | if run sfload mmcargs addargs ; then |
| 105 | bootm ${loadaddr} - ${dtbaddr} ; |
| 106 | fi |
| 107 | sf_swu= |
| 108 | if sf probe ; then |
| 109 | sf read ${loadaddr} ${sf_kernel_offset} ${sf_swu_size} ; |
| 110 | setenv bootargs root=/dev/ram0 rw ; |
| 111 | run addargs ; |
| 112 | bootm ${loadaddr} ; |
| 113 | fi |
| 114 | net_mmc= |
| 115 | if run netload mmcargs addargs ; then |
| 116 | bootm ${loadaddr} - ${dtbaddr} ; |
| 117 | fi |
| 118 | net_nfs= |
| 119 | if run netload nfsargs addip addargs ; then |
| 120 | bootm ${loadaddr} - ${dtbaddr} ; |
| 121 | fi |
| 122 | prebootcmd= |
| 123 | if test ${envsaved} != y ; then ; |
| 124 | setenv envsaved y ; |
| 125 | saveenv ; |
| 126 | fi ; |
| 127 | if test ${bootmode} = normal ; then |
| 128 | setenv bootdelay 0 ; |
| 129 | setenv bootpri mmc_mmc ; |
| 130 | elif test ${bootmode} = devel ; then |
| 131 | setenv bootdelay 3 ; |
| 132 | setenv bootpri net_mmc ; |
| 133 | else |
| 134 | if test ${bootmode} != update ; then |
| 135 | echo Warning: unknown bootmode ${bootmode} ; |
| 136 | fi ; |
| 137 | setenv bootdelay 1 ; |
| 138 | setenv bootpri sf_swu ; |
| 139 | fi |