lenovo/x60: Add "IBM ThinkPad Embedded Controller" SMBIOS OEM String
The Linux thinkpad_acpi.c driver looks for this string while reading information about the system it is running on. This commit does not make the module load but it is one of several things that the module looks for on a ThinkPad. The use of 3 defines for the serial number template seems odd but it's done in a way that eliminates magic numbers, yet avoids use of strcpy, strlen, strindex, strchr, or strspan: we can have some correctness assured at compile time. Also, the defines can be copy/pasted for other mainboards and we should void errors due to people not changing magic numbers. Change-Id: Ief5f28d2e27bf959cb579c4c8eea9eecc9a89a7c Signed-off-by: Peter Stuge <peter@stuge.se> Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> Reviewed-on: http://review.coreboot.org/3620 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
parent
5d84743297
commit
cd24e3f6a7
|
@ -36,6 +36,7 @@
|
||||||
#include <pc80/mc146818rtc.h>
|
#include <pc80/mc146818rtc.h>
|
||||||
#include "dock.h"
|
#include "dock.h"
|
||||||
#include <arch/x86/include/arch/acpigen.h>
|
#include <arch/x86/include/arch/acpigen.h>
|
||||||
|
#include <smbios.h>
|
||||||
#include <x86emu/x86emu.h>
|
#include <x86emu/x86emu.h>
|
||||||
#define PANEL INT15_5F35_CL_DISPLAY_DEFAULT
|
#define PANEL INT15_5F35_CL_DISPLAY_DEFAULT
|
||||||
|
|
||||||
|
@ -133,9 +134,28 @@ static void mainboard_init(device_t dev)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int mainboard_smbios_data(device_t dev, int *handle, unsigned long *current)
|
||||||
|
{
|
||||||
|
int len;
|
||||||
|
#define SERIALBEGIN "IBM ThinkPad Embedded Controller -["
|
||||||
|
#define SERIAL "01234567890123456"
|
||||||
|
#define SERIALEND "]-"
|
||||||
|
char tpec[] = SERIALBEGIN SERIAL SERIALEND;
|
||||||
|
|
||||||
|
const char *oem_strings[] = {
|
||||||
|
tpec,
|
||||||
|
};
|
||||||
|
|
||||||
|
h8_build_id_and_function_spec_version(tpec + sizeof(SERIALBEGIN), sizeof(SERIAL));
|
||||||
|
len = smbios_write_type11(current, (*handle)++, oem_strings, ARRAY_SIZE(oem_strings));
|
||||||
|
|
||||||
|
return len;
|
||||||
|
}
|
||||||
|
|
||||||
static void mainboard_enable(device_t dev)
|
static void mainboard_enable(device_t dev)
|
||||||
{
|
{
|
||||||
dev->ops->init = mainboard_init;
|
dev->ops->init = mainboard_init;
|
||||||
|
dev->ops->get_smbios_data = mainboard_smbios_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct chip_operations mainboard_ops = {
|
struct chip_operations mainboard_ops = {
|
||||||
|
|
Loading…
Reference in New Issue