[coreboot-gerrit] Change in coreboot[master]: x86/smbios: Untangle system and board tables

Nico Huber (Code Review) gerrit at coreboot.org
Mon Nov 5 18:35:53 CET 2018


Nico Huber has uploaded this change for review. ( https://review.coreboot.org/29477


Change subject: x86/smbios: Untangle system and board tables
......................................................................

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 at secunet.com>
---
M Documentation/Intel/Board/Galileo_checklist.html
M src/arch/x86/smbios.c
M src/drivers/i2c/at24rf08c/lenovo_serials.c
M src/include/smbios.h
M src/mainboard/emulation/qemu-i440fx/fw_cfg.c
M src/mainboard/google/fizz/mainboard.c
M src/mainboard/google/kahlee/mainboard.c
M src/mainboard/google/octopus/mainboard.c
M src/mainboard/google/poppy/variants/nami/mainboard.c
M src/mainboard/google/poppy/variants/nautilus/mainboard.c
M src/mainboard/google/poppy/variants/rammus/mainboard.c
M src/mainboard/google/reef/mainboard.c
M src/mainboard/pcengines/apu1/mainboard.c
M src/mainboard/pcengines/apu2/mainboard.c
M src/vendorcode/intel/fsp/fsp1_1/checklist/ramstage_complete.dat
M src/vendorcode/intel/fsp/fsp1_1/checklist/ramstage_optional.dat
16 files changed, 56 insertions(+), 45 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/77/29477/1

diff --git a/Documentation/Intel/Board/Galileo_checklist.html b/Documentation/Intel/Board/Galileo_checklist.html
index 3fc04b1..7b06f54 100644
--- a/Documentation/Intel/Board/Galileo_checklist.html
+++ b/Documentation/Intel/Board/Galileo_checklist.html
@@ -134,7 +134,7 @@
 <tr bgcolor=#ffffc0><td>Optional</td><td>smbios_mainboard_manufacturer</td></tr>
 <tr bgcolor=#ffffc0><td>Optional</td><td>smbios_mainboard_product_name</td></tr>
 <tr bgcolor=#ffffc0><td>Optional</td><td>smbios_mainboard_serial_number</td></tr>
-<tr bgcolor=#ffffc0><td>Optional</td><td>smbios_mainboard_set_uuid</td></tr>
+<tr bgcolor=#ffffc0><td>Optional</td><td>smbios_system_set_uuid</td></tr>
 <tr bgcolor=#c0ffc0><td>Required</td><td>smbios_mainboard_version</td></tr>
 <tr bgcolor=#ffffc0><td>Optional</td><td>smm_disable_busmaster</td></tr>
 <tr bgcolor=#ffffc0><td>Optional</td><td>soc_after_silicon_init</td></tr>
diff --git a/src/arch/x86/smbios.c b/src/arch/x86/smbios.c
index c0545ce..29d1342 100644
--- a/src/arch/x86/smbios.c
+++ b/src/arch/x86/smbios.c
@@ -397,8 +397,6 @@
 	return len;
 }
 
-#if !IS_ENABLED(CONFIG_SMBIOS_PROVIDED_BY_MOBO)
-
 const char *__weak smbios_mainboard_serial_number(void)
 {
 	return CONFIG_MAINBOARD_SERIAL_NUMBER;
@@ -419,12 +417,6 @@
 	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 "";
@@ -445,18 +437,36 @@
 	return SMBIOS_BOARD_TYPE_UNKNOWN;
 }
 
-const char *__weak smbios_mainboard_sku(void)
+const char *__weak smbios_system_serial_number(void)
+{
+	return smbios_mainboard_serial_number();
+}
+
+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 smbios_mainboard_product_name();
+}
+
+void __weak smbios_system_set_uuid(u8 *uuid)
+{
+	/* leave all zero */
+}
+
+const char *__weak smbios_system_sku(void)
 {
 	return "";
 }
 
-#ifdef CONFIG_MAINBOARD_FAMILY
-const char *smbios_mainboard_family(void)
-{
-	return CONFIG_MAINBOARD_FAMILY;
-}
-#endif /* CONFIG_MAINBOARD_FAMILY */
-
 static int smbios_write_type1(unsigned long *current, int handle)
 {
 	struct smbios_type1 *t = (struct smbios_type1 *)*current;
@@ -467,17 +477,17 @@
 	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;
@@ -521,7 +531,7 @@
 	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;
diff --git a/src/drivers/i2c/at24rf08c/lenovo_serials.c b/src/drivers/i2c/at24rf08c/lenovo_serials.c
index 0209bb2..c609a7e 100644
--- a/src/drivers/i2c/at24rf08c/lenovo_serials.c
+++ b/src/drivers/i2c/at24rf08c/lenovo_serials.c
@@ -116,7 +116,7 @@
 	return lenovo_mainboard_partnumber();
 }
 
-void smbios_mainboard_set_uuid(u8 *uuid)
+void smbios_system_set_uuid(u8 *uuid)
 {
 	static char result[16];
 	unsigned i;
diff --git a/src/include/smbios.h b/src/include/smbios.h
index 574b924..d19c176 100644
--- a/src/include/smbios.h
+++ b/src/include/smbios.h
@@ -35,22 +35,23 @@
 			const char *name, u8 instance, u16 segment,
 			u8 bus, u8 device, u8 function);
 
+const char *smbios_system_manufacturer(void);
+const char *smbios_system_product_name(void);
+const char *smbios_system_serial_number(void);
+const char *smbios_system_version(void);
+void smbios_system_set_uuid(u8 *uuid);
+const char *smbios_system_sku(void);
+
 const char *smbios_mainboard_manufacturer(void);
 const char *smbios_mainboard_product_name(void);
-
 const char *smbios_mainboard_serial_number(void);
 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_feature_flags(void);
 const char *smbios_mainboard_location_in_chassis(void);
-
-const char *smbios_mainboard_sku(void);
 u8 smbios_mainboard_enclosure_type(void);
-#ifdef CONFIG_MAINBOARD_FAMILY
-const char *smbios_mainboard_family(void);
-#endif
 
 #define BIOS_CHARACTERISTICS_PCI_SUPPORTED  (1 << 7)
 #define BIOS_CHARACTERISTICS_PC_CARD  (1 << 8)
diff --git a/src/mainboard/emulation/qemu-i440fx/fw_cfg.c b/src/mainboard/emulation/qemu-i440fx/fw_cfg.c
index f6a3de7..f009dfa 100644
--- a/src/mainboard/emulation/qemu-i440fx/fw_cfg.c
+++ b/src/mainboard/emulation/qemu-i440fx/fw_cfg.c
@@ -475,7 +475,7 @@
 	return type1_serial_number ?: CONFIG_MAINBOARD_SERIAL_NUMBER;
 }
 
-void smbios_mainboard_set_uuid(u8 *uuid)
+void smbios_system_set_uuid(u8 *uuid)
 {
 	fw_cfg_smbios_init();
 	memcpy(uuid, type1_uuid, 16);
diff --git a/src/mainboard/google/fizz/mainboard.c b/src/mainboard/google/fizz/mainboard.c
index 5670936..54fd7df 100644
--- a/src/mainboard/google/fizz/mainboard.c
+++ b/src/mainboard/google/fizz/mainboard.c
@@ -177,7 +177,7 @@
 	return oem_id;
 }
 
-const char *smbios_mainboard_sku(void)
+const char *smbios_system_sku(void)
 {
 	static char sku_str[5]; /* sku{0..7} */
 
diff --git a/src/mainboard/google/kahlee/mainboard.c b/src/mainboard/google/kahlee/mainboard.c
index ebdcc93..d8e0984 100644
--- a/src/mainboard/google/kahlee/mainboard.c
+++ b/src/mainboard/google/kahlee/mainboard.c
@@ -220,7 +220,7 @@
 }
 #endif
 
-const char *smbios_mainboard_sku(void)
+const char *smbios_system_sku(void)
 {
 	static char sku_str[7]; /* sku{0..255} */
 
diff --git a/src/mainboard/google/octopus/mainboard.c b/src/mainboard/google/octopus/mainboard.c
index fceb95d..a472a2d 100644
--- a/src/mainboard/google/octopus/mainboard.c
+++ b/src/mainboard/google/octopus/mainboard.c
@@ -131,7 +131,7 @@
 	return sku_id;
 }
 
-const char *smbios_mainboard_sku(void)
+const char *smbios_system_sku(void)
 {
 	static char sku_str[7]; /* sku{0..255} */
 	uint32_t sku_id = get_board_sku();
diff --git a/src/mainboard/google/poppy/variants/nami/mainboard.c b/src/mainboard/google/poppy/variants/nami/mainboard.c
index ba994c2..6807175 100644
--- a/src/mainboard/google/poppy/variants/nami/mainboard.c
+++ b/src/mainboard/google/poppy/variants/nami/mainboard.c
@@ -102,7 +102,7 @@
 	return sku_id;
 }
 
-const char *smbios_mainboard_sku(void)
+const char *smbios_system_sku(void)
 {
 	static char sku_str[14]; /* sku{0..4294967295} */
 
diff --git a/src/mainboard/google/poppy/variants/nautilus/mainboard.c b/src/mainboard/google/poppy/variants/nautilus/mainboard.c
index bacf1a4..8dd4eea 100644
--- a/src/mainboard/google/poppy/variants/nautilus/mainboard.c
+++ b/src/mainboard/google/poppy/variants/nautilus/mainboard.c
@@ -26,7 +26,7 @@
 #define B_PCH_OC_WDT_CTL_EN		BIT14
 #define B_PCH_OC_WDT_CTL_UNXP_RESET_STS	BIT22
 
-const char *smbios_mainboard_sku(void)
+const char *smbios_system_sku(void)
 {
 	static char sku_str[5]; /* sku{0-1} */
 
diff --git a/src/mainboard/google/poppy/variants/rammus/mainboard.c b/src/mainboard/google/poppy/variants/rammus/mainboard.c
index a3474d4..5c5b258 100644
--- a/src/mainboard/google/poppy/variants/rammus/mainboard.c
+++ b/src/mainboard/google/poppy/variants/rammus/mainboard.c
@@ -34,7 +34,7 @@
 	return sku_id;
 }
 
-const char *smbios_mainboard_sku(void)
+const char *smbios_system_sku(void)
 {
 	static char sku_str[14]; /* sku{0..4294967295} */
 
diff --git a/src/mainboard/google/reef/mainboard.c b/src/mainboard/google/reef/mainboard.c
index 05af84a..20b6a26 100644
--- a/src/mainboard/google/reef/mainboard.c
+++ b/src/mainboard/google/reef/mainboard.c
@@ -88,7 +88,7 @@
 {
 }
 
-const char *smbios_mainboard_sku(void)
+const char *smbios_system_sku(void)
 {
 	static char sku_str[7]; /* sku{0..255} */
 
diff --git a/src/mainboard/pcengines/apu1/mainboard.c b/src/mainboard/pcengines/apu1/mainboard.c
index 1105d5f..084a186 100644
--- a/src/mainboard/pcengines/apu1/mainboard.c
+++ b/src/mainboard/pcengines/apu1/mainboard.c
@@ -263,7 +263,7 @@
 /*
  * We will stuff the memory size into the smbios sku location.
  */
-const char *smbios_mainboard_sku(void)
+const char *smbios_system_sku(void)
 {
 	static char sku[5];
 	if (sku[0] != 0)
diff --git a/src/mainboard/pcengines/apu2/mainboard.c b/src/mainboard/pcengines/apu2/mainboard.c
index 99ddf80..7f05a0d 100644
--- a/src/mainboard/pcengines/apu2/mainboard.c
+++ b/src/mainboard/pcengines/apu2/mainboard.c
@@ -222,7 +222,7 @@
 /*
  * We will stuff the memory size into the smbios sku location.
  */
-const char *smbios_mainboard_sku(void)
+const char *smbios_system_sku(void)
 {
 	static char sku[5];
 	if (sku[0] != 0)
diff --git a/src/vendorcode/intel/fsp/fsp1_1/checklist/ramstage_complete.dat b/src/vendorcode/intel/fsp/fsp1_1/checklist/ramstage_complete.dat
index 64f8584..7ef036f 100644
--- a/src/vendorcode/intel/fsp/fsp1_1/checklist/ramstage_complete.dat
+++ b/src/vendorcode/intel/fsp/fsp1_1/checklist/ramstage_complete.dat
@@ -32,7 +32,7 @@
 smbios_mainboard_manufacturer
 smbios_mainboard_product_name
 smbios_mainboard_serial_number
-smbios_mainboard_set_uuid
+smbios_system_set_uuid
 smbios_mainboard_version
 smm_disable_busmaster
 soc_after_silicon_init
diff --git a/src/vendorcode/intel/fsp/fsp1_1/checklist/ramstage_optional.dat b/src/vendorcode/intel/fsp/fsp1_1/checklist/ramstage_optional.dat
index 6608583..1ad7bd8 100644
--- a/src/vendorcode/intel/fsp/fsp1_1/checklist/ramstage_optional.dat
+++ b/src/vendorcode/intel/fsp/fsp1_1/checklist/ramstage_optional.dat
@@ -29,7 +29,7 @@
 smbios_mainboard_manufacturer
 smbios_mainboard_product_name
 smbios_mainboard_serial_number
-smbios_mainboard_set_uuid
+smbios_system_set_uuid
 smbios_mainboard_version
 smm_disable_busmaster
 soc_after_silicon_init

-- 
To view, visit https://review.coreboot.org/29477
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: I3c9c95a1307529c3137647a161a698a4c3daa0ae
Gerrit-Change-Number: 29477
Gerrit-PatchSet: 1
Gerrit-Owner: Nico Huber <nico.h at gmx.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20181105/b1d093e5/attachment-0001.html>


More information about the coreboot-gerrit mailing list