Vladimir Serbinenko (phcoder@gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/7055
-gerrit
commit 0850d8d8735600229b3f2855faed84d50e3c74d6 Author: Vladimir Serbinenko phcoder@gmail.com Date: Sat May 30 23:08:26 2015 +0200
lenovo: Hide SMBIOS config
It's derived from EEPROM on Lenovo machines and not from user config which is ignored.
Change-Id: I54fb76a3160e47cd36d33d2937c4bfaddcd36a69 Signed-off-by: Vladimir Serbinenko phcoder@gmail.com --- src/Kconfig | 8 ++++++++ src/arch/x86/boot/smbios.c | 13 ++++++++----- src/drivers/i2c/Kconfig | 1 + src/drivers/i2c/at24rf08c/Kconfig | 7 +++++++ src/drivers/i2c/at24rf08c/lenovo_serials.c | 5 +++++ 5 files changed, 29 insertions(+), 5 deletions(-)
diff --git a/src/Kconfig b/src/Kconfig index edcafe8..04619b5 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -586,9 +586,14 @@ config GENERATE_SMBIOS_TABLES
If unsure, say Y.
+config SMBIOS_PROVIDED_BY_MOBO + bool + default n + config MAINBOARD_SERIAL_NUMBER string "SMBIOS Serial Number" depends on GENERATE_SMBIOS_TABLES + depends on !SMBIOS_PROVIDED_BY_MOBO default "123456789" help The Serial Number to store in SMBIOS structures. @@ -596,6 +601,7 @@ config MAINBOARD_SERIAL_NUMBER config MAINBOARD_VERSION string "SMBIOS Version Number" depends on GENERATE_SMBIOS_TABLES + depends on !SMBIOS_PROVIDED_BY_MOBO default "1.0" help The Version Number to store in SMBIOS structures. @@ -603,6 +609,7 @@ config MAINBOARD_VERSION config MAINBOARD_SMBIOS_MANUFACTURER string "SMBIOS Manufacturer" depends on GENERATE_SMBIOS_TABLES + depends on !SMBIOS_PROVIDED_BY_MOBO default MAINBOARD_VENDOR help Override the default Manufacturer stored in SMBIOS structures. @@ -610,6 +617,7 @@ config MAINBOARD_SMBIOS_MANUFACTURER config MAINBOARD_SMBIOS_PRODUCT_NAME string "SMBIOS Product name" depends on GENERATE_SMBIOS_TABLES + depends on !SMBIOS_PROVIDED_BY_MOBO default MAINBOARD_PART_NUMBER help Override the default Product name stored in SMBIOS structures. diff --git a/src/arch/x86/boot/smbios.c b/src/arch/x86/boot/smbios.c index 11c2d1c..b747547 100644 --- a/src/arch/x86/boot/smbios.c +++ b/src/arch/x86/boot/smbios.c @@ -281,30 +281,33 @@ static int smbios_write_type0(unsigned long *current, int handle) return len; }
-const char *__attribute__((weak)) smbios_mainboard_serial_number(void) +#if !CONFIG_SMBIOS_PROVIDED_BY_MOBO + +const char *smbios_mainboard_serial_number(void) { return CONFIG_MAINBOARD_SERIAL_NUMBER; }
-const char *__attribute__((weak)) smbios_mainboard_version(void) +const char *smbios_mainboard_version(void) { return CONFIG_MAINBOARD_VERSION; }
-const char *__attribute__((weak)) smbios_mainboard_manufacturer(void) +const char *smbios_mainboard_manufacturer(void) { return CONFIG_MAINBOARD_SMBIOS_MANUFACTURER; }
-const char *__attribute__((weak)) smbios_mainboard_product_name(void) +const char *smbios_mainboard_product_name(void) { return CONFIG_MAINBOARD_SMBIOS_PRODUCT_NAME; }
-void __attribute__((weak)) smbios_mainboard_set_uuid(u8 *uuid) +void smbios_mainboard_set_uuid(u8 *uuid) { /* leave all zero */ } +#endif
#ifdef CONFIG_MAINBOARD_FAMILY const char *smbios_mainboard_family(void) diff --git a/src/drivers/i2c/Kconfig b/src/drivers/i2c/Kconfig index 1949fa6d..2831c3f 100644 --- a/src/drivers/i2c/Kconfig +++ b/src/drivers/i2c/Kconfig @@ -1,6 +1,7 @@ source src/drivers/i2c/adm1026/Kconfig source src/drivers/i2c/adm1027/Kconfig source src/drivers/i2c/adt7463/Kconfig +source src/drivers/i2c/at24rf08c/Kconfig source src/drivers/i2c/i2cmux/Kconfig source src/drivers/i2c/i2cmux2/Kconfig source src/drivers/i2c/lm63/Kconfig diff --git a/src/drivers/i2c/at24rf08c/Kconfig b/src/drivers/i2c/at24rf08c/Kconfig new file mode 100644 index 0000000..e8ee986 --- /dev/null +++ b/src/drivers/i2c/at24rf08c/Kconfig @@ -0,0 +1,7 @@ +if VENDOR_LENOVO + +config SMBIOS_PROVIDED_BY_MOBO + bool + default y + +endif diff --git a/src/drivers/i2c/at24rf08c/lenovo_serials.c b/src/drivers/i2c/at24rf08c/lenovo_serials.c index a5f1889..6595dd3 100644 --- a/src/drivers/i2c/at24rf08c/lenovo_serials.c +++ b/src/drivers/i2c/at24rf08c/lenovo_serials.c @@ -213,3 +213,8 @@ const char *smbios_mainboard_bios_version(void) s = strconcat("CBET4000 ", coreboot_version); return s; } + +const char *smbios_mainboard_manufacturer(void) +{ + return "LENOVO"; +}