option: Allow mainboards to implement the API

Some mainboards need a mainboard-specific mechanism to access option
values. Allow mainboards to implement the option API. Also, add some
documentation about the current option API, and describe when should
one reimplement the option API in mainboard code: only when the code
is mainboard-specific to comply with externally-imposed constraints.

Change-Id: Idccdb9a008b1ebb89821961659f27b1c0b17d29c
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/54729
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
This commit is contained in:
Angel Pons
2021-05-20 16:43:08 +02:00
parent 17852e61df
commit 9bc780fc9f
3 changed files with 47 additions and 0 deletions

View File

@@ -122,6 +122,7 @@ config UTIL_GENPARSER
choice
prompt "Option backend to use"
default USE_MAINBOARD_SPECIFIC_OPTION_BACKEND if HAVE_MAINBOARD_SPECIFIC_OPTION_BACKEND
default USE_OPTION_TABLE if NVRAMCUI_SECONDARY_PAYLOAD
config OPTION_BACKEND_NONE
@@ -134,6 +135,13 @@ config USE_OPTION_TABLE
Enable this option if coreboot shall read options from the "CMOS"
NVRAM instead of using hard-coded values.
config USE_MAINBOARD_SPECIFIC_OPTION_BACKEND
bool "Use mainboard-specific option backend"
depends on HAVE_MAINBOARD_SPECIFIC_OPTION_BACKEND
help
Use a mainboard-specific mechanism to access runtime-configurable
options.
endchoice
config STATIC_OPTION_TABLE
@@ -683,6 +691,13 @@ config NUM_THREADS
help
How many execution threads to cooperatively multitask with.
config HAVE_MAINBOARD_SPECIFIC_OPTION_BACKEND
bool
help
Selected by mainboards which implement a mainboard-specific mechanism
to access the values for runtime-configurable options. For example, a
custom BMC interface or an EEPROM with an externally-imposed layout.
config HAVE_OPTION_TABLE
bool
default n