Neha Malcom Francis | a2e532c | 2023-03-15 10:57:43 +0530 | [diff] [blame] | 1 | mmcdev=0 |
| 2 | mmcrootfstype=ext4 rootwait |
| 3 | finduuid=part uuid ${boot} ${bootpart} uuid |
| 4 | args_mmc=run finduuid;setenv bootargs console=${console} |
| 5 | ${optargs} |
| 6 | root=PARTUUID=${uuid} rw |
| 7 | rootfstype=${mmcrootfstype} |
| 8 | loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr |
| 9 | bootscript=echo Running bootscript from mmc${mmcdev} ...; |
| 10 | source ${loadaddr} |
| 11 | bootenvfile=uEnv.txt |
| 12 | importbootenv=echo Importing environment from mmc${mmcdev} ...; |
| 13 | env import -t ${loadaddr} ${filesize} |
| 14 | loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenvfile} |
| 15 | loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile} |
Andrew Davis | 1d9b5a5 | 2023-07-14 11:22:31 +0530 | [diff] [blame] | 16 | loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/dtb/${fdtfile} |
| 17 | get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/dtb/${name_fdt} |
Neha Malcom Francis | a2e532c | 2023-03-15 10:57:43 +0530 | [diff] [blame] | 18 | envboot=mmc dev ${mmcdev}; |
| 19 | if mmc rescan; then |
| 20 | echo SD/MMC found on device ${mmcdev}; |
| 21 | if run loadbootscript; then |
| 22 | run bootscript; |
| 23 | else |
| 24 | if run loadbootenv; then |
| 25 | echo Loaded env from ${bootenvfile}; |
| 26 | run importbootenv; |
| 27 | fi; |
| 28 | if test -n $uenvcmd; then |
| 29 | echo Running uenvcmd ...; |
| 30 | run uenvcmd; |
| 31 | fi; |
| 32 | fi; |
| 33 | fi; |
| 34 | mmcloados= |
| 35 | if test ${boot_fdt} = yes || test ${boot_fdt} = try; then |
Andrew Davis | 1d9b5a5 | 2023-07-14 11:22:31 +0530 | [diff] [blame] | 36 | if run get_fdt_mmc; then |
Neha Malcom Francis | a2e532c | 2023-03-15 10:57:43 +0530 | [diff] [blame] | 37 | bootz ${loadaddr} - ${fdtaddr}; |
| 38 | else |
| 39 | if test ${boot_fdt} = try; then |
| 40 | bootz; |
| 41 | else |
| 42 | echo WARN: Cannot load the DT; |
| 43 | fi; |
| 44 | fi; |
| 45 | else |
| 46 | bootz; |
| 47 | fi; |
| 48 | mmcboot=mmc dev ${mmcdev}; |
| 49 | devnum=${mmcdev}; |
| 50 | devtype=mmc; |
| 51 | if mmc rescan; then |
| 52 | echo SD/MMC found on device ${mmcdev}; |
| 53 | if run loadimage; then |
| 54 | run args_mmc; |
| 55 | if test ${boot_fit} -eq 1; then |
| 56 | run run_fit; |
| 57 | else |
| 58 | run mmcloados; |
| 59 | fi; |
| 60 | fi; |
| 61 | fi; |
| 62 | |
Vignesh Raghavendra | 654916a | 2023-07-25 13:09:20 +0530 | [diff] [blame] | 63 | init_mmc=run args_all args_mmc |
| 64 | get_overlay_mmc= |
| 65 | fdt address ${fdtaddr}; |
| 66 | fdt resize 0x100000; |
| 67 | for overlay in $name_overlays; |
| 68 | do; |
Vignesh Raghavendra | 6c87099 | 2023-07-25 13:09:21 +0530 | [diff] [blame] | 69 | load mmc ${bootpart} ${dtboaddr} ${bootdir}/dtb/${overlay} && |
Vignesh Raghavendra | 654916a | 2023-07-25 13:09:20 +0530 | [diff] [blame] | 70 | fdt apply ${dtboaddr}; |
| 71 | done; |
| 72 | get_kern_mmc=load mmc ${bootpart} ${loadaddr} |
| 73 | ${bootdir}/${name_kern} |
| 74 | get_fit_mmc=load mmc ${bootpart} ${addr_fit} |
| 75 | ${bootdir}/${name_fit} |
| 76 | partitions=name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs} |