Simon Glass | c484095 | 2023-07-30 21:01:45 -0600 | [diff] [blame] | 1 | #include <env/ti/ti_armv7_common.env> |
| 2 | #include <env/ti/mmc.env> |
| 3 | #include <env/ti/k3_dfu.env> |
Nikhil M Jain | 18efa42 | 2023-03-30 14:24:09 +0530 | [diff] [blame] | 4 | |
| 5 | findfdt= |
| 6 | if test $board_name = am64x_gpevm; then |
Andrew Davis | 5e1f436 | 2023-07-14 11:22:30 +0530 | [diff] [blame] | 7 | setenv name_fdt ti/k3-am642-evm.dtb; fi; |
Nikhil M Jain | 18efa42 | 2023-03-30 14:24:09 +0530 | [diff] [blame] | 8 | if test $board_name = am64x_skevm; then |
Andrew Davis | 5e1f436 | 2023-07-14 11:22:30 +0530 | [diff] [blame] | 9 | setenv name_fdt ti/k3-am642-sk.dtb; fi; |
Nikhil M Jain | 18efa42 | 2023-03-30 14:24:09 +0530 | [diff] [blame] | 10 | if test $name_fdt = undefined; then |
| 11 | echo WARNING: Could not determine device tree to use; fi; |
Kamlesh Gurudasani | 0812a30 | 2023-07-14 11:22:26 +0530 | [diff] [blame] | 12 | setenv fdtfile ${name_fdt} |
Nikhil M Jain | 18efa42 | 2023-03-30 14:24:09 +0530 | [diff] [blame] | 13 | name_kern=Image |
| 14 | console=ttyS2,115200n8 |
| 15 | args_all=setenv optargs earlycon=ns16550a,mmio32,0x02800000 ${mtdparts} |
| 16 | run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr} |
| 17 | |
| 18 | boot=mmc |
| 19 | mmcdev=1 |
| 20 | bootpart=1:2 |
| 21 | bootdir=/boot |
| 22 | rd_spec=- |
Nikhil M Jain | 18efa42 | 2023-03-30 14:24:09 +0530 | [diff] [blame] | 23 | |
| 24 | args_usb=run finduuid;setenv bootargs console=${console} |
| 25 | ${optargs} |
| 26 | root=PARTUUID=${uuid} rw |
| 27 | rootfstype=${mmcrootfstype} |
| 28 | init_usb=run args_all args_usb |
| 29 | get_fdt_usb=load usb ${bootpart} ${fdtaddr} ${bootdir}/${name_fdt} |
| 30 | get_overlay_usb= |
| 31 | fdt address ${fdtaddr}; |
| 32 | fdt resize 0x100000; |
| 33 | for overlay in $name_overlays; |
| 34 | do; |
| 35 | load usb ${bootpart} ${dtboaddr} ${bootdir}/${overlay} && fdt apply |
| 36 | ${dtboaddr}; |
| 37 | done; |
| 38 | get_kern_usb=load usb ${bootpart} ${loadaddr} |
| 39 | ${bootdir}/${name_kern} |
| 40 | get_fit_usb=load usb ${bootpart} ${addr_fit} |
| 41 | ${bootdir}/${name_fit} |
| 42 | usbboot=setenv boot usb; |
| 43 | setenv bootpart 0:2; |
| 44 | usb start; |
| 45 | run findfdt; |
| 46 | run init_usb; |
| 47 | run get_kern_usb; |
| 48 | run get_fdt_usb; |
| 49 | run run_kern; |