[PATCH 08/18] environment: ti: Make get_fdt_mmc common

Nikhil M Jain n-jain1 at ti.com
Mon Jul 17 12:49:08 CEST 2023


Hi Manorit,

On 14/07/23 11:22, Manorit Chawdhry wrote:
> From: Andrew Davis <afd at ti.com>
> 
> 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 at ti.com>
> Signed-off-by: Manorit Chawdhry <m-chawdhry at ti.com>
> ---
>   board/ti/am62ax/am62ax.env     | 1 -
>   board/ti/am62x/am62x.env       | 1 -
>   board/ti/am64x/am64x.env       | 1 -
>   board/ti/am65x/am65x.env       | 1 -
>   board/ti/j721e/j721e.env       | 1 -
>   board/ti/j721s2/j721s2.env     | 1 -
>   include/environment/ti/mmc.env | 5 +++--
>   7 files changed, 3 insertions(+), 8 deletions(-)
> 
> diff --git a/board/ti/am62ax/am62ax.env b/board/ti/am62ax/am62ax.env
> index 95401756e20a..491ec973bbc6 100644
> --- a/board/ti/am62ax/am62ax.env
> +++ b/board/ti/am62ax/am62ax.env
> @@ -17,7 +17,6 @@ bootpart=1:2
>   bootdir=/boot
>   rd_spec=-
>   init_mmc=run args_all args_mmc
> -get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${name_fdt}
>   get_overlay_mmc=
>   	fdt address ${fdtaddr};
>   	fdt resize 0x100000;

get_overlay_mmc and init_mmc are also common, these can also be moved to 
mmc.env file.

> diff --git a/board/ti/am62x/am62x.env b/board/ti/am62x/am62x.env
> index 37af69199167..0901a8536da5 100644
> --- a/board/ti/am62x/am62x.env
> +++ b/board/ti/am62x/am62x.env
> @@ -17,7 +17,6 @@ bootpart=1:2
>   bootdir=/boot
>   rd_spec=-
>   init_mmc=run args_all args_mmc
> -get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${name_fdt}
>   get_overlay_mmc=
>   	fdt address ${fdtaddr};
>   	fdt resize 0x100000;
> diff --git a/board/ti/am64x/am64x.env b/board/ti/am64x/am64x.env
> index 4d27f16e8ca9..015f63a66c71 100644
> --- a/board/ti/am64x/am64x.env
> +++ b/board/ti/am64x/am64x.env
> @@ -21,7 +21,6 @@ bootpart=1:2
>   bootdir=/boot
>   rd_spec=-
>   init_mmc=run args_all args_mmc
> -get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${name_fdt}
>   get_overlay_mmc=
>   	fdt address ${fdtaddr};
>   	fdt resize 0x100000;
> diff --git a/board/ti/am65x/am65x.env b/board/ti/am65x/am65x.env
> index 3c583b77fd1e..d7130cc3f7df 100644
> --- a/board/ti/am65x/am65x.env
> +++ b/board/ti/am65x/am65x.env
> @@ -20,7 +20,6 @@ bootpart=1:2
>   bootdir=/boot
>   rd_spec=-
>   init_mmc=run args_all args_mmc
> -get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${name_fdt}
>   get_overlay_mmc=
>   	fdt address ${fdtaddr};
>   	fdt resize 0x100000;
> diff --git a/board/ti/j721e/j721e.env b/board/ti/j721e/j721e.env
> index 12b5610b3e47..23ce7e1af746 100644
> --- a/board/ti/j721e/j721e.env
> +++ b/board/ti/j721e/j721e.env
> @@ -37,7 +37,6 @@ bootpart=1:2
>   bootdir=/boot
>   rd_spec=-
>   init_mmc=run args_all args_mmc
> -get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${name_fdt}
>   get_overlay_mmc=
>   	fdt address ${fdtaddr};
>   	fdt resize 0x100000;
> diff --git a/board/ti/j721s2/j721s2.env b/board/ti/j721s2/j721s2.env
> index 67953d3f5984..9464fe499037 100644
> --- a/board/ti/j721s2/j721s2.env
> +++ b/board/ti/j721s2/j721s2.env
> @@ -31,7 +31,6 @@ name_mcur5f0_0fw=/lib/firmware/j7-mcu-r5f0_0-fw
>   #endif
>   rd_spec=-
>   init_mmc=run args_all args_mmc
> -get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${name_fdt}
>   get_overlay_mmc=
>   	fdt address ${fdtaddr};
>   	fdt resize 0x100000;
> diff --git a/include/environment/ti/mmc.env b/include/environment/ti/mmc.env
> index 5677d057d864..a052d288535e 100644
> --- a/include/environment/ti/mmc.env
> +++ b/include/environment/ti/mmc.env
> @@ -13,7 +13,8 @@ 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}/${fdtfile}
> +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};
> @@ -32,7 +33,7 @@ envboot=mmc dev ${mmcdev};
>   	fi;
>   mmcloados=
>   	if test ${boot_fdt} = yes || test ${boot_fdt} = try; then
> -		if run loadfdt; then
> +		if run get_fdt_mmc; then
>   			bootz ${loadaddr} - ${fdtaddr};
>   		else
>   			if test ${boot_fdt} = try; then
> 

Thanks,
Nikhil


More information about the U-Boot mailing list