[coreboot-gerrit] Change in coreboot[master]: smbios: Extend Baseboard (or Module) Information (type2)
Julien Viard de Galbert (Code Review)
gerrit at coreboot.org
Thu Feb 22 16:44:47 CET 2018
Julien Viard de Galbert has uploaded this change for review. ( https://review.coreboot.org/23842
Change subject: smbios: Extend Baseboard (or Module) Information (type2)
......................................................................
smbios: Extend Baseboard (or Module) Information (type2)
Add more information on basebord as described in SMBIOS Reference
Specification 3.1.1
Change-Id: I9fe1c4fe70c66f8a7fcc75b93672421ae808bf1b
Signed-off-by: Julien Viard de Galbert <jviarddegalbert at online.net>
---
M src/arch/x86/smbios.c
M src/include/smbios.h
2 files changed, 42 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/42/23842/1
diff --git a/src/arch/x86/smbios.c b/src/arch/x86/smbios.c
index 9475034..97b7b61 100644
--- a/src/arch/x86/smbios.c
+++ b/src/arch/x86/smbios.c
@@ -359,6 +359,27 @@
{
/* leave all zero */
}
+
+const char *__attribute__((weak)) smbios_mainboard_asset_tag(void)
+{
+ return "";
+}
+
+u8 __attribute__((weak)) smbios_mainboard_features_flags(void)
+{
+ return 0;
+}
+
+const char *__attribute__((weak)) smbios_mainboard_location_in_chassis(void)
+{
+ return "";
+}
+
+u8 __attribute__((weak)) smbios_mainboard_board_type(void)
+{
+ return 0;
+}
+
#endif
const char *__attribute__((weak)) smbios_mainboard_sku(void)
@@ -399,7 +420,8 @@
return len;
}
-static int smbios_write_type2(unsigned long *current, int handle)
+static int smbios_write_type2(unsigned long *current, int handle,
+ int chassis_handle)
{
struct smbios_type2 *t = (struct smbios_type2 *)*current;
int len = sizeof(struct smbios_type2);
@@ -415,6 +437,13 @@
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->features_flags = smbios_mainboard_features_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;
@@ -629,7 +658,8 @@
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,
diff --git a/src/include/smbios.h b/src/include/smbios.h
index fddcce8..10a122b 100644
--- a/src/include/smbios.h
+++ b/src/include/smbios.h
@@ -37,6 +37,11 @@
const char *smbios_mainboard_version(void);
void smbios_mainboard_set_uuid(u8 *uuid);
const char *smbios_mainboard_bios_version(void);
+const char *smbios_mainboard_asset_tag(void);
+u8 smbios_mainboard_features_flags(void);
+const char *smbios_mainboard_location_in_chassis(void);
+u8 smbios_mainboard_board_type(void);
+
const char *smbios_mainboard_sku(void);
u8 smbios_mainboard_enclosure_type(void);
#ifdef CONFIG_MAINBOARD_FAMILY
@@ -275,6 +280,11 @@
u8 product_name;
u8 version;
u8 serial_number;
+ u8 asset_tag;
+ u8 features_flags;
+ u8 location_in_chassis;
+ u16 chassis_handle;
+ u8 board_type;
u8 eos[2];
} __packed;
--
To view, visit https://review.coreboot.org/23842
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9fe1c4fe70c66f8a7fcc75b93672421ae808bf1b
Gerrit-Change-Number: 23842
Gerrit-PatchSet: 1
Gerrit-Owner: Julien Viard de Galbert <jviarddegalbert at online.net>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180222/40ddb436/attachment-0001.html>
More information about the coreboot-gerrit
mailing list