Re: [U-Boot] [PATCH 4/9] mx7: set soc environment according to exact SoC type

2016-07-05 Thread Stefan Agner
On 2016-07-05 13:56, Fabio Estevam wrote:
> On Tue, Jul 5, 2016 at 5:47 PM, Stefan Agner  wrote:
> 
>> Sounds sensible. Would be the first use of
>> CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG in arch/arm/, but I guess that is
>> fine.
> 
> To keep the consistency you could add
> CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG in your board file, just like the
> other boards.

Yeah sure, to define it I would put into our board config.

But what I ment here is it would be the first use of
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG in _code_ under arch/arm. All other
uses of CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG are in board specific code
under boards/...

> 
>> Note that CONFIG_SYS_SOC, which defines the environment variable "soc",
>> is currently defined "mx7" by default...
>>
>> What do you think, do we want
>> CONFIG_ARCH_MISC_INIT/CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG set for i.MX
>> 7 Sabre/Warp7? Put it in Common directly? Afaik those boards only exist
>> in a single variant, hence they always will load the same device tree
>> and therefore it wouldn't be really required to determine the SoC at
>> runtime.
> 
> Correct: we don't need to use CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG for
> mx7sabresd/warp as they only use a single variant of the MX7 chip.

Ok, use it only in our config then.

--
Stefan
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/9] mx7: set soc environment according to exact SoC type

2016-07-05 Thread Fabio Estevam
On Tue, Jul 5, 2016 at 5:47 PM, Stefan Agner  wrote:

> Sounds sensible. Would be the first use of
> CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG in arch/arm/, but I guess that is
> fine.

To keep the consistency you could add
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG in your board file, just like the
other boards.

> Note that CONFIG_SYS_SOC, which defines the environment variable "soc",
> is currently defined "mx7" by default...
>
> What do you think, do we want
> CONFIG_ARCH_MISC_INIT/CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG set for i.MX
> 7 Sabre/Warp7? Put it in Common directly? Afaik those boards only exist
> in a single variant, hence they always will load the same device tree
> and therefore it wouldn't be really required to determine the SoC at
> runtime.

Correct: we don't need to use CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG for
mx7sabresd/warp as they only use a single variant of the MX7 chip.


>
> --
> Stefan
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/9] mx7: set soc environment according to exact SoC type

2016-07-05 Thread Stefan Agner
On 2016-07-04 05:27, Fabio Estevam wrote:
> Hi Stefan,
> 
> On Sun, Jul 3, 2016 at 4:33 PM, Stefan Agner  wrote:
> 
>> +#ifdef CONFIG_ARCH_MISC_INIT
>> +int arch_misc_init(void)
>> +{
>> +   if (is_mx7d())
>> +   setenv("soc", "imx7d");
>> +   else
>> +   setenv("soc", "imx7s");
>> +
>> +   return 0;
>> +}
>> +#endif
> 
> For SoC detection type in run-time we usually use "ifdef
> CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG".
> 
> Take a look at udoo, wandboard, mx6cubox, mx6sabresd.c for reference.
> 
> It would be nice to keep it consistent here too.

Sounds sensible. Would be the first use of
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG in arch/arm/, but I guess that is
fine.

Note that CONFIG_SYS_SOC, which defines the environment variable "soc",
is currently defined "mx7" by default...

What do you think, do we want
CONFIG_ARCH_MISC_INIT/CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG set for i.MX
7 Sabre/Warp7? Put it in Common directly? Afaik those boards only exist
in a single variant, hence they always will load the same device tree
and therefore it wouldn't be really required to determine the SoC at
runtime.

--
Stefan
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/9] mx7: set soc environment according to exact SoC type

2016-07-04 Thread Fabio Estevam
Hi Stefan,

On Sun, Jul 3, 2016 at 4:33 PM, Stefan Agner  wrote:

> +#ifdef CONFIG_ARCH_MISC_INIT
> +int arch_misc_init(void)
> +{
> +   if (is_mx7d())
> +   setenv("soc", "imx7d");
> +   else
> +   setenv("soc", "imx7s");
> +
> +   return 0;
> +}
> +#endif

For SoC detection type in run-time we usually use "ifdef
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG".

Take a look at udoo, wandboard, mx6cubox, mx6sabresd.c for reference.

It would be nice to keep it consistent here too.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/9] mx7: set soc environment according to exact SoC type

2016-07-03 Thread Simon Glass
On 3 July 2016 at 13:33, Stefan Agner  wrote:
> From: Stefan Agner 
>
> 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 
> ---
>
>  arch/arm/cpu/armv7/mx7/soc.c | 12 
>  include/configs/mx7_common.h |  2 ++
>  2 files changed, 14 insertions(+)

Reviewed-by: Simon Glass 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot