blob: 6fb47fb266738e2876fa8b20e58755221860695d [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}
8loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr
9bootscript=echo Running bootscript from mmc${mmcdev} ...;
10 source ${loadaddr}
11bootenvfile=uEnv.txt
12importbootenv=echo Importing environment from mmc${mmcdev} ...;
13 env import -t ${loadaddr} ${filesize}
14loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenvfile}
15loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}
Andrew Davis1d9b5a52023-07-14 11:22:31 +053016loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/dtb/${fdtfile}
17get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/dtb/${name_fdt}
Neha Malcom Francisa2e532c2023-03-15 10:57:43 +053018envboot=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;
34mmcloados=
35 if test ${boot_fdt} = yes || test ${boot_fdt} = try; then
Andrew Davis1d9b5a52023-07-14 11:22:31 +053036 if run get_fdt_mmc; then
Neha Malcom Francisa2e532c2023-03-15 10:57:43 +053037 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;
48mmcboot=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;
61fi;
62
Vignesh Raghavendra654916a2023-07-25 13:09:20 +053063init_mmc=run args_all args_mmc
64get_overlay_mmc=
65 fdt address ${fdtaddr};
66 fdt resize 0x100000;
67 for overlay in $name_overlays;
68 do;
Vignesh Raghavendra6c870992023-07-25 13:09:21 +053069 load mmc ${bootpart} ${dtboaddr} ${bootdir}/dtb/${overlay} &&
Vignesh Raghavendra654916a2023-07-25 13:09:20 +053070 fdt apply ${dtboaddr};
71 done;
72get_kern_mmc=load mmc ${bootpart} ${loadaddr}
73 ${bootdir}/${name_kern}
74get_fit_mmc=load mmc ${bootpart} ${addr_fit}
75 ${bootdir}/${name_fit}
76partitions=name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs}