[coreboot-gerrit] Patch set updated for coreboot: 15630f5 smbios: Supply tag type 2 (base board information)

Vladimir Serbinenko (phcoder@gmail.com) gerrit at coreboot.org
Mon Mar 3 01:06:56 CET 2014


Vladimir Serbinenko (phcoder at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5322

-gerrit

commit 15630f5982f16aa8841e977270b858de913a2a1c
Author: Vladimir Serbinenko <phcoder at gmail.com>
Date:   Sun Mar 2 19:14:44 2014 +0100

    smbios: Supply tag type 2 (base board information)
    
    Information really contained in it is mostly the same as in type 1 tag.
    However Linux uses type 2 to match hardware. Duplicate the info.
    
    Change-Id: I75e13d764464053ecab4a833fbb83836cedf26e6
    Signed-off-by: Vladimir Serbinenko <phcoder at gmail.com>
---
 src/arch/x86/boot/smbios.c | 19 +++++++++++++++++++
 src/include/smbios.h       | 12 ++++++++++++
 2 files changed, 31 insertions(+)

diff --git a/src/arch/x86/boot/smbios.c b/src/arch/x86/boot/smbios.c
index 65bf538..0e84acc 100644
--- a/src/arch/x86/boot/smbios.c
+++ b/src/arch/x86/boot/smbios.c
@@ -217,6 +217,24 @@ static int smbios_write_type1(unsigned long *current, int handle)
 	return len;
 }
 
+static int smbios_write_type2(unsigned long *current, int handle)
+{
+	struct smbios_type2 *t = (struct smbios_type2 *)*current;
+	int len = sizeof(struct smbios_type2);
+
+	memset(t, 0, sizeof(struct smbios_type2));
+	t->type = SMBIOS_BOARD_INFORMATION;
+	t->handle = handle;
+	t->length = len - 2;
+	t->manufacturer = smbios_add_string(t->eos, smbios_mainboard_manufacturer());
+	t->product_name = smbios_add_string(t->eos, smbios_mainboard_product_name());
+	t->serial_number = smbios_add_string(t->eos, smbios_mainboard_serial_number());
+	t->version = smbios_add_string(t->eos, smbios_mainboard_version());
+	len = t->length + smbios_string_table_len(t->eos);
+	*current += len;
+	return len;
+}
+
 static int smbios_write_type3(unsigned long *current, int handle)
 {
 	struct smbios_type3 *t = (struct smbios_type3 *)*current;
@@ -372,6 +390,7 @@ unsigned long smbios_write_tables(unsigned long current)
 	tables = current;
 	len = smbios_write_type0(&current, handle++);
 	len += smbios_write_type1(&current, handle++);
+	len += smbios_write_type2(&current, handle++);
 	len += smbios_write_type3(&current, handle++);
 	len += smbios_write_type4(&current, handle++);
 #if CONFIG_ELOG
diff --git a/src/include/smbios.h b/src/include/smbios.h
index 42c5d2d..0ab074d 100644
--- a/src/include/smbios.h
+++ b/src/include/smbios.h
@@ -37,6 +37,7 @@ void smbios_mainboard_set_uuid(u8 *uuid);
 typedef enum {
 	SMBIOS_BIOS_INFORMATION=0,
 	SMBIOS_SYSTEM_INFORMATION=1,
+	SMBIOS_BOARD_INFORMATION=2,
 	SMBIOS_SYSTEM_ENCLOSURE=3,
 	SMBIOS_PROCESSOR_INFORMATION=4,
 	SMBIOS_CACHE_INFORMATION=7,
@@ -102,6 +103,17 @@ struct smbios_type1 {
 	char eos[2];
 } __attribute__((packed));
 
+struct smbios_type2 {
+	u8 type;
+	u8 length;
+	u16 handle;
+	u8 manufacturer;
+	u8 product_name;
+	u8 version;
+	u8 serial_number;
+	char eos[2];
+} __attribute__((packed));
+
 struct smbios_type3 {
 	u8 type;
 	u8 length;



More information about the coreboot-gerrit mailing list