* [PATCH] env: add Kconfig option for static flags list
@ 2026-05-09 23:01 James Hilliard
2026-05-11 7:23 ` Sverdlin, Alexander
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: James Hilliard @ 2026-05-09 23:01 UTC (permalink / raw)
To: u-boot
Cc: James Hilliard, Tom Rini, Alexander Sverdlin, Heiko Schocher,
Walter Schweizer, Sumit Garg, Matthias Winker,
Philip Oberfichtner, Le Jin, Jan Kiszka, Marek Vasut,
Ilias Apalodimas, Quentin Schulz, Daniel Golle, Philip Molloy,
David Lechner, Michael Walle, Varadarajan Narayanan, Peng Fan,
Adrian Freihofer, Peter Robinson, Simon Glass, Benjamin ROBIN
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,"
#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 \
+ CONFIG_ENV_FLAGS_LIST_STATIC
#ifdef CONFIG_CMD_ENV_FLAGS
/*
--
2.53.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] env: add Kconfig option for static flags list
2026-05-09 23:01 [PATCH] env: add Kconfig option for static flags list James Hilliard
@ 2026-05-11 7:23 ` Sverdlin, Alexander
2026-05-11 12:23 ` Sverdlin, Alexander
2026-05-11 12:33 ` Quentin Schulz
2026-05-11 13:41 ` Simon Glass
2 siblings, 1 reply; 5+ messages in thread
From: Sverdlin, Alexander @ 2026-05-11 7:23 UTC (permalink / raw)
To: u-boot@lists.denx.de, james.hilliard1@gmail.com
Cc: peng.fan@nxp.com, mwalle@kernel.org, matthias.winker@de.bosch.com,
pbrobinson@gmail.com, marek.vasut+renesas@mailbox.org,
trini@konsulko.com, Kiszka, Jan, sumit.garg@kernel.org,
quentin.schulz@cherry.de, hs@nabladev.com, dlechner@baylibre.com,
daniel@makrotopia.org, quic_varada@quicinc.com, Jin, Le,
ilias.apalodimas@linaro.org, Schweizer, Walter, Freihofer, Adrian,
sjg@chromium.org, dev@benjarobin.fr, pro@denx.de,
philip.molloy@analog.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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] env: add Kconfig option for static flags list
2026-05-11 7:23 ` Sverdlin, Alexander
@ 2026-05-11 12:23 ` Sverdlin, Alexander
0 siblings, 0 replies; 5+ messages in thread
From: Sverdlin, Alexander @ 2026-05-11 12:23 UTC (permalink / raw)
To: u-boot@lists.denx.de, james.hilliard1@gmail.com
Cc: peng.fan@nxp.com, mwalle@kernel.org, matthias.winker@de.bosch.com,
pbrobinson@gmail.com, marek.vasut+renesas@mailbox.org,
trini@konsulko.com, Kiszka, Jan, sumit.garg@kernel.org,
quentin.schulz@cherry.de, hs@nabladev.com, dlechner@baylibre.com,
daniel@makrotopia.org, quic_varada@quicinc.com, Jin, Le,
ilias.apalodimas@linaro.org, Schweizer, Walter, Freihofer, Adrian,
sjg@chromium.org, dev@benjarobin.fr, pro@denx.de,
philip.molloy@analog.com
Hi James,
On Mon, 2026-05-11 at 09:23 +0200, Alexander Sverdlin wrote:
> 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 \
Wouldn't it be advantageous to just add "," here ^^^?
Both keeping board config headers untouched and not imposing
comma requirement on them?
>
> 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] env: add Kconfig option for static flags list
2026-05-09 23:01 [PATCH] env: add Kconfig option for static flags list James Hilliard
2026-05-11 7:23 ` Sverdlin, Alexander
@ 2026-05-11 12:33 ` Quentin Schulz
2026-05-11 13:41 ` Simon Glass
2 siblings, 0 replies; 5+ messages in thread
From: Quentin Schulz @ 2026-05-11 12:33 UTC (permalink / raw)
To: James Hilliard, u-boot
Cc: Tom Rini, Alexander Sverdlin, Heiko Schocher, Walter Schweizer,
Sumit Garg, Matthias Winker, Philip Oberfichtner, Le Jin,
Jan Kiszka, Marek Vasut, Ilias Apalodimas, Daniel Golle,
Philip Molloy, David Lechner, Michael Walle,
Varadarajan Narayanan, Peng Fan, Adrian Freihofer, Peter Robinson,
Simon Glass, Benjamin ROBIN
Hi James,
On 5/10/26 1:01 AM, 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
Do we *really* need both? What about migrating CFG_ENV_FLAGS_LIST_STATIC
into a Kconfig symbol entirely? We've done this to a lot of CFG_
constants in the past so it's like there's no precedent.
> 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.
> +
I don't want to be looking for where this is explained, can you at the
very least point at where this information is available or even maybe
integrate it here?
Cheers,
Quentin
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] env: add Kconfig option for static flags list
2026-05-09 23:01 [PATCH] env: add Kconfig option for static flags list James Hilliard
2026-05-11 7:23 ` Sverdlin, Alexander
2026-05-11 12:33 ` Quentin Schulz
@ 2026-05-11 13:41 ` Simon Glass
2 siblings, 0 replies; 5+ messages in thread
From: Simon Glass @ 2026-05-11 13:41 UTC (permalink / raw)
To: james.hilliard1
Cc: u-boot, Tom Rini, Alexander Sverdlin, Heiko Schocher,
Walter Schweizer, Sumit Garg, Matthias Winker,
Philip Oberfichtner, Le Jin, Jan Kiszka, Marek Vasut,
Ilias Apalodimas, Quentin Schulz, Daniel Golle, Philip Molloy,
David Lechner, Michael Walle, Varadarajan Narayanan, Peng Fan,
Adrian Freihofer, Peter Robinson, Simon Glass, Benjamin ROBIN
Hi James,
On 2026-05-09T23:01:44, James Hilliard <james.hilliard1@gmail.com> wrote:
> env: add Kconfig option for static flags list
>
> 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(-)
We are trying to migrate away from the README, so would it be possible
to move the docs to one of these files instead:
doc/develop/environment.rst
doc/usage/environment.rst
> diff --git 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 \
> + CONFIG_ENV_FLAGS_LIST_STATIC
In include/configs/aristainetos2.h
#define CFG_ENV_FLAGS_LIST_STATIC 'ethaddr:mw,serial#:sw,board_type:sw,' \
'sysnum:dw,panel:sw,ipaddr:iw,serverip:iw'
No trailing comma, so setting both will run serverip:iw into the first
Kconfig entry. Please normalise this one too.
> diff --git a/env/Kconfig b/env/Kconfig
> @@ -34,6 +34,19 @@ config ENV_CALLBACK_LIST_STATIC
> +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.
I agree with Quentin, There are only five remaining users of
CFG_ENV_FLAGS_LIST_STATIC, so you should consider converting each to a
defconfig setting of CONFIG_ENV_FLAGS_LIST_STATIC and dropping
CFG_ENV_FLAGS_LIST_STATIC entirely. Carrying two parallel mechanisms
plus the trailing-comma rule seems more confusing than finishing the
move.
> diff --git a/env/Kconfig b/env/Kconfig
> @@ -34,6 +34,19 @@ config ENV_CALLBACK_LIST_STATIC
> + When CONFIG_ENV_WRITEABLE_LIST is enabled, the 'w' access attribute
> + can be used to mark variables as writable.
Regards,
Simon
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-05-11 13:42 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-09 23:01 [PATCH] env: add Kconfig option for static flags list James Hilliard
2026-05-11 7:23 ` Sverdlin, Alexander
2026-05-11 12:23 ` Sverdlin, Alexander
2026-05-11 12:33 ` Quentin Schulz
2026-05-11 13:41 ` Simon Glass
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.