diff options
author | Johnny Lin <johnny_lin@wiwynn.com> | 2020-01-30 18:21:22 +0800 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2020-06-25 11:54:35 +0000 |
commit | d34405438d9e90df1d641f50855ed6d50b019f57 (patch) | |
tree | acb40f04ce4fae5cd052ecbed34b5842855f069b | |
parent | d6a47729d34bedaf903e7758ad5d16a5f7ec8294 (diff) | |
download | coreboot-d34405438d9e90df1d641f50855ed6d50b019f57.tar.gz coreboot-d34405438d9e90df1d641f50855ed6d50b019f57.tar.bz2 coreboot-d34405438d9e90df1d641f50855ed6d50b019f57.zip |
arch/x86/smbios: Add more fields to be overriden for type 3 and 4
For type 3, override chassis asset_tag_number with smbios_mainboard_asset_tag()
and add two functions that can override chassis version and serial_number.
For type 4 add smbios_processor_serial_number() to override serial_number.
Tested on OCP Tioga Pass.
Change-Id: I80c6244580a4428fab781d760071c51c7933abee
Signed-off-by: Johnny Lin <johnny_lin@wiwynn.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/40309
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Maxim Polyakov <max.senia.poliak@gmail.com>
-rw-r--r-- | src/arch/x86/smbios.c | 19 | ||||
-rw-r--r-- | src/include/smbios.h | 3 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/arch/x86/smbios.c b/src/arch/x86/smbios.c index ee694087ebc9..a8723aa2ccd5 100644 --- a/src/arch/x86/smbios.c +++ b/src/arch/x86/smbios.c @@ -539,6 +539,21 @@ const char *__weak smbios_system_sku(void) return ""; } +const char * __weak smbios_chassis_version(void) +{ + return ""; +} + +const char * __weak smbios_chassis_serial_number(void) +{ + return ""; +} + +const char * __weak smbios_processor_serial_number(void) +{ + return ""; +} + static int get_socket_type(void) { if (CONFIG(CPU_INTEL_SLOT_1)) @@ -621,6 +636,9 @@ static int smbios_write_type3(unsigned long *current, int handle) t->thermal_state = SMBIOS_STATE_SAFE; t->_type = smbios_mainboard_enclosure_type(); t->security_status = SMBIOS_STATE_SAFE; + t->asset_tag_number = smbios_add_string(t->eos, smbios_mainboard_asset_tag()); + t->version = smbios_add_string(t->eos, smbios_chassis_version()); + t->serial_number = smbios_add_string(t->eos, smbios_chassis_serial_number()); len = t->length + smbios_string_table_len(t->eos); *current += len; return len; @@ -674,6 +692,7 @@ static int smbios_write_type4(unsigned long *current, int handle) t->l1_cache_handle = 0xffff; t->l2_cache_handle = 0xffff; t->l3_cache_handle = 0xffff; + t->serial_number = smbios_add_string(t->eos, smbios_processor_serial_number()); t->processor_upgrade = get_socket_type(); len = t->length + smbios_string_table_len(t->eos); if (cpu_have_cpuid() && cpuid_get_max_func() >= 0x16) { diff --git a/src/include/smbios.h b/src/include/smbios.h index d281bf069863..9edf284cc3a2 100644 --- a/src/include/smbios.h +++ b/src/include/smbios.h @@ -50,6 +50,9 @@ const char *smbios_mainboard_bios_version(void); const char *smbios_mainboard_asset_tag(void); u8 smbios_mainboard_feature_flags(void); const char *smbios_mainboard_location_in_chassis(void); +const char *smbios_chassis_version(void); +const char *smbios_chassis_serial_number(void); +const char *smbios_processor_serial_number(void); #define BIOS_CHARACTERISTICS_PCI_SUPPORTED (1 << 7) #define BIOS_CHARACTERISTICS_PC_CARD (1 << 8) |