[coreboot-gerrit] New patch to review for coreboot: x86: add OPTION_STATIC_OPTION_TABLE_NAME

Ben Gardner (gardner.ben@gmail.com) gerrit at coreboot.org
Thu Dec 17 18:01:16 CET 2015


Ben Gardner (gardner.ben at gmail.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/12756

-gerrit

commit 1b713b7f8576677b7af3ac60b8436d7b946e5763
Author: Ben Gardner <gardner.ben at gmail.com>
Date:   Thu Dec 17 10:38:17 2015 -0600

    x86: add OPTION_STATIC_OPTION_TABLE_NAME
    
    This option uses a function instead of the hard-coded "cmos.default" for
    the static option table.
    This allows, say, a jumper on the mainboard to select a CMOS default file
    that contains a 'debug' log level.
    Building and adding alternate cmos.default files is an exercise left to
    the reader.
    
    Change-Id: Ieb4d255c0e9dd1b5de4214a37635146fd840b52b
    Signed-off-by: Ben Gardner <gardner.ben at gmail.com>
---
 src/Kconfig                                  |  8 ++++++++
 src/arch/x86/include/arch/bootblock_common.h | 10 +++++++++-
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/src/Kconfig b/src/Kconfig
index 46349c5..e1c94a5 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -130,6 +130,14 @@ config STATIC_OPTION_TABLE
 	  every boot.  Use this if you want the NVRAM configuration to
 	  never be modified from its default values.
 
+config STATIC_OPTION_TABLE_NAME
+	bool "Use cmos_default_name() to get the CMOS filename"
+	default n
+	depends on STATIC_OPTION_TABLE
+	help
+	  Enable this option and define cmos_default_name() to return the CBFS
+	  filename to load the static option table.
+
 config UNCOMPRESSED_RAMSTAGE
 	bool
 	default n
diff --git a/src/arch/x86/include/arch/bootblock_common.h b/src/arch/x86/include/arch/bootblock_common.h
index 939ba08..00cc7f44 100644
--- a/src/arch/x86/include/arch/bootblock_common.h
+++ b/src/arch/x86/include/arch/bootblock_common.h
@@ -34,10 +34,18 @@ static void bootblock_mainboard_init(void)
 #endif
 
 #if CONFIG_USE_OPTION_TABLE
+
+#if CONFIG_STATIC_OPTION_TABLE_NAME
+const char *cmos_default_name(void);
+#define CMOS_DEFAULT_NAME cmos_default_name()
+#else
+#define CMOS_DEFAULT_NAME "cmos.default"
+#endif
+
 static void sanitize_cmos(void)
 {
 	if (cmos_error() || !cmos_chksum_valid() || IS_ENABLED(CONFIG_STATIC_OPTION_TABLE)) {
-		unsigned char *cmos_default = (unsigned char*)walkcbfs("cmos.default");
+		unsigned char *cmos_default = (unsigned char*)walkcbfs(CMOS_DEFAULT_NAME);
 		if (cmos_default) {
 			int i;
 			cmos_disable_rtc();



More information about the coreboot-gerrit mailing list