[coreboot-gerrit] Patch set updated for coreboot: 91f2b6f lenovo/t520/mainboard.c: Add EC info to SMBIOS

Nicolas Reinecke (nr@das-labor.org) gerrit at coreboot.org
Mon Aug 25 14:19:00 CEST 2014


Nicolas Reinecke (nr at das-labor.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6761

-gerrit

commit 91f2b6f9261b2b2c3e1e9f990889b1646988b336
Author: Nicolas Reinecke <nr at das-labor.org>
Date:   Sun Aug 24 22:20:13 2014 +0200

    lenovo/t520/mainboard.c: Add EC info to SMBIOS
    
    As is in:
    91175bb lenovo/x201 & x230: Add EC info to SMBIOS
    
    This is needed for the Linux driver for the Lenovo's to properly attach.
    
    Change-Id: I92bed33c639e36c41dffe556bc58ee4e5b6d42ab
    Signed-off-by: Nicolas Reinecke <nr at das-labor.org>
---
 src/mainboard/lenovo/t520/mainboard.c | 28 ++++++++++++++++++++++++++--
 1 file changed, 26 insertions(+), 2 deletions(-)

diff --git a/src/mainboard/lenovo/t520/mainboard.c b/src/mainboard/lenovo/t520/mainboard.c
index 8b1aa0d..fc13b52 100644
--- a/src/mainboard/lenovo/t520/mainboard.c
+++ b/src/mainboard/lenovo/t520/mainboard.c
@@ -40,6 +40,7 @@
 #include <cbfs.h>
 #include <pc80/keyboard.h>
 #include <ec/lenovo/h8/h8.h>
+#include <build.h>
 #include <device/azalia_device.h>
 
 void mainboard_suspend_resume(void)
@@ -133,6 +134,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 T520";
@@ -166,11 +176,25 @@ static void mainboard_init(device_t dev)
 			   0x42, 0x142);
 }
 
-/* mainboard_enable is executed as first thing after
-enumerate_buses(). */
+static int mainboard_smbios_data(device_t dev, int *handle, unsigned long *current)
+{
+	int len;
+	char tpec[] = "IBM ThinkPad Embedded Controller -[                 ]-";
+	const char *oem_strings[] = {
+		tpec,
+	};
+
+	h8_build_id_and_function_spec_version(tpec + 35, 17);
+	len = smbios_write_type11(current, (*handle)++, oem_strings, ARRAY_SIZE(oem_strings));
+
+	return len;
+}
+
 static void mainboard_enable(device_t dev)
 {
 	dev->ops->init = mainboard_init;
+	dev->ops->get_smbios_data = mainboard_smbios_data;
+
 #if CONFIG_VGA_ROM_RUN
 	/* Install custom int15 handler for VGA OPROM */
 	mainboard_interrupt_handlers(0x15, &int15_handler);



More information about the coreboot-gerrit mailing list