Manorit Chawdhry bc2d846af7 include: env: ti: mmc: Change name_fdt usage to fdtfile
name_fdt is kept for backward compatibility but it depends on EEPROM
detection logic and some of the TI K3 platforms don't have that anymore
which causes boot failure in legacy boot flow using bootcmd_ti_mmc.

K2g platforms which uses the same file have their own override causing
this change to be no-impact for them.

Replacing name_fdt usage to fdtfile as fdtfile is populated based on
CONFIG_DEFAULT_DEVICE_TREE after using ti_set_fdt_env.

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
2024-07-16 13:01:46 -06:00

81 lines
2.1 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}
#ifndef CONFIG_BOOTSTD
loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr
#endif
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/${fdtfile}
envboot=if mmc dev ${mmcdev}; then
if mmc rescan; then
echo SD/MMC found on device ${mmcdev};
if test -n "${loadbootscript}" && 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;
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=if mmc dev ${mmcdev}; then
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;
fi;
init_mmc=run args_all args_mmc
get_overlay_mmc=
fdt address ${fdtaddr};
fdt resize 0x100000;
for overlay in $name_overlays;
do;
load mmc ${bootpart} ${dtboaddr} ${bootdir}/dtb/${overlay} &&
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}