All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Hilliard <james.hilliard1@gmail.com>
To: u-boot@lists.denx.de
Cc: James Hilliard <james.hilliard1@gmail.com>,
	Tom Rini <trini@konsulko.com>,
	Alexander Sverdlin <alexander.sverdlin@siemens.com>,
	Heiko Schocher <hs@nabladev.com>,
	Walter Schweizer <walter.schweizer@siemens.com>,
	Sumit Garg <sumit.garg@kernel.org>,
	Matthias Winker <matthias.winker@de.bosch.com>,
	Philip Oberfichtner <pro@denx.de>, Le Jin <le.jin@siemens.com>,
	Jan Kiszka <jan.kiszka@siemens.com>,
	Marek Vasut <marek.vasut+renesas@mailbox.org>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Quentin Schulz <quentin.schulz@cherry.de>,
	Daniel Golle <daniel@makrotopia.org>,
	Philip Molloy <philip.molloy@analog.com>,
	David Lechner <dlechner@baylibre.com>,
	Michael Walle <mwalle@kernel.org>,
	Varadarajan Narayanan <quic_varada@quicinc.com>,
	Peng Fan <peng.fan@nxp.com>,
	Adrian Freihofer <adrian.freihofer@siemens.com>,
	Peter Robinson <pbrobinson@gmail.com>,
	Simon Glass <sjg@chromium.org>,
	Benjamin ROBIN <dev@benjarobin.fr>
Subject: [PATCH] env: add Kconfig option for static flags list
Date: Sat,  9 May 2026 17:01:44 -0600	[thread overview]
Message-ID: <20260509230147.1308308-1-james.hilliard1@gmail.com> (raw)

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


             reply	other threads:[~2026-05-09 23:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-09 23:01 James Hilliard [this message]
2026-05-11  7:23 ` [PATCH] env: add Kconfig option for static flags list Sverdlin, Alexander
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=20260509230147.1308308-1-james.hilliard1@gmail.com \
    --to=james.hilliard1@gmail.com \
    --cc=adrian.freihofer@siemens.com \
    --cc=alexander.sverdlin@siemens.com \
    --cc=daniel@makrotopia.org \
    --cc=dev@benjarobin.fr \
    --cc=dlechner@baylibre.com \
    --cc=hs@nabladev.com \
    --cc=ilias.apalodimas@linaro.org \
    --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.