env: migrate static flags list to Kconfig
PATCH v3 1/2 env: migrate static flags list to Kconfig
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 use it as the only board-provided static environment flags list. Convert the remaining default-config users from CFG_ENV_FLAGS_LIST_STATIC to defconfig settings and drop the legacy header macro from ENV_FLAGS_LIST_STATIC.
Move the environment flags format documentation out of README and into the developer environment documentation. Include the format in the Kconfig help as well.
This lets boards configure writeable-list policy and type validation from defconfig without adding a config header solely for env flags.
This preserves the behavior of default configs. Header-only cases that were inactive in upstream defconfigs are not converted into defconfig
entries: iot2050 can add its list when enabling ENV_WRITEABLE_LIST, and smegw01 can add mmcdev:dw support if the unlocked SYS_BOOT_LOCKED=n configuration is needed.
---
Changes v2 -> v3:
- Note that inactive header-only iot2050 flags and the smegw01 SYS_BOOT_LOCKED=n mmcdev:dw flag are not converted into defconfigs.
Changes v1 -> v2:
- Convert existing CFG_ENV_FLAGS_LIST_STATIC users to CONFIG_ENV_FLAGS_LIST_STATIC in defconfigs.
- Drop CFG_ENV_FLAGS_LIST_STATIC support instead of appending the new Kconfig value after the legacy C macro.
- Remove the trailing-comma requirement for board-specific static flags.
- Place the migrated defconfig entries in savedefconfig order.
- Move environment flags documentation from README to doc/develop/environment.rst.
- Add the flags-list format to the CONFIG_ENV_FLAGS_LIST_STATIC Kconfig help text.
--- README | 45 +--------------------------- configs/aristainetos2c_defconfig | 1 + configs/aristainetos2ccslb_defconfig | 1 + configs/hmibsc_defconfig | 1 + configs/imx6q_bosch_acc_defconfig | 1 + configs/imx8qxp_capricorn.config | 1 + configs/smegw01_defconfig | 1 + configs/socrates_defconfig | 1 + doc/develop/environment.rst | 40 +++++++++++++++++++++++++ env/Kconfig | 23 ++++++++++++++ include/configs/aristainetos2.h | 3 -- include/configs/capricorn-common.h | 13 -------- include/configs/hmibsc.h | 4 --- include/configs/imx6q-bosch-acc.h | 12 -------- include/configs/iot2050.h | 8 ----- include/configs/smegw01.h | 15 ---------- include/configs/socrates.h | 2 -- include/env_flags.h | 6 +--- 18 files changed, 72 insertions(+), 106 deletions(-)
README +1 -44
@@ -799,7 +799,7 @@ The following options need to be configured: The same can be accomplished in a more flexible way for any variable by configuring the type of access to allow for those variables in the ".flags" variable - or define CFG_ENV_FLAGS_LIST_STATIC. + or by setting CONFIG_ENV_FLAGS_LIST_STATIC. - Protected RAM: CFG_PRAM
@@ -1106,49 +1106,6 @@ Configuration Settings: - CONFIG_SYS_FLASH_USE_BUFFER_WRITE Use buffered writes to flash. -- CONFIG_ENV_FLAGS_LIST_DEFAULT -- 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, - hexadecimal, or boolean. If CONFIG_CMD_NET is also defined, - the variables can also be restricted to IP address or MAC address. - - The format of the list is: - type_attribute = [s|d|x|b|i|m] - access_attribute = [a|r|o|c] - attributes = type_attribute[access_attribute] - entry = variable_name[:attributes] - list = entry[,list] - - The type attributes are: - s - String (default) - d - Decimal - x - Hexadecimal - b - Boolean ([1yYtT|0nNfF]) - i - IP address - m - MAC address - - The access attributes are: - a - Any (default) - r - Read-only - o - Write-once - c - Change-default - - - CONFIG_ENV_FLAGS_LIST_DEFAULT - Define this to a list (string) to define the ".flags" - environment variable in the default or embedded environment. - - - 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" - environment variable. To override a setting in the static - list, simply add an entry for the same variable name to the - ".flags" variable. - - If CONFIG_REGEX is defined, the variable_name above is evaluated as a - regular expression. This allows multiple variables to define the same - flags without explicitly listing them for each variable. - The following definitions that deal with the placement and management of environment data (variable area); in general, we support the following configurations:
configs/aristainetos2c_defconfig +1 -0
@@ -56,6 +56,7 @@ CONFIG_CMD_UBI=y CONFIG_OF_CONTROL=y CONFIG_DTB_RESELECT=y CONFIG_MULTI_DTB_FIT=y +CONFIG_ENV_FLAGS_LIST_STATIC="ethaddr:mw,serial#:sw,board_type:sw,sysnum:dw,panel:sw,ipaddr:iw,serverip:iw" CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_IN_SPI_FLASH=y CONFIG_ENV_SPI_EARLY=y
configs/aristainetos2ccslb_defconfig +1 -0
@@ -56,6 +56,7 @@ CONFIG_CMD_UBI=y CONFIG_OF_CONTROL=y CONFIG_DTB_RESELECT=y CONFIG_MULTI_DTB_FIT=y +CONFIG_ENV_FLAGS_LIST_STATIC="ethaddr:mw,serial#:sw,board_type:sw,sysnum:dw,panel:sw,ipaddr:iw,serverip:iw" CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_IN_SPI_FLASH=y CONFIG_ENV_SPI_EARLY=y
configs/hmibsc_defconfig +1 -0
@@ -41,6 +41,7 @@ CONFIG_CMD_EXT4=y CONFIG_CMD_FAT=y CONFIG_CMD_FS_GENERIC=y # CONFIG_OF_UPSTREAM is not set +CONFIG_ENV_FLAGS_LIST_STATIC="BOOT_A_LEFT:dw,BOOT_B_LEFT:dw,BOOT_ORDER:sw" CONFIG_ENV_IS_IN_MMC=y CONFIG_ENV_RELOC_GD_ENV_ADDR=y CONFIG_ENV_MMC_EMMC_HW_PARTITION=2
configs/imx6q_bosch_acc_defconfig +1 -0
@@ -74,6 +74,7 @@ CONFIG_EFI_PARTITION=y CONFIG_SPL_OF_CONTROL=y CONFIG_MULTI_DTB_FIT=y CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clocks clock-names interrupt-parent" +CONFIG_ENV_FLAGS_LIST_STATIC="bootset:bw,clone_pending:bw,endurance_test:bw,env_persisted:bw,factory_reset:bw,fdtcontroladdr:xw,fitpart:dw,mmcpart:dw,production:bw,ustate:dw" CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_IN_MMC=y CONFIG_ENV_REDUNDANT=y
configs/imx8qxp_capricorn.config +1 -0
@@ -92,6 +92,7 @@ CONFIG_CMD_EXT4=y CONFIG_CMD_FAT=y CONFIG_CMD_FS_GENERIC=y CONFIG_SPL_OF_CONTROL=y +CONFIG_ENV_FLAGS_LIST_STATIC="bootcount:dw,bootdelay:sw,bootlimit:dw,partitionset_active:sw,rastate:dw,sig_a:sw,sig_b:sw,target_env:sw,upgrade_available:dw,ustate:dw" CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_IN_MMC=y
configs/smegw01_defconfig +1 -0
@@ -48,6 +48,7 @@ CONFIG_CMD_FAT=y CONFIG_CMD_SQUASHFS=y CONFIG_CMD_FS_GENERIC=y CONFIG_OF_CONTROL=y +CONFIG_ENV_FLAGS_LIST_STATIC="mmcpart:dw,mmcpart_committed:dw,ustate:dw,bootcount:dw,bootlimit:dw,upgrade_available:dw" CONFIG_ENV_OVERWRITE=y CONFIG_ENV_REDUNDANT=y CONFIG_ENV_RELOC_GD_ENV_ADDR=y
configs/socrates_defconfig +1 -0
@@ -66,6 +66,7 @@ CONFIG_MTDIDS_DEFAULT="nor0=fe000000.nor_flash,nand0=socrates_nand" CONFIG_MTDPARTS_DEFAULT="mtdparts=fe000000.nor_flash:13312k(system1),13312k(system2),5120k(data),128k(env),128k(env-red),768k(u-boot);socrates_nand:256M(ubi-data1),-(ubi-data2)" # CONFIG_CMD_IRQ is not set CONFIG_OF_CONTROL=y +CONFIG_ENV_FLAGS_LIST_STATIC="ethaddr:mw,eth1addr:mw,system1_addr:xw,serial#:sw,ethact:sw,ethprime:sw" CONFIG_ENV_IS_IN_FLASH=y CONFIG_ENV_REDUNDANT=y CONFIG_ENV_ADDR_REDUND=0xFFF00000
doc/develop/environment.rst +40 -0
@@ -49,3 +49,43 @@ The signature of the callback functions is:: include/search.h The return value is 0 if the variable change is accepted and 1 otherwise. + +Flags for environment variables +------------------------------- + +Environment flags validate the values given to environment variables and +restrict how environment variables can be changed. + +The static list is configured with CONFIG_ENV_FLAGS_LIST_STATIC. The list +must be in the following format:: + + type_attribute = [s|d|x|b|i|m] + access_attribute = [a|r|o|c|w] + attributes = type_attribute[access_attribute] + entry = variable_name[:attributes] + list = entry[,list] + +The type attributes are: + +* s - String (default) +* d - Decimal +* x - Hexadecimal +* b - Boolean ([1yYtT|0nNfF]) +* i - IP address, if networking is enabled +* m - MAC address, if networking is enabled + +The access attributes are: + +* a - Any (default) +* r - Read-only +* o - Write-once +* c - Change-default +* w - Writeable, if CONFIG_ENV_WRITEABLE_LIST is enabled + +CONFIG_ENV_FLAGS_LIST_DEFAULT defines the ``.flags`` variable in the +default or embedded environment. Any association in ``.flags`` overrides +an association in the static list. + +If CONFIG_REGEX is defined, the variable name is evaluated as a regular +expression. This allows multiple variables to define the same flags without +explicitly listing them all.
env/Kconfig +23 -0
@@ -34,6 +34,29 @@ 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 following format: + + type_attribute = [s|d|x|b|i|m] + access_attribute = [a|r|o|c|w] + attributes = type_attribute[access_attribute] + entry = variable_name[:attributes] + list = entry[,list] + + The type attributes are s for string, d for decimal, x for + hexadecimal and b for boolean. If networking is enabled, i can + be used for IP addresses and m for MAC addresses. + + The access attributes are a for any, r for read-only, o for + write-once and c for change-default. When CONFIG_ENV_WRITEABLE_LIST + is enabled, w can be used to mark variables as writable. + + Spaces are also allowed anywhere in the list. + config SAVEENV def_bool y if CMD_SAVEENV
include/configs/aristainetos2.h +0 -3
@@ -413,7 +413,4 @@/* UBI support */ -#define CFG_ENV_FLAGS_LIST_STATIC "ethaddr:mw,serial#:sw,board_type:sw," \ - "sysnum:dw,panel:sw,ipaddr:iw,serverip:iw" -#endif /* __ARISTAINETOS2_CONFIG_H */
include/configs/capricorn-common.h +0 -13
@@ -38,19 +38,6 @@#define CFG_EXTRA_ENV_SETTINGS \ AHAB_ENV -#ifdef CONFIG_ENV_WRITEABLE_LIST -#define CFG_ENV_FLAGS_LIST_STATIC \ - "bootcount:dw," \ - "bootdelay:sw," \ - "bootlimit:dw," \ - "partitionset_active:sw," \ - "rastate:dw," \ - "sig_a:sw,sig_b:sw," \ - "target_env:sw," \ - "upgrade_available:dw," \ - "ustate:dw" -#endif -/* Default location for tftp and bootm */ /* On CCP board, USDHC1 is for eMMC */
include/configs/hmibsc.h +0 -4
@@ -8,8 +8,4 @@#ifndef __CONFIGS_HMIBSC_H#define __CONFIGS_HMIBSC_H -/* PHY needs a longer aneg time */ - -#define CFG_ENV_FLAGS_LIST_STATIC "BOOT_A_LEFT:dw,BOOT_B_LEFT:dw,BOOT_ORDER:sw" -#endif
include/configs/imx6q-bosch-acc.h +0 -12
@@ -44,18 +44,6 @@"then env set env_persisted 1; run save_env; fi;\0" \ "save_env=env save; env save\0" -#define CFG_ENV_FLAGS_LIST_STATIC \ - "bootset:bw," \ - "clone_pending:bw," \ - "endurance_test:bw," \ - "env_persisted:bw," \ - "factory_reset:bw," \ - "fdtcontroladdr:xw," \ - "fitpart:dw," \ - "mmcpart:dw," \ - "production:bw," \ - "ustate:dw" -#else /* SD Card boot */ #define ENV_EXTRA \
include/configs/iot2050.h +0 -8
@@ -38,12 +38,4 @@ func(MMC, mmc, 0) \ BOOT_TARGET_USB(func) -#ifdef CONFIG_ENV_WRITEABLE_LIST -#define CFG_ENV_FLAGS_LIST_STATIC \ - "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" -#endif -#endif /* __CONFIG_IOT2050_H */
include/configs/smegw01.h +0 -15
@@ -22,21 +22,6 @@#define EXTRA_BOOTPARAMS #endif -#ifdef CONFIG_SYS_BOOT_LOCKED -#define EXTRA_ENV_FLAGS -#else -#define EXTRA_ENV_FLAGS "mmcdev:dw," -#endif - -#define CFG_ENV_FLAGS_LIST_STATIC \ - "mmcpart:dw," \ - "mmcpart_committed:dw," \ - "ustate:dw," \ - "bootcount:dw," \ - "bootlimit:dw," \ - "upgrade_available:dw," \ - EXTRA_ENV_FLAGS -/* Physical Memory Map */ #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
include/configs/socrates.h +0 -2
@@ -108,8 +108,6 @@*/ #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" -/* pass open firmware flat tree */ #endif /* __CONFIG_H */
include/env_flags.h +1 -5
@@ -37,10 +37,6 @@ enum env_flags_varaccess {#define ENV_FLAGS_VARTYPE_LOC 0#define ENV_FLAGS_VARACCESS_LOC 1 -#ifndef CFG_ENV_FLAGS_LIST_STATIC -#define CFG_ENV_FLAGS_LIST_STATIC "" -#endif -#if CONFIG_IS_ENABLED (NET )#ifdef CONFIG_REGEX #define ETHADDR_WILDCARD "\\d*"
@@ -89,7 +85,7 @@ enum env_flags_varaccess {NET_FLAGS \ NET6_FLAGS \SERIAL_FLAGS \ - CFG_ENV_FLAGS_LIST_STATIC + CONFIG_ENV_FLAGS_LIST_STATIC#ifdef CONFIG_CMD_ENV_FLAGS /*
Signature · 1 line
2.53.0
PATCH v3 2/2 doc: remove configuration settings from README
The remaining configuration settings section is legacy README content. Its details belong in Kconfig help or the rST documentation.
Remove the section instead of keeping partial stale configuration documentation in README.
--- README | 124 --------------------------------------------------------- 1 file changed, 124 deletions(-)
README +0 -124
@@ -1033,130 +1033,6 @@ typically in board_init_f() and board_init_r(). - CONFIG_BOARD_EARLY_INIT_R: Call board_early_init_r() - CONFIG_BOARD_LATE_INIT: Call board_late_init() -Configuration Settings: ------------------------ - -- CONFIG_SYS_LONGHELP: Defined when you want long help messages included; - undefine this when you're short of memory. - -- CFG_SYS_HELP_CMD_WIDTH: Defined when you want to override the default - width of the commands listed in the 'help' command output. - -- CONFIG_SYS_PROMPT: This is what U-Boot prints on the console to - prompt for user input. - -- CFG_SYS_BAUDRATE_TABLE: - List of legal baudrate settings for this board. - -- CFG_SYS_MEM_RESERVE_SECURE - Only implemented for ARMv8 for now. - If defined, the size of CFG_SYS_MEM_RESERVE_SECURE memory - is substracted from total RAM and won't be reported to OS. - This memory can be used as secure memory. A variable - gd->arch.secure_ram is used to track the location. In systems - the RAM base is not zero, or RAM is divided into banks, - this variable needs to be recalcuated to get the address. - -- CFG_SYS_SDRAM_BASE: - Physical start address of SDRAM. _Must_ be 0 here. - -- CFG_SYS_FLASH_BASE: - Physical start address of Flash memory. - -- CONFIG_SYS_MALLOC_LEN: - Size of DRAM reserved for malloc() use. - -- CFG_SYS_BOOTMAPSZ: - Maximum size of memory mapped by the startup code of - the Linux kernel; all data that must be processed by - the Linux kernel (bd_info, boot arguments, FDT blob if - used) must be put below this limit, unless "bootm_low" - environment variable is defined and non-zero. In such case - all data for the Linux kernel must be between "bootm_low" - and "bootm_low" + CFG_SYS_BOOTMAPSZ. The environment - variable "bootm_mapsize" will override the value of - CFG_SYS_BOOTMAPSZ. If CFG_SYS_BOOTMAPSZ is undefined, - then the value in "bootm_size" will be used instead. - -- CONFIG_SYS_BOOT_GET_CMDLINE: - Enables allocating and saving kernel cmdline in space between - "bootm_low" and "bootm_low" + BOOTMAPSZ. - -- CONFIG_SYS_BOOT_GET_KBD: - Enables allocating and saving a kernel copy of the bd_info in - space between "bootm_low" and "bootm_low" + BOOTMAPSZ. - -- CONFIG_SYS_FLASH_PROTECTION - If defined, hardware flash sectors protection is used - instead of U-Boot software protection. - -- CONFIG_SYS_FLASH_CFI: - Define if the flash driver uses extra elements in the - common flash structure for storing flash geometry. - -- CONFIG_FLASH_CFI_DRIVER - This option also enables the building of the cfi_flash driver - in the drivers directory - -- CONFIG_FLASH_CFI_MTD - This option enables the building of the cfi_mtd driver - in the drivers directory. The driver exports CFI flash - to the MTD layer. - -- CONFIG_SYS_FLASH_USE_BUFFER_WRITE - Use buffered writes to flash. - -The following definitions that deal with the placement and management -of environment data (variable area); in general, we support the -following configurations: - -BE CAREFUL! The first access to the environment happens quite early -in U-Boot initialization (when we try to get the setting of for the -console baudrate). You *MUST* have mapped your NVRAM area then, or -U-Boot will hang. - -Please note that even with NVRAM we still use a copy of the -environment in RAM: we could work on NVRAM directly, but we want to -keep settings there always unmodified except somebody uses "saveenv" -to save the current settings. - -BE CAREFUL! For some special cases, the local device can not use -"saveenv" command. For example, the local device will get the -environment stored in a remote NOR flash by SRIO or PCIE link, -but it can not erase, write this NOR flash by SRIO or PCIE interface. - -- CONFIG_NAND_ENV_DST - - Defines address in RAM to which the nand_spl code should copy the - environment. If redundant environment is used, it will be copied to - CONFIG_NAND_ENV_DST + CONFIG_ENV_SIZE. - -Please note that the environment is read-only until the monitor -has been relocated to RAM and a RAM copy of the environment has been -created; also, when using EEPROM you will have to use env_get_f() -until then to read environment variables. - -The environment is protected by a CRC32 checksum. Before the monitor -is relocated into RAM, as a result of a bad CRC you will be working -with the compiled-in default environment - *silently*!!! [This is -necessary, because the first environment variable we need is the -"baudrate" setting for the console - if we have a bad CRC, we don't -have any device yet where we could complain.] - -Note: once the monitor has been relocated, then it will complain if -the default environment is used; a new CRC is computed as soon as you -use the "saveenv" command to store a valid environment. - -- CONFIG_DISPLAY_BOARDINFO - Display information about the board that U-Boot is running on - when U-Boot starts up. The board function checkboard() is called - to do this. - -- CONFIG_DISPLAY_BOARDINFO_LATE - Similar to the previous option, but display this information - later, once stdio is running and output goes to the LCD, if - present. - Low Level (hardware related) configuration options: ---------------------------------------------------
Signature · 1 line
2.53.0
Re: [PATCH v3 2/2] doc: remove configuration settings from README
Quoted 5 lines · James Hilliard
doc: remove configuration settings from README
The remaining configuration settings section is legacy README content. Its details belong in
Kconfighelp or the rST documentation.
Quoted 8 lines
Remove the section instead of keeping partial stale configuration documentation in README.
Suggested-by Tom Rini <[email protected]>Signed-off-by James Hilliard <[email protected]>README | 124 -----------------------------------------------------------------
1 file changed, 124 deletions(-)
Quoted 22 lines · James Hilliard
Environment callbacks can already be configured from
KconfigwithCONFIG_ENV_CALLBACK_LIST_STATIC, but static environment flags still require board headers to defineCFG_ENV_FLAGS_LIST_STATIC.Add
CONFIG_ENV_FLAGS_LIST_STATICand use it as the only board-provided static environment flags list. Convert the remaining default-config users fromCFG_ENV_FLAGS_LIST_STATICto defconfig settings and drop the legacy header macro fromENV_FLAGS_LIST_STATIC.Move the environment flags format documentation out of README and into the developer environment documentation. Include the format in the
Kconfighelp as well.This lets boards configure writeable-list policy and type validation from defconfig without adding a config header solely for env flags.
This preserves the behavior of default configs. Header-only cases that were inactive in upstream defconfigs are not converted into defconfig
entries: iot2050 can add its list when enablingENV_WRITEABLE_LIST, and smegw01 can add mmcdev:dw support if the unlocked SYS_BOOT_LOCKED=n configuration is needed.
Quoted 8 lines
Signed-off-by James Hilliard <[email protected]>Reviewed-by Tom Rini <[email protected]>Reviewed-by Simon Glass <[email protected]>---
Changes v2 -> v3:
- Note that inactive header-only iot2050 flags and the smegw01 SYS_BOOT_LOCKED=n mmcdev:dw flag are not converted into defconfigs.
Colleagues, you want to have an eye on this because it could silently unlock the (downstream) secure boot config profile [1] on next update.
This makes me wonder if U-Boot shouldn't carry such profiles as well, either in form of a generic Kconfig switch or some defconfig variants. It's a very common pattern to shoot yourself into the foot while trying to lock down the typical try-out upstream defconfigs for secure boot.
Jan
[1]
https://github.com/siemens/meta-iot2050/blob/master/meta/recipes-bsp/u-boot/files/secure-boot.cfg
Signature · 2 lines
Siemens AG, Foundational Technologies Linux Expert Center
Hi James,
Quoted 22 lines · James Hilliard
Environment callbacks can already be configured from
KconfigwithCONFIG_ENV_CALLBACK_LIST_STATIC, but static environment flags still require board headers to defineCFG_ENV_FLAGS_LIST_STATIC.Add
CONFIG_ENV_FLAGS_LIST_STATICand use it as the only board-provided static environment flags list. Convert the remaining default-config users fromCFG_ENV_FLAGS_LIST_STATICto defconfig settings and drop the legacy header macro fromENV_FLAGS_LIST_STATIC.Move the environment flags format documentation out of README and into the developer environment documentation. Include the format in the
Kconfighelp as well.This lets boards configure writeable-list policy and type validation from defconfig without adding a config header solely for env flags.
This preserves the behavior of default configs. Header-only cases that were inactive in upstream defconfigs are not converted into defconfig
entries: iot2050 can add its list when enablingENV_WRITEABLE_LIST, and smegw01 can add mmcdev:dw support if the unlocked SYS_BOOT_LOCKED=n configuration is needed.
Quoted 3 lines
Signed-off-by James Hilliard <[email protected]>Reviewed-by Tom Rini <[email protected]>Reviewed-by Simon Glass <[email protected]>
LGTM
Quoted 36 lines
---
Changes v2 -> v3:
- Note that inactive header-only iot2050 flags and the smegw01 SYS_BOOT_LOCKED=n mmcdev:dw flag are not converted into defconfigs.Changes v1 -> v2:
- Convert existingCFG_ENV_FLAGS_LIST_STATICusers toCONFIG_ENV_FLAGS_LIST_STATICin defconfigs.
- DropCFG_ENV_FLAGS_LIST_STATICsupport instead of appending the newKconfigvalue after the legacy C macro.
- Remove the trailing-comma requirement for board-specific static flags.
- Place the migrated defconfig entries in savedefconfig order.
- Move environment flags documentation from README todoc/develop/environment.rst.
- Add the flags-list format to theCONFIG_ENV_FLAGS_LIST_STATICKconfighelp text.
---
README | 45 +--------------------------- configs/aristainetos2c_defconfig | 1 + configs/aristainetos2ccslb_defconfig | 1 + configs/hmibsc_defconfig | 1 + configs/imx6q_bosch_acc_defconfig | 1 + configs/imx8qxp_capricorn.config | 1 + configs/smegw01_defconfig | 1 + configs/socrates_defconfig | 1 + doc/develop/environment.rst | 40 +++++++++++++++++++++++++ env/Kconfig | 23 ++++++++++++++ include/configs/aristainetos2.h | 3 -- include/configs/capricorn-common.h | 13 -------- include/configs/hmibsc.h | 4 --- include/configs/imx6q-bosch-acc.h | 12 -------- include/configs/iot2050.h | 8 ----- include/configs/smegw01.h | 15 ---------- include/configs/socrates.h | 2 -- include/env_flags.h | 6 +---18 files changed, 72 insertions(+), 106 deletions(-)
Signature · 3 lines
Alexander Sverdlin Siemens AG www.siemens.com
Schweizer, Walter
Reviewed-byQuoted 33 lines · Alexander (SI B PRO TI EAC CCP)
Hi James,
Quoted 30 lines · James Hilliard
Environment callbacks can already be configured from
KconfigwithCONFIG_ENV_CALLBACK_LIST_STATIC, but static environment flags still require board headers to defineCFG_ENV_FLAGS_LIST_STATIC.Add
CONFIG_ENV_FLAGS_LIST_STATICand use it as the only board- provided
static environment flags list. Convert the remaining default-config users
fromCFG_ENV_FLAGS_LIST_STATICto defconfig settings and drop the legacy
header macro fromENV_FLAGS_LIST_STATIC.Move the environment flags format documentation out of README and into
the developer environment documentation. Include the format in theKconfighelp as well.This lets boards configure writeable-list policy and type validation
from defconfig without adding a config header solely for env flags.This preserves the behavior of default configs. Header-only cases that
were inactive in upstream defconfigs are not converted into defconfig
entries: iot2050 can add its list when enablingENV_WRITEABLE_LIST, and
smegw01 can add mmcdev:dw support if the unlocked SYS_BOOT_LOCKED=n configuration is needed.
Quoted 51 lines
Quoted 3 lines
Signed-off-by James Hilliard <[email protected]>Reviewed-by Tom Rini <[email protected]>Reviewed-by Simon Glass <[email protected]>LGTM
Reviewed-by Alexander Sverdlin <[email protected]>Quoted 42 lines
---
Changes v2 -> v3:
- Note that inactive header-only iot2050 flags and the smegw01 SYS_BOOT_LOCKED=n mmcdev:dw flag are not converted into defconfigs.Changes v1 -> v2:
- Convert existingCFG_ENV_FLAGS_LIST_STATICusers toCONFIG_ENV_FLAGS_LIST_STATICin defconfigs.
- DropCFG_ENV_FLAGS_LIST_STATICsupport instead of appending the new
Kconfigvalue after the legacy C macro.
- Remove the trailing-comma requirement for board-specific static flags.
- Place the migrated defconfig entries in savedefconfig order.
- Move environment flags documentation from README todoc/develop/environment.rst.
- Add the flags-list format to theCONFIG_ENV_FLAGS_LIST_STATICKconfig
help text.
---
README | 45 +-----------------------
----
configs/aristainetos2c_defconfig | 1 + configs/aristainetos2ccslb_defconfig | 1 + configs/hmibsc_defconfig | 1 + configs/imx6q_bosch_acc_defconfig | 1 + configs/imx8qxp_capricorn.config | 1 + configs/smegw01_defconfig | 1 + configs/socrates_defconfig | 1 + doc/develop/environment.rst | 40
+++++++++++++++++++++++++
env/Kconfig | 23 ++++++++++++++ include/configs/aristainetos2.h | 3 -- include/configs/capricorn-common.h | 13 -------- include/configs/hmibsc.h | 4 --- include/configs/imx6q-bosch-acc.h | 12 -------- include/configs/iot2050.h | 8 ----- include/configs/smegw01.h | 15 ---------- include/configs/socrates.h | 2 -- include/env_flags.h | 6 +---18 files changed, 72 insertions(+), 106 deletions(-)
Thanks James
Quoted 10 lines · James Hilliard
Environment callbacks can already be configured from
KconfigwithCONFIG_ENV_CALLBACK_LIST_STATIC, but static environment flags still require board headers to defineCFG_ENV_FLAGS_LIST_STATIC.Add
CONFIG_ENV_FLAGS_LIST_STATICand use it as the only board-provided static environment flags list. Convert the remaining default-config users fromCFG_ENV_FLAGS_LIST_STATICto defconfig settings and drop the legacy header macro fromENV_FLAGS_LIST_STATIC.[...]
Applied to u-boot/next, thanks!
[1/2] env: migrate static flags list to Kconfig
commit: 5e41a5deb4b843808f3c892f2f54f1b9c76b3da1
[2/2] doc: remove configuration settings from README
commit: e11b0c5cab44817b3c1cb4fd29339010b4db4321Signature · 1 line
Tom