env: Switch the callback static list to Kconfig

Switch the callback static list from the board configuration variable
CFG_ENV_CALLBACK_LIST_STATIC to Kconfig CONFIG_ENV_CALLBACK_LIST_STATIC.

Signed-off-by: Christoph Niedermaier <cniedermaier@dh-electronics.com>
Reviewed-by: Marek Vasut <marex@denx.de>
This commit is contained in:
Christoph Niedermaier
2024-11-20 17:01:35 +01:00
committed by Tom Rini
parent ce05ec4895
commit dca82739b9
3 changed files with 16 additions and 8 deletions

View File

@@ -18,8 +18,8 @@ The callbacks are named and associated with a function using the
U_BOOT_ENV_CALLBACK macro in your board or driver code. U_BOOT_ENV_CALLBACK macro in your board or driver code.
These callbacks are associated with variables in one of two ways. The These callbacks are associated with variables in one of two ways. The
static list can be added to by defining CFG_ENV_CALLBACK_LIST_STATIC static list can be added to by defining CONFIG_ENV_CALLBACK_LIST_STATIC
in the board configuration to a string that defines a list of in the board defconfig via menuconfig to a string that defines a list of
associations. The list must be in the following format:: associations. The list must be in the following format::
entry = variable_name[:callback_name] entry = variable_name[:callback_name]

13
env/Kconfig vendored
View File

@@ -21,6 +21,19 @@ config ENV_SOURCE_FILE
environment is assumed to come from the ad-hoc environment is assumed to come from the ad-hoc
CFG_EXTRA_ENV_SETTINGS #define CFG_EXTRA_ENV_SETTINGS #define
config ENV_CALLBACK_LIST_STATIC
string "Static callbacks list"
default ""
help
The environment callbacks are associated with variables in a
static list. Define this list in the following format:
entry = variable_name[:callback_name]
list = entry[,list]
If the callback name is not specified, then the callback is deleted.
Spaces are also allowed anywhere in the list.
config SAVEENV config SAVEENV
def_bool y if CMD_SAVEENV def_bool y if CMD_SAVEENV

View File

@@ -14,11 +14,6 @@
#define ENV_CALLBACK_VAR ".callbacks" #define ENV_CALLBACK_VAR ".callbacks"
/* Board configs can define additional static callback bindings */
#ifndef CFG_ENV_CALLBACK_LIST_STATIC
#define CFG_ENV_CALLBACK_LIST_STATIC
#endif
#ifdef CONFIG_SILENT_CONSOLE #ifdef CONFIG_SILENT_CONSOLE
#define SILENT_CALLBACK "silent:silent," #define SILENT_CALLBACK "silent:silent,"
#else #else
@@ -90,7 +85,7 @@
SILENT_CALLBACK \ SILENT_CALLBACK \
"stdin:console,stdout:console,stderr:console," \ "stdin:console,stdout:console,stderr:console," \
"serial#:serialno," \ "serial#:serialno," \
CFG_ENV_CALLBACK_LIST_STATIC CONFIG_ENV_CALLBACK_LIST_STATIC
#ifndef CONFIG_XPL_BUILD #ifndef CONFIG_XPL_BUILD
void env_callback_init(struct env_entry *var_entry); void env_callback_init(struct env_entry *var_entry);