From 7adbdab761cd7b4bda0a43e7b1c4070de26f150a Mon Sep 17 00:00:00 2001 From: Kane Chen Date: Mon, 8 Sep 2014 18:40:30 -0700 Subject: [PATCH] smbios: add a family id in smbios type1 family mosys will use this field to identify system BRANCH=none BUG=chromium:359155 TEST=build ok, use dmidecode to check whether data is written correctly Change-Id: Icfbd4c61fc49a9cb3d3ecd2b622339957963150c Signed-off-by: Kane Chen Reviewed-on: https://chromium-review.googlesource.com/217400 Reviewed-by: David Hendricks Reviewed-by: Shawn Nematbakhsh --- src/arch/x86/boot/smbios.c | 10 ++++++++++ src/include/smbios.h | 3 +++ 2 files changed, 13 insertions(+) diff --git a/src/arch/x86/boot/smbios.c b/src/arch/x86/boot/smbios.c index 85fa17d401..c58a95cdb0 100644 --- a/src/arch/x86/boot/smbios.c +++ b/src/arch/x86/boot/smbios.c @@ -277,6 +277,13 @@ const char *__attribute__((weak)) smbios_mainboard_version(void) return CONFIG_MAINBOARD_VERSION; } +#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; @@ -290,6 +297,9 @@ static int smbios_write_type1(unsigned long *current, int handle) t->product_name = smbios_add_string(t->eos, CONFIG_MAINBOARD_PART_NUMBER); t->serial_number = smbios_add_string(t->eos, smbios_mainboard_serial_number()); t->version = smbios_add_string(t->eos, smbios_mainboard_version()); +#ifdef CONFIG_MAINBOARD_FAMILY + t->family = smbios_add_string(t->eos, smbios_mainboard_family()); +#endif 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 714579d5e1..2b7710ff12 100644 --- a/src/include/smbios.h +++ b/src/include/smbios.h @@ -14,6 +14,9 @@ int smbios_write_type41(unsigned long *current, int *handle, const char *smbios_mainboard_serial_number(void); const char *smbios_mainboard_version(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)