[coreboot-gerrit] Patch set updated for coreboot: f6f5cb0 Make version look like something thinkpad_acpi would accept

Vladimir Serbinenko (phcoder@gmail.com) gerrit at coreboot.org
Thu Jan 23 17:34:23 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/4650

-gerrit

commit f6f5cb07704c924a00eb31f332f05ee27a952e46
Author: Vladimir Serbinenko <phcoder at gmail.com>
Date:   Fri Jun 7 02:11:41 2013 +0200

    Make version look like something thinkpad_acpi would accept
    
    thinkpad_acpi checks that BIOS version matches some pattern.
    Report version in this form.
    
    Not cleaned up as the idea of this patch seems to be met with resistance.
    Can make it Thinkpad-specific if the idea is accepted.
    
    Change-Id: I15e33e87e7a7f42d6a06f12fb39b5172153af8a1
    Signed-off-by: Vladimir Serbinenko <phcoder at gmail.com>
---
 src/arch/x86/boot/smbios.c            | 16 ++++++++++++----
 src/include/smbios.h                  |  1 +
 src/mainboard/lenovo/t60/mainboard.c  | 12 ++++++++++++
 src/mainboard/lenovo/x201/mainboard.c | 10 ++++++++++
 src/mainboard/lenovo/x230/mainboard.c | 10 ++++++++++
 src/mainboard/lenovo/x60/mainboard.c  | 11 +++++++++++
 6 files changed, 56 insertions(+), 4 deletions(-)

diff --git a/src/arch/x86/boot/smbios.c b/src/arch/x86/boot/smbios.c
index 65bf538..03a7728 100644
--- a/src/arch/x86/boot/smbios.c
+++ b/src/arch/x86/boot/smbios.c
@@ -118,6 +118,14 @@ static int smbios_processor_name(char *start)
 	return smbios_add_string(start, tmp);
 }
 
+const char *__attribute__((weak)) smbios_mainboard_bios_version(void)
+{
+	if (strlen(CONFIG_LOCALVERSION))
+		return CONFIG_LOCALVERSION;
+	else
+		return COREBOOT_VERSION;
+}
+
 static int smbios_write_type0(unsigned long *current, int handle)
 {
 	struct smbios_type0 *t = (struct smbios_type0 *)*current;
@@ -130,12 +138,12 @@ static int smbios_write_type0(unsigned long *current, int handle)
 
 	t->vendor = smbios_add_string(t->eos, "coreboot");
 #if !CONFIG_CHROMEOS
+#ifndef CONFIG_VENDOR_VERSION
+#define CONFIG_VENDOR_VERSION ""
+#endif
 	t->bios_release_date = smbios_add_string(t->eos, COREBOOT_DMI_DATE);
 
-	if (strlen(CONFIG_LOCALVERSION))
-		t->bios_version = smbios_add_string(t->eos, CONFIG_LOCALVERSION);
-	else
-		t->bios_version = smbios_add_string(t->eos, COREBOOT_VERSION);
+	t->bios_version = smbios_add_string(t->eos, smbios_mainboard_bios_version());
 #else
 #define SPACES \
 	"                                                                  "
diff --git a/src/include/smbios.h b/src/include/smbios.h
index 42c5d2d..b08459f 100644
--- a/src/include/smbios.h
+++ b/src/include/smbios.h
@@ -19,6 +19,7 @@ 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);
 
 #define BIOS_CHARACTERISTICS_PCI_SUPPORTED  (1 << 7)
 #define BIOS_CHARACTERISTICS_PC_CARD  (1 << 8)
diff --git a/src/mainboard/lenovo/t60/mainboard.c b/src/mainboard/lenovo/t60/mainboard.c
index 52f5dcf..67829fa 100644
--- a/src/mainboard/lenovo/t60/mainboard.c
+++ b/src/mainboard/lenovo/t60/mainboard.c
@@ -24,6 +24,7 @@
 #include <device/device.h>
 #include <arch/io.h>
 #include <delay.h>
+#include <string.h>
 #include <device/pci_def.h>
 #include <device/pci_ops.h>
 #include <arch/io.h>
@@ -33,6 +34,8 @@
 #include <northbridge/intel/i945/i945.h>
 #include <pc80/mc146818rtc.h>
 #include <arch/x86/include/arch/acpigen.h>
+#include <smbios.h>
+#include <build.h>
 
 static acpi_cstate_t cst_entries[] = {
 	{ 1,  1, 1000, { 0x7f, 1, 2, { 0 }, 1, 0 } },
@@ -46,6 +49,15 @@ int get_cst_entries(acpi_cstate_t **entries)
 	return ARRAY_SIZE(cst_entries);
 }
 
+const char *smbios_mainboard_bios_version(void)
+{
+	/* Satisfy thinkpad_acpi.  */
+	if (strlen(CONFIG_LOCALVERSION))
+		return "CBET4000 " CONFIG_LOCALVERSION;
+	else
+		return "CBET4000 " COREBOOT_VERSION;
+}
+
 static void mainboard_enable(device_t dev)
 {
 	struct southbridge_intel_i82801gx_config *config;
diff --git a/src/mainboard/lenovo/x201/mainboard.c b/src/mainboard/lenovo/x201/mainboard.c
index 6321777..dff50fb 100644
--- a/src/mainboard/lenovo/x201/mainboard.c
+++ b/src/mainboard/lenovo/x201/mainboard.c
@@ -46,6 +46,7 @@
 #include <cpu/x86/lapic.h>
 #include <device/pci.h>
 #include <smbios.h>
+#include <build.h>
 
 static acpi_cstate_t cst_entries[] = {
 	{1, 1, 1000, {0x7f, 1, 2, {0}, 1, 0}},
@@ -87,6 +88,15 @@ static int int15_handler(void)
 }
 #endif
 
+const char *smbios_mainboard_bios_version(void)
+{
+	/* Satisfy thinkpad_acpi.  */
+	if (strlen(CONFIG_LOCALVERSION))
+		return "CBET4000 " CONFIG_LOCALVERSION;
+	else
+		return "CBET4000 " COREBOOT_VERSION;
+}
+
 const char *smbios_mainboard_version(void)
 {
 	return "Lenovo X201";
diff --git a/src/mainboard/lenovo/x230/mainboard.c b/src/mainboard/lenovo/x230/mainboard.c
index 91965b6..b269e3e 100644
--- a/src/mainboard/lenovo/x230/mainboard.c
+++ b/src/mainboard/lenovo/x230/mainboard.c
@@ -38,6 +38,7 @@
 #include <device/pci.h>
 #include <cbfs.h>
 #include <pc80/keyboard.h>
+#include <build.h>
 
 void mainboard_suspend_resume(void)
 {
@@ -130,6 +131,15 @@ static int int15_handler(void)
 }
 #endif
 
+const char *smbios_mainboard_bios_version(void)
+{
+	/* Satisfy thinkpad_acpi.  */
+	if (strlen(CONFIG_LOCALVERSION))
+		return "CBET4000 " CONFIG_LOCALVERSION;
+	else
+		return "CBET4000 " COREBOOT_VERSION;
+}
+
 const char *smbios_mainboard_version(void)
 {
 	return "ThinkPad X230";
diff --git a/src/mainboard/lenovo/x60/mainboard.c b/src/mainboard/lenovo/x60/mainboard.c
index d1fcb7b..8143ece 100644
--- a/src/mainboard/lenovo/x60/mainboard.c
+++ b/src/mainboard/lenovo/x60/mainboard.c
@@ -24,6 +24,7 @@
 #include <device/device.h>
 #include <arch/io.h>
 #include <delay.h>
+#include <string.h>
 #include <device/pci_def.h>
 #include <device/pci_ops.h>
 #include <device/pci_ids.h>
@@ -37,6 +38,7 @@
 #include "dock.h"
 #include <arch/x86/include/arch/acpigen.h>
 #include <smbios.h>
+#include <build.h>
 #include <x86emu/x86emu.h>
 #define PANEL INT15_5F35_CL_DISPLAY_DEFAULT
 
@@ -148,6 +150,15 @@ static int mainboard_smbios_data(device_t dev, int *handle, unsigned long *curre
 	return len;
 }
 
+const char *smbios_mainboard_bios_version(void)
+{
+	/* Satisfy thinkpad_acpi.  */
+	if (strlen(CONFIG_LOCALVERSION))
+		return "CBET4000 " CONFIG_LOCALVERSION;
+	else
+		return "CBET4000 " COREBOOT_VERSION;
+}
+
 static void mainboard_enable(device_t dev)
 {
 	dev->ops->init = mainboard_init;



More information about the coreboot-gerrit mailing list