[PATCH V4 1/8] env_default: Allow CONFIG_EXTRA_ENV_TEXT to override CFG_EXTRA_ENV_SETTINGS

Tom Rini trini at konsulko.com
Wed Aug 23 16:42:53 CEST 2023


On Tue, Aug 22, 2023 at 01:41:28PM -0500, Nishanth Menon wrote:

> CFG_EXTRA_ENV_SETTINGS is set in common board config files, This allows
> for majority of the settings to be set in a common manner. However, the
> minor variations between various board can be addressed by the board.env
> files. The board.env files are converted into CONFIG_EXTRA_ENV_TEXT.
> 
> However, this creates a minor problem. For example:
> distro_bootcmd.h and used by ti_armv7_common.h uses it as:
>  #define BOOT_TARGET_DEVICES(func) \
> 	func(MMC, mmc, 0) \
> 	func(MMC, mmc, 1)
> 
> Which in turn generates:
> boot_targets=mmc0 mmc1
> 
> And this probably works fine for most boards, However when the
> boot_targets need to be reversed, the preferred behavior would have been
> to define it in board.env file as:
> boot_targets=mmc1 mmc0
> 
> By changing the order of the inclusion, we allow for the
> CONFIG_EXTRA_ENV_TEXT to have a higher priority in the definition.
> 
> Signed-off-by: Nishanth Menon <nm at ti.com>
> ---
> Cc: Simon Glass <sjg at chromium.org>
> 
> New patch
> 
>  include/env_default.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/include/env_default.h b/include/env_default.h
> index b16c22d5a28c..714dfa9e845e 100644
> --- a/include/env_default.h
> +++ b/include/env_default.h
> @@ -112,12 +112,12 @@ const char default_environment[] = {
>  #ifdef CONFIG_MTDPARTS_DEFAULT
>  	"mtdparts="	CONFIG_MTDPARTS_DEFAULT		"\0"
>  #endif
> +#ifdef	CFG_EXTRA_ENV_SETTINGS
> +	CFG_EXTRA_ENV_SETTINGS
> +#endif
>  #ifdef CONFIG_EXTRA_ENV_TEXT
>  	/* This is created in the Makefile */
>  	CONFIG_EXTRA_ENV_TEXT
> -#endif
> -#ifdef	CFG_EXTRA_ENV_SETTINGS
> -	CFG_EXTRA_ENV_SETTINGS
>  #endif
>  	"\0"
>  #else /* CONFIG_USE_DEFAULT_ENV_FILE */

The problem is that I believe we intend for CFG_EXTRA_ENV_SETTINGS to be
where we can override things in a more final manner.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20230823/efd8583d/attachment.sig>


More information about the U-Boot mailing list