diff options
author | Julien Viard de Galbert <jviarddegalbert@online.net> | 2018-02-22 16:39:58 +0100 |
---|---|---|
committer | Martin Roth <martinroth@google.com> | 2018-03-07 21:12:47 +0000 |
commit | 9a31dfeb1879b0100aa6a8590dd3e783e6da808c (patch) | |
tree | 95585e30341a79951673ddb525f1f3d32bdc9aee /src/arch | |
parent | ae6210e50072d851a50e3ed0c2b32cd1a1c8750b (diff) |
smbios: Extend Baseboard (or Module) Information (type2)
Add more information on baseboard as described in SMBIOS Reference
Specification 3.1.1.
Change-Id: I9fe1c4fe70c66f8a7fcc75b93672421ae808bf1b
Signed-off-by: Julien Viard de Galbert <jviarddegalbert@online.net>
Reviewed-on: https://review.coreboot.org/23842
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'src/arch')
-rw-r--r-- | src/arch/x86/smbios.c | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/src/arch/x86/smbios.c b/src/arch/x86/smbios.c index 9df997320b..85851c60cb 100644 --- a/src/arch/x86/smbios.c +++ b/src/arch/x86/smbios.c @@ -381,6 +381,26 @@ void __attribute__((weak)) smbios_mainboard_set_uuid(u8 *uuid) } #endif +const char *__attribute__((weak)) smbios_mainboard_asset_tag(void) +{ + return ""; +} + +u8 __attribute__((weak)) smbios_mainboard_feature_flags(void) +{ + return 0; +} + +const char *__attribute__((weak)) smbios_mainboard_location_in_chassis(void) +{ + return ""; +} + +smbios_board_type __attribute__((weak)) smbios_mainboard_board_type(void) +{ + return SMBIOS_BOARD_TYPE_UNKNOWN; +} + const char *__attribute__((weak)) smbios_mainboard_sku(void) { return ""; @@ -419,7 +439,8 @@ static int smbios_write_type1(unsigned long *current, int handle) return len; } -static int smbios_write_type2(unsigned long *current, int handle) +static int smbios_write_type2(unsigned long *current, int handle, + const int chassis_handle) { struct smbios_type2 *t = (struct smbios_type2 *)*current; int len = sizeof(struct smbios_type2); @@ -435,6 +456,12 @@ static int smbios_write_type2(unsigned long *current, int handle) t->serial_number = smbios_add_string(t->eos, smbios_mainboard_serial_number()); t->version = smbios_add_string(t->eos, smbios_mainboard_version()); + t->asset_tag = smbios_add_string(t->eos, smbios_mainboard_asset_tag()); + t->feature_flags = smbios_mainboard_feature_flags(); + t->location_in_chassis = smbios_add_string(t->eos, + smbios_mainboard_location_in_chassis()); + t->board_type = smbios_mainboard_board_type(); + t->chassis_handle = chassis_handle; len = t->length + smbios_string_table_len(t->eos); *current += len; return len; @@ -642,7 +669,8 @@ unsigned long smbios_write_tables(unsigned long current) update_max(len, max_struct_size, smbios_write_type1(¤t, handle++)); update_max(len, max_struct_size, smbios_write_type2(¤t, - handle++)); + handle, handle + 1)); /* The chassis handle is the next one */ + handle++; update_max(len, max_struct_size, smbios_write_type3(¤t, handle++)); update_max(len, max_struct_size, smbios_write_type4(¤t, |