All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Sverdlin, Alexander" <alexander.sverdlin@siemens.com>
To: "u-boot@lists.denx.de" <u-boot@lists.denx.de>,
	"james.hilliard1@gmail.com" <james.hilliard1@gmail.com>
Cc: "peng.fan@nxp.com" <peng.fan@nxp.com>,
	"mwalle@kernel.org" <mwalle@kernel.org>,
	"matthias.winker@de.bosch.com" <matthias.winker@de.bosch.com>,
	"pbrobinson@gmail.com" <pbrobinson@gmail.com>,
	"marek.vasut+renesas@mailbox.org"
	<marek.vasut+renesas@mailbox.org>,
	"trini@konsulko.com" <trini@konsulko.com>,
	 "Kiszka, Jan" <jan.kiszka@siemens.com>,
	"sumit.garg@kernel.org" <sumit.garg@kernel.org>,
	"quentin.schulz@cherry.de" <quentin.schulz@cherry.de>,
	"hs@nabladev.com" <hs@nabladev.com>,
	"dlechner@baylibre.com" <dlechner@baylibre.com>,
	"daniel@makrotopia.org" <daniel@makrotopia.org>,
	"quic_varada@quicinc.com" <quic_varada@quicinc.com>,
	 "Jin, Le" <le.jin@siemens.com>,
	"ilias.apalodimas@linaro.org" <ilias.apalodimas@linaro.org>,
	"Schweizer, Walter" <walter.schweizer@siemens.com>,
	"Freihofer, Adrian" <adrian.freihofer@siemens.com>,
	"sjg@chromium.org" <sjg@chromium.org>,
	"dev@benjarobin.fr" <dev@benjarobin.fr>,
	"pro@denx.de" <pro@denx.de>,
	"philip.molloy@analog.com" <philip.molloy@analog.com>
Subject: Re: [PATCH] env: add Kconfig option for static flags list
Date: Mon, 11 May 2026 07:23:17 +0000	[thread overview]
Message-ID: <e1e43a0034dff719e0df12437f8d018d5aed82ae.camel@siemens.com> (raw)
In-Reply-To: <20260509230147.1308308-1-james.hilliard1@gmail.com>

Hi James, 

On Sat, 2026-05-09 at 17:01 -0600, James Hilliard wrote:
> Environment callbacks can already be configured from Kconfig with
> CONFIG_ENV_CALLBACK_LIST_STATIC, but static environment flags still
> require board headers to define CFG_ENV_FLAGS_LIST_STATIC.
> 
> Add CONFIG_ENV_FLAGS_LIST_STATIC and append it to ENV_FLAGS_LIST_STATIC
> after the legacy CFG_ENV_FLAGS_LIST_STATIC value. Normalize existing
> CFG_ENV_FLAGS_LIST_STATIC definitions to end with a comma so the Kconfig
> list can be concatenated directly.
> 
> This lets boards configure writeable-list policy and type validation
> from defconfig without adding a config header solely for env flags.
> 
> Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
> ---
>  README                             |  6 ++++++
>  env/Kconfig                        | 13 +++++++++++++
>  include/configs/capricorn-common.h |  2 +-
>  include/configs/hmibsc.h           |  2 +-
>  include/configs/imx6q-bosch-acc.h  |  2 +-
>  include/configs/iot2050.h          |  2 +-
>  include/configs/socrates.h         |  2 +-
>  include/env_flags.h                |  3 ++-
>  8 files changed, 26 insertions(+), 6 deletions(-)
> 
> diff --git a/README b/README
> index 6836a917c79..b963ce23078 100644
> --- a/README
> +++ b/README
> @@ -1107,6 +1107,7 @@ Configuration Settings:
>  		Use buffered writes to flash.
>  
>  - CONFIG_ENV_FLAGS_LIST_DEFAULT
> +- CONFIG_ENV_FLAGS_LIST_STATIC
>  - CFG_ENV_FLAGS_LIST_STATIC
>  	Enable validation of the values given to environment variables when
>  	calling env set.  Variables can be restricted to only decimal,
> @@ -1133,11 +1134,16 @@ Configuration Settings:
>  		r - Read-only
>  		o - Write-once
>  		c - Change-default
> +		w - Writeable if CONFIG_ENV_WRITEABLE_LIST is enabled
>  
>  	- CONFIG_ENV_FLAGS_LIST_DEFAULT
>  		Define this to a list (string) to define the ".flags"
>  		environment variable in the default or embedded environment.
>  
> +	- CONFIG_ENV_FLAGS_LIST_STATIC
> +		Define this to a list (string) to add to the static flags
> +		list.
> +
>  	- CFG_ENV_FLAGS_LIST_STATIC
>  		Define this to a list (string) to define validation that
>  		should be done if an entry is not found in the ".flags"
> diff --git a/env/Kconfig b/env/Kconfig
> index 7abd82ab6f3..ca8f9aff19e 100644
> --- a/env/Kconfig
> +++ b/env/Kconfig
> @@ -34,6 +34,19 @@ config ENV_CALLBACK_LIST_STATIC
>  	  If the callback name is not specified, then the callback is deleted.
>  	  Spaces are also allowed anywhere in the list.
>  
> +config ENV_FLAGS_LIST_STATIC
> +	string "Static flags list"
> +	default ""
> +	help
> +	  The environment flags are associated with variables in a static
> +	  list. Define this list in the same format as
> +	  CFG_ENV_FLAGS_LIST_STATIC.
> +
> +	  When CONFIG_ENV_WRITEABLE_LIST is enabled, the 'w' access attribute
> +	  can be used to mark variables as writable.
> +
> +	  Spaces are also allowed anywhere in the list.
> +
>  config SAVEENV
>  	def_bool y if CMD_SAVEENV
>  
> diff --git a/include/configs/capricorn-common.h b/include/configs/capricorn-common.h
> index ee13d2ab950..95a05d64d68 100644
> --- a/include/configs/capricorn-common.h
> +++ b/include/configs/capricorn-common.h
> @@ -48,7 +48,7 @@
>  	"sig_a:sw,sig_b:sw," \
>  	"target_env:sw," \
>  	"upgrade_available:dw," \
> -	"ustate:dw"
> +	"ustate:dw,"

the implicit requirement to have a coma at the end looks a bit fragile
or error-prone to me, I'm not sure if there could be a better option...

>  #endif
>  
>  /* Default location for tftp and bootm */
> diff --git a/include/configs/hmibsc.h b/include/configs/hmibsc.h
> index 950ec8b190d..cca562a66c9 100644
> --- a/include/configs/hmibsc.h
> +++ b/include/configs/hmibsc.h
> @@ -10,6 +10,6 @@
>  
>  /* PHY needs a longer aneg time */
>  
> -#define CFG_ENV_FLAGS_LIST_STATIC "BOOT_A_LEFT:dw,BOOT_B_LEFT:dw,BOOT_ORDER:sw"
> +#define CFG_ENV_FLAGS_LIST_STATIC "BOOT_A_LEFT:dw,BOOT_B_LEFT:dw,BOOT_ORDER:sw,"
>  
>  #endif
> diff --git a/include/configs/imx6q-bosch-acc.h b/include/configs/imx6q-bosch-acc.h
> index 84da8250684..5662b59343e 100644
> --- a/include/configs/imx6q-bosch-acc.h
> +++ b/include/configs/imx6q-bosch-acc.h
> @@ -54,7 +54,7 @@
>  	"fitpart:dw," \
>  	"mmcpart:dw," \
>  	"production:bw," \
> -	"ustate:dw"
> +	"ustate:dw,"
>  
>  #else
>  /* SD Card boot */
> diff --git a/include/configs/iot2050.h b/include/configs/iot2050.h
> index 5c58c7bbaab..fe3fd5405d7 100644
> --- a/include/configs/iot2050.h
> +++ b/include/configs/iot2050.h
> @@ -43,7 +43,7 @@
>  	"board_uuid:sw,board_name:sw,board_serial:sw,board_a5e:sw,"	\
>  	"mlfb:sw,fw_version:sw,seboot_version:sw,"			\
>  	"m2_manual_config:sw,"						\
> -	"eth1addr:mw,eth2addr:mw,watchdog_timeout_ms:dw,boot_targets:sw"
> +	"eth1addr:mw,eth2addr:mw,watchdog_timeout_ms:dw,boot_targets:sw,"
>  #endif
>  
>  #endif /* __CONFIG_IOT2050_H */
> diff --git a/include/configs/socrates.h b/include/configs/socrates.h
> index 006d649f6ed..9cd0abd60aa 100644
> --- a/include/configs/socrates.h
> +++ b/include/configs/socrates.h
> @@ -108,7 +108,7 @@
>   */
>  #define CFG_SYS_BOOTMAPSZ	(8 << 20)	/* Initial Memory map for Linux	*/
>  
> -#define CFG_ENV_FLAGS_LIST_STATIC "ethaddr:mw,eth1addr:mw,system1_addr:xw,serial#:sw,ethact:sw,ethprime:sw"
> +#define CFG_ENV_FLAGS_LIST_STATIC "ethaddr:mw,eth1addr:mw,system1_addr:xw,serial#:sw,ethact:sw,ethprime:sw,"
>  
>  /* pass open firmware flat tree */
>  
> diff --git a/include/env_flags.h b/include/env_flags.h
> index 123fdbcb0ba..98b50c72227 100644
> --- a/include/env_flags.h
> +++ b/include/env_flags.h
> @@ -89,7 +89,8 @@ enum env_flags_varaccess {
>  	NET_FLAGS \
>  	NET6_FLAGS \
>  	SERIAL_FLAGS \
> -	CFG_ENV_FLAGS_LIST_STATIC
> +	CFG_ENV_FLAGS_LIST_STATIC \

While other macros are local to this header, CFG_ENV_FLAGS_LIST_STATIC
is external to it and the requirement to have a trailing coma is not
obvious... The patch itself looks good though, but maybe there is a way
to make this more robust.

> +	CONFIG_ENV_FLAGS_LIST_STATIC
>  
>  #ifdef CONFIG_CMD_ENV_FLAGS
>  /*

-- 
Alexander Sverdlin
Siemens AG
www.siemens.com

  reply	other threads:[~2026-05-11  7:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-09 23:01 [PATCH] env: add Kconfig option for static flags list James Hilliard
2026-05-11  7:23 ` Sverdlin, Alexander [this message]
2026-05-11 12:23   ` Sverdlin, Alexander
2026-05-11 12:33 ` Quentin Schulz
2026-05-11 13:41 ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e1e43a0034dff719e0df12437f8d018d5aed82ae.camel@siemens.com \
    --to=alexander.sverdlin@siemens.com \
    --cc=adrian.freihofer@siemens.com \
    --cc=daniel@makrotopia.org \
    --cc=dev@benjarobin.fr \
    --cc=dlechner@baylibre.com \
    --cc=hs@nabladev.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=james.hilliard1@gmail.com \
    --cc=jan.kiszka@siemens.com \
    --cc=le.jin@siemens.com \
    --cc=marek.vasut+renesas@mailbox.org \
    --cc=matthias.winker@de.bosch.com \
    --cc=mwalle@kernel.org \
    --cc=pbrobinson@gmail.com \
    --cc=peng.fan@nxp.com \
    --cc=philip.molloy@analog.com \
    --cc=pro@denx.de \
    --cc=quentin.schulz@cherry.de \
    --cc=quic_varada@quicinc.com \
    --cc=sjg@chromium.org \
    --cc=sumit.garg@kernel.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=walter.schweizer@siemens.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.