[coreboot-gerrit] New patch to review for coreboot: 2b3fbc5 smbios: make manufacturer, product_name and uuid runtime settable

Gerd Hoffmann (kraxel@redhat.com) gerrit at coreboot.org
Fri Nov 15 15:06:03 CET 2013


Gerd Hoffmann (kraxel at redhat.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4085

-gerrit

commit 2b3fbc5c05d8fca431cca80584497694020c2cbf
Author: Gerd Hoffmann <kraxel at redhat.com>
Date:   Wed Nov 13 13:37:23 2013 +0100

    smbios: make manufacturer, product_name and uuid runtime settable
    
    Make manufacturer, product_name and uuid smbios fields (type 1)
    configurable at runtime, simliar to version and serial number.
    
    Change-Id: Ibc826225e31fa42aa944fa43632dd6a406d5c85d
    Signed-off-by: Gerd Hoffmann <kraxel at redhat.com>
---
 src/arch/x86/boot/smbios.c | 20 ++++++++++++++++++--
 src/include/smbios.h       |  3 +++
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/src/arch/x86/boot/smbios.c b/src/arch/x86/boot/smbios.c
index 901a209..b8f2ec7 100644
--- a/src/arch/x86/boot/smbios.c
+++ b/src/arch/x86/boot/smbios.c
@@ -183,6 +183,21 @@ const char *__attribute__((weak)) smbios_mainboard_version(void)
 	return CONFIG_MAINBOARD_VERSION;
 }
 
+const char *__attribute__((weak)) smbios_mainboard_manufacturer(void)
+{
+	return CONFIG_MAINBOARD_SMBIOS_MANUFACTURER;
+}
+
+const char *__attribute__((weak)) smbios_mainboard_product_name(void)
+{
+	return CONFIG_MAINBOARD_SMBIOS_PRODUCT_NAME;
+}
+
+void __attribute__((weak)) smbios_mainboard_set_uuid(u8 *uuid)
+{
+	/* leave all zero */
+}
+
 static int smbios_write_type1(unsigned long *current, int handle)
 {
 	struct smbios_type1 *t = (struct smbios_type1 *)*current;
@@ -192,10 +207,11 @@ static int smbios_write_type1(unsigned long *current, int handle)
 	t->type = SMBIOS_SYSTEM_INFORMATION;
 	t->handle = handle;
 	t->length = len - 2;
-	t->manufacturer = smbios_add_string(t->eos, CONFIG_MAINBOARD_SMBIOS_MANUFACTURER);
-	t->product_name = smbios_add_string(t->eos, CONFIG_MAINBOARD_SMBIOS_PRODUCT_NAME);
+	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());
+	smbios_mainboard_set_uuid(t->uuid);
 	len = t->length + smbios_string_table_len(t->eos);
 	*current += len;
 	return len;
diff --git a/src/include/smbios.h b/src/include/smbios.h
index 9051a69..ebe167e 100644
--- a/src/include/smbios.h
+++ b/src/include/smbios.h
@@ -8,8 +8,11 @@ unsigned long smbios_write_tables(unsigned long start);
 int smbios_add_string(char *start, const char *str);
 int smbios_string_table_len(char *start);
 
+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);
 
 #define BIOS_CHARACTERISTICS_PCI_SUPPORTED  (1 << 7)
 #define BIOS_CHARACTERISTICS_PC_CARD  (1 << 8)



More information about the coreboot-gerrit mailing list