blob: 0256a2d2aacaf13c6461e0b617d105dba413dbd2 [file] [log] [blame]
Neha Malcom Francisa2e532c2023-03-15 10:57:43 +05301mmcdev=0
2mmcrootfstype=ext4 rootwait
3finduuid=part uuid ${boot} ${bootpart} uuid
4args_mmc=run finduuid;setenv bootargs console=${console}
5 ${optargs}
6 root=PARTUUID=${uuid} rw
7 rootfstype=${mmcrootfstype}
Nishanth Menon4fc0ce32023-08-25 13:02:47 -05008#ifndef CONFIG_BOOTSTD
Neha Malcom Francisa2e532c2023-03-15 10:57:43 +05309loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr
Nishanth Menon4fc0ce32023-08-25 13:02:47 -050010#endif
Neha Malcom Francisa2e532c2023-03-15 10:57:43 +053011bootscript=echo Running bootscript from mmc${mmcdev} ...;
12 source ${loadaddr}
13bootenvfile=uEnv.txt
14importbootenv=echo Importing environment from mmc${mmcdev} ...;
15 env import -t ${loadaddr} ${filesize}
16loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenvfile}
17loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}
Andrew Davis1d9b5a52023-07-14 11:22:31 +053018loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/dtb/${fdtfile}
19get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/dtb/${name_fdt}
Nishanth Menon3f66e3a2023-08-25 13:02:46 -050020envboot=if mmc dev ${mmcdev}; then
Neha Malcom Francisa2e532c2023-03-15 10:57:43 +053021 if mmc rescan; then
22 echo SD/MMC found on device ${mmcdev};
Nishanth Menon4fc0ce32023-08-25 13:02:47 -050023 if test -n "${loadbootscript}" && run loadbootscript; then
Neha Malcom Francisa2e532c2023-03-15 10:57:43 +053024 run bootscript;
25 else
26 if run loadbootenv; then
27 echo Loaded env from ${bootenvfile};
28 run importbootenv;
29 fi;
30 if test -n $uenvcmd; then
31 echo Running uenvcmd ...;
32 run uenvcmd;
33 fi;
34 fi;
35 fi;
Nishanth Menon3f66e3a2023-08-25 13:02:46 -050036 fi;
Neha Malcom Francisa2e532c2023-03-15 10:57:43 +053037mmcloados=
38 if test ${boot_fdt} = yes || test ${boot_fdt} = try; then
Andrew Davis1d9b5a52023-07-14 11:22:31 +053039 if run get_fdt_mmc; then
Neha Malcom Francisa2e532c2023-03-15 10:57:43 +053040 bootz ${loadaddr} - ${fdtaddr};
41 else
42 if test ${boot_fdt} = try; then
43 bootz;
44 else
45 echo WARN: Cannot load the DT;
46 fi;
47 fi;
48 else
49 bootz;
50 fi;
Nishanth Menon3f66e3a2023-08-25 13:02:46 -050051mmcboot=if mmc dev ${mmcdev}; then
Neha Malcom Francisa2e532c2023-03-15 10:57:43 +053052 devnum=${mmcdev};
53 devtype=mmc;
54 if mmc rescan; then
55 echo SD/MMC found on device ${mmcdev};
56 if run loadimage; then
57 run args_mmc;
58 if test ${boot_fit} -eq 1; then
59 run run_fit;
60 else
61 run mmcloados;
62 fi;
63 fi;
Nishanth Menon3f66e3a2023-08-25 13:02:46 -050064 fi;
65 fi;
Neha Malcom Francisa2e532c2023-03-15 10:57:43 +053066
Vignesh Raghavendra654916a2023-07-25 13:09:20 +053067init_mmc=run args_all args_mmc
68get_overlay_mmc=
69 fdt address ${fdtaddr};
70 fdt resize 0x100000;
71 for overlay in $name_overlays;
72 do;
Vignesh Raghavendra6c870992023-07-25 13:09:21 +053073 load mmc ${bootpart} ${dtboaddr} ${bootdir}/dtb/${overlay} &&
Vignesh Raghavendra654916a2023-07-25 13:09:20 +053074 fdt apply ${dtboaddr};
75 done;
76get_kern_mmc=load mmc ${bootpart} ${loadaddr}
77 ${bootdir}/${name_kern}
78get_fit_mmc=load mmc ${bootpart} ${addr_fit}
79 ${bootdir}/${name_fit}
80partitions=name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs}