2023-03-15 05:27:43 +00:00
|
|
|
mmcdev=0
|
|
|
|
mmcrootfstype=ext4 rootwait
|
|
|
|
finduuid=part uuid ${boot} ${bootpart} uuid
|
|
|
|
args_mmc=run finduuid;setenv bootargs console=${console}
|
|
|
|
${optargs}
|
|
|
|
root=PARTUUID=${uuid} rw
|
|
|
|
rootfstype=${mmcrootfstype}
|
2023-08-25 18:02:47 +00:00
|
|
|
#ifndef CONFIG_BOOTSTD
|
2023-03-15 05:27:43 +00:00
|
|
|
loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr
|
2023-08-25 18:02:47 +00:00
|
|
|
#endif
|
2023-03-15 05:27:43 +00:00
|
|
|
bootscript=echo Running bootscript from mmc${mmcdev} ...;
|
|
|
|
source ${loadaddr}
|
|
|
|
bootenvfile=uEnv.txt
|
|
|
|
importbootenv=echo Importing environment from mmc${mmcdev} ...;
|
|
|
|
env import -t ${loadaddr} ${filesize}
|
|
|
|
loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenvfile}
|
|
|
|
loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}
|
2023-07-14 05:52:31 +00:00
|
|
|
loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/dtb/${fdtfile}
|
|
|
|
get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/dtb/${name_fdt}
|
2023-08-25 18:02:46 +00:00
|
|
|
envboot=if mmc dev ${mmcdev}; then
|
2023-03-15 05:27:43 +00:00
|
|
|
if mmc rescan; then
|
|
|
|
echo SD/MMC found on device ${mmcdev};
|
2023-08-25 18:02:47 +00:00
|
|
|
if test -n "${loadbootscript}" && run loadbootscript; then
|
2023-03-15 05:27:43 +00:00
|
|
|
run bootscript;
|
|
|
|
else
|
|
|
|
if run loadbootenv; then
|
|
|
|
echo Loaded env from ${bootenvfile};
|
|
|
|
run importbootenv;
|
|
|
|
fi;
|
|
|
|
if test -n $uenvcmd; then
|
|
|
|
echo Running uenvcmd ...;
|
|
|
|
run uenvcmd;
|
|
|
|
fi;
|
|
|
|
fi;
|
|
|
|
fi;
|
2023-08-25 18:02:46 +00:00
|
|
|
fi;
|
2023-03-15 05:27:43 +00:00
|
|
|
mmcloados=
|
|
|
|
if test ${boot_fdt} = yes || test ${boot_fdt} = try; then
|
2023-07-14 05:52:31 +00:00
|
|
|
if run get_fdt_mmc; then
|
2023-03-15 05:27:43 +00:00
|
|
|
bootz ${loadaddr} - ${fdtaddr};
|
|
|
|
else
|
|
|
|
if test ${boot_fdt} = try; then
|
|
|
|
bootz;
|
|
|
|
else
|
|
|
|
echo WARN: Cannot load the DT;
|
|
|
|
fi;
|
|
|
|
fi;
|
|
|
|
else
|
|
|
|
bootz;
|
|
|
|
fi;
|
2023-08-25 18:02:46 +00:00
|
|
|
mmcboot=if mmc dev ${mmcdev}; then
|
2023-03-15 05:27:43 +00:00
|
|
|
devnum=${mmcdev};
|
|
|
|
devtype=mmc;
|
|
|
|
if mmc rescan; then
|
|
|
|
echo SD/MMC found on device ${mmcdev};
|
|
|
|
if run loadimage; then
|
|
|
|
run args_mmc;
|
|
|
|
if test ${boot_fit} -eq 1; then
|
|
|
|
run run_fit;
|
|
|
|
else
|
|
|
|
run mmcloados;
|
|
|
|
fi;
|
|
|
|
fi;
|
2023-08-25 18:02:46 +00:00
|
|
|
fi;
|
|
|
|
fi;
|
2023-03-15 05:27:43 +00:00
|
|
|
|
2023-07-25 07:39:20 +00:00
|
|
|
init_mmc=run args_all args_mmc
|
|
|
|
get_overlay_mmc=
|
|
|
|
fdt address ${fdtaddr};
|
|
|
|
fdt resize 0x100000;
|
|
|
|
for overlay in $name_overlays;
|
|
|
|
do;
|
2023-07-25 07:39:21 +00:00
|
|
|
load mmc ${bootpart} ${dtboaddr} ${bootdir}/dtb/${overlay} &&
|
2023-07-25 07:39:20 +00:00
|
|
|
fdt apply ${dtboaddr};
|
|
|
|
done;
|
|
|
|
get_kern_mmc=load mmc ${bootpart} ${loadaddr}
|
|
|
|
${bootdir}/${name_kern}
|
|
|
|
get_fit_mmc=load mmc ${bootpart} ${addr_fit}
|
|
|
|
${bootdir}/${name_fit}
|
|
|
|
partitions=name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs}
|