diff options
author | Nico Huber <nico.huber@secunet.com> | 2017-11-01 09:49:16 +0100 |
---|---|---|
committer | Nico Huber <nico.h@gmx.de> | 2019-03-16 16:22:16 +0000 |
commit | ebd8a4f90cf58cd03a95fcc01acea1c59b0cad4e (patch) | |
tree | cdff8fbc8e89cbe96236a00195856c135d151705 /src/arch/x86 | |
parent | 4663f45caa2352760ee08ec28b9c2d6e2e8823f9 (diff) |
x86/smbios: Untangle system and board tables
We were used to set the same values in the system and board tables.
We'll keep the mainboard values as defaults for the system tables,
so nothing changes unless somebody overrides the system table hooks.
Change-Id: I3c9c95a1307529c3137647a161a698a4c3daa0ae
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/29477
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Richard Spiegel <richard.spiegel@silverbackltd.com>
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Diffstat (limited to 'src/arch/x86')
-rw-r--r-- | src/arch/x86/smbios.c | 54 |
1 files changed, 32 insertions, 22 deletions
diff --git a/src/arch/x86/smbios.c b/src/arch/x86/smbios.c index 1d0ced16c9..8cb59df6a3 100644 --- a/src/arch/x86/smbios.c +++ b/src/arch/x86/smbios.c @@ -402,8 +402,6 @@ static int smbios_write_type0(unsigned long *current, int handle) return len; } -#if !CONFIG(SMBIOS_PROVIDED_BY_MOBO) - const char *__weak smbios_mainboard_serial_number(void) { return CONFIG_MAINBOARD_SERIAL_NUMBER; @@ -424,12 +422,6 @@ const char *__weak smbios_mainboard_product_name(void) return CONFIG_MAINBOARD_SMBIOS_PRODUCT_NAME; } -void __weak smbios_mainboard_set_uuid(u8 *uuid) -{ - /* leave all zero */ -} -#endif - const char *__weak smbios_mainboard_asset_tag(void) { return ""; @@ -450,17 +442,35 @@ smbios_board_type __weak smbios_mainboard_board_type(void) return SMBIOS_BOARD_TYPE_UNKNOWN; } -const char *__weak smbios_mainboard_sku(void) +const char *__weak smbios_system_serial_number(void) { - return ""; + return smbios_mainboard_serial_number(); } -#ifdef CONFIG_MAINBOARD_FAMILY -const char *smbios_mainboard_family(void) +const char *__weak smbios_system_version(void) +{ + return smbios_mainboard_version(); +} + +const char *__weak smbios_system_manufacturer(void) +{ + return smbios_mainboard_manufacturer(); +} + +const char *__weak smbios_system_product_name(void) { - return CONFIG_MAINBOARD_FAMILY; + return smbios_mainboard_product_name(); +} + +void __weak smbios_system_set_uuid(u8 *uuid) +{ + /* leave all zero */ +} + +const char *__weak smbios_system_sku(void) +{ + return ""; } -#endif /* CONFIG_MAINBOARD_FAMILY */ static int smbios_write_type1(unsigned long *current, int handle) { @@ -472,17 +482,17 @@ static int smbios_write_type1(unsigned long *current, int handle) t->handle = handle; t->length = len - 2; t->manufacturer = smbios_add_string(t->eos, - smbios_mainboard_manufacturer()); + smbios_system_manufacturer()); t->product_name = smbios_add_string(t->eos, - smbios_mainboard_product_name()); + smbios_system_product_name()); t->serial_number = smbios_add_string(t->eos, - smbios_mainboard_serial_number()); - t->sku = smbios_add_string(t->eos, smbios_mainboard_sku()); - t->version = smbios_add_string(t->eos, smbios_mainboard_version()); + smbios_system_serial_number()); + t->sku = smbios_add_string(t->eos, smbios_system_sku()); + t->version = smbios_add_string(t->eos, smbios_system_version()); #ifdef CONFIG_MAINBOARD_FAMILY - t->family = smbios_add_string(t->eos, smbios_mainboard_family()); + t->family = smbios_add_string(t->eos, CONFIG_MAINBOARD_FAMILY); #endif - smbios_mainboard_set_uuid(t->uuid); + smbios_system_set_uuid(t->uuid); len = t->length + smbios_string_table_len(t->eos); *current += len; return len; @@ -526,7 +536,7 @@ static int smbios_write_type3(unsigned long *current, int handle) t->handle = handle; t->length = len - 2; t->manufacturer = smbios_add_string(t->eos, - smbios_mainboard_manufacturer()); + smbios_system_manufacturer()); t->bootup_state = SMBIOS_STATE_SAFE; t->power_supply_state = SMBIOS_STATE_SAFE; t->thermal_state = SMBIOS_STATE_SAFE; |