From: Stefan Agner Date: Wed, 13 Jul 2016 07:25:39 +0000 (-0700) Subject: mx7: set soc environment according to exact SoC type X-Git-Tag: KARO-TXSD-2017-03-15~441^2~36 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ec7fde3ebfeb1dc428206bf1afca87dbd86cc29b;p=karo-tx-uboot.git mx7: set soc environment according to exact SoC type This can be useful if the same U-Boot binary is used for boards available with a i.MX 7Solo and i.MX 7Dual. Signed-off-by: Stefan Agner Reviewed-by: Simon Glass --- diff --git a/arch/arm/cpu/armv7/mx7/soc.c b/arch/arm/cpu/armv7/mx7/soc.c index ef46c92b09..dead1d3a96 100644 --- a/arch/arm/cpu/armv7/mx7/soc.c +++ b/arch/arm/cpu/armv7/mx7/soc.c @@ -248,6 +248,20 @@ int arch_cpu_init(void) return 0; } +#ifdef CONFIG_ARCH_MISC_INIT +int arch_misc_init(void) +{ +#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG + if (is_mx7d()) + setenv("soc", "imx7d"); + else + setenv("soc", "imx7s"); +#endif + + return 0; +} +#endif + #ifdef CONFIG_SERIAL_TAG void get_board_serial(struct tag_serialnr *serialnr) { diff --git a/include/configs/mx7_common.h b/include/configs/mx7_common.h index fbc6de6283..bc2833c4ff 100644 --- a/include/configs/mx7_common.h +++ b/include/configs/mx7_common.h @@ -28,6 +28,8 @@ /* Enable iomux-lpsr support */ #define CONFIG_IOMUX_LPSR +#define CONFIG_ARCH_MISC_INIT + #define CONFIG_DISPLAY_CPUINFO #define CONFIG_DISPLAY_BOARDINFO