mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-12-26 04:53:42 +00:00
014e013e78
Since get_fdt_mmc is common, factor it out into mmc.env and remove it from each platform env file along with changing the directory path to reflect the standards. Use it in mmcloados but keep loadfdt defined in case it is still used by some external uEnv.txt script. Signed-off-by: Andrew Davis <afd@ti.com> Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
62 lines
1.6 KiB
Bash
62 lines
1.6 KiB
Bash
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}
|
|
loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr
|
|
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}
|
|
loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/dtb/${fdtfile}
|
|
get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/dtb/${name_fdt}
|
|
envboot=mmc dev ${mmcdev};
|
|
if mmc rescan; then
|
|
echo SD/MMC found on device ${mmcdev};
|
|
if run loadbootscript; then
|
|
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;
|
|
mmcloados=
|
|
if test ${boot_fdt} = yes || test ${boot_fdt} = try; then
|
|
if run get_fdt_mmc; then
|
|
bootz ${loadaddr} - ${fdtaddr};
|
|
else
|
|
if test ${boot_fdt} = try; then
|
|
bootz;
|
|
else
|
|
echo WARN: Cannot load the DT;
|
|
fi;
|
|
fi;
|
|
else
|
|
bootz;
|
|
fi;
|
|
mmcboot=mmc dev ${mmcdev};
|
|
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;
|
|
fi;
|
|
|