Attention is currently required from: Patrick Rudolph. Hello Patrick Rudolph,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/54728
to review the following change.
Change subject: option: Turn CMOS option backend into choice ......................................................................
option: Turn CMOS option backend into choice
In order to add more option backends, transform the current CMOS option backend into a Kconfig choice. Replace the `select` directives, as they cannot be used with choice options.
Change-Id: Id3180e9991f0e763b4bae93a92d40668e7fc99bc Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com Signed-off-by: Angel Pons th3fanbus@gmail.com --- M payloads/Kconfig M src/Kconfig M src/include/option.h 3 files changed, 12 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/28/54728/1
diff --git a/payloads/Kconfig b/payloads/Kconfig index 627bb95..386b207 100644 --- a/payloads/Kconfig +++ b/payloads/Kconfig @@ -133,7 +133,6 @@ bool "Load nvramcui as a secondary payload" default n depends on ARCH_X86 && HAVE_OPTION_TABLE - select USE_OPTION_TABLE help nvramcui can be loaded as a secondary payload under SeaBIOS, GRUB, or any other payload that can load additional payloads. diff --git a/src/Kconfig b/src/Kconfig index 6d0ba0f..b019e9d 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -120,6 +120,13 @@
Otherwise, say N to use the provided pregenerated scanner/parser.
+choice + prompt "Option backend to use" + default USE_OPTION_TABLE if NVRAMCUI_SECONDARY_PAYLOAD + +config OPTION_BACKEND_NONE + bool "None" + config USE_OPTION_TABLE bool "Use CMOS for configuration values" depends on HAVE_OPTION_TABLE @@ -127,6 +134,8 @@ Enable this option if coreboot shall read options from the "CMOS" NVRAM instead of using hard-coded values.
+endchoice + config STATIC_OPTION_TABLE bool "Load default configuration values into CMOS on each boot" depends on USE_OPTION_TABLE diff --git a/src/include/option.h b/src/include/option.h index 4089378..3a00570 100644 --- a/src/include/option.h +++ b/src/include/option.h @@ -7,7 +7,7 @@
void sanitize_cmos(void);
-#if !CONFIG(USE_OPTION_TABLE) +#if CONFIG(OPTION_BACKEND_NONE)
static inline unsigned int get_uint_option(const char *name, const unsigned int fallback) { @@ -19,11 +19,11 @@ return CB_CMOS_OTABLE_DISABLED; }
-#else /* USE_OPTION_TABLE */ +#else /* !OPTION_BACKEND_NONE */
unsigned int get_uint_option(const char *name, const unsigned int fallback); enum cb_err set_uint_option(const char *name, unsigned int value);
-#endif /* USE_OPTION_TABLE? */ +#endif /* OPTION_BACKEND_NONE? */
#endif /* _OPTION_H_ */