[U-Boot] [PATCH V3 1/3] imx6: Define 'soc' env var for imx6 SoC

Gary Bisson gary.bisson at boundarydevices.com
Wed Apr 11 15:46:24 UTC 2018


Hi Guillaume,

On Wed, Apr 11, 2018 at 12:38:48PM +0200, Guillaume GARDET wrote:
> Signed-off-by: Guillaume GARDET <guillaume.gardet at free.fr>
> Cc: Troy Kisky <troy.kisky at boundarydevices.com>
> Cc: Stefano Babic <sbabic at denx.de>
> Cc: Fabio Estevam <fabio.estevam at nxp.com>
> Cc: Gary Bisson <gary.bisson at boundarydevices.com>
> 
> ---
>  arch/arm/mach-imx/mx6/soc.c | 34 ++++++++++++++++++++++++++++++++++
>  1 file changed, 34 insertions(+)
> 
> diff --git a/arch/arm/mach-imx/mx6/soc.c b/arch/arm/mach-imx/mx6/soc.c
> index 9b3d8f69b2..c4cb752c76 100644
> --- a/arch/arm/mach-imx/mx6/soc.c
> +++ b/arch/arm/mach-imx/mx6/soc.c
> @@ -446,6 +446,40 @@ int arch_cpu_init(void)
>  	return 0;
>  }
>  
> + #ifdef CONFIG_ARCH_MISC_INIT
> + int arch_misc_init(void)
> + {
> + #ifdef CONFIG_ENV_VARS_UBOOT_CONFIG
> +	if (is_cpu_type(MXC_CPU_MX6QP))
> +		env_set("soc", "imx6qp");
> +	else if (is_cpu_type(MXC_CPU_MX6Q))
> +		env_set("soc", "imx6q");
> +	else if (is_cpu_type(MXC_CPU_MX6DP))
> +		env_set("soc", "imx6dp");

If we want that soc variable to be used for dtb names, then the above
won't work. A i.MX6DP platform has its dtb named imx6qp-board.dtb.

> +	else if (is_cpu_type(MXC_CPU_MX6D))
> +		env_set("soc", "imx6d");

Same here, a Dual CPU actually uses a imx6q-board.dtb.

> +	else if (is_mx6dl( ))
> +		env_set("soc", "imx6dl");
> +	else if (is_mx6sx( ))
> +		env_set("soc", "imx6sx");
> +	else if (is_mx6sl( ))
> +		env_set("soc", "imx6sl");
> +	else if (is_mx6solo( ))
> +		env_set("soc", "imx6solo");

Same here, a Solo CPU uses a imx6dl-board.dtb.

> +	else if (is_mx6ul( ))
> +		env_set("soc", "imx6ul");
> +	else if (is_mx6ull( ))
> +		env_set("soc", "imx6ull");
> +	else if (is_mx6sll( ))
> +		env_set("soc", "imx6sll");
> +	else
> +		env_set("soc", "imx6");

In that case we most likely miss a CPU definition, maybe "unknown" would
be more explicit?

Regards,
Gary


More information about the U-Boot mailing list