mb/google/sarien: Set serial number in SMBIOS

Set the system serial number from the VPD key "serial_number" and
the mainboard serial number from the VPD key "mlb_serial_number".

BUG=b:132970635
TEST=check serial number is set in SMBIOS based on VPD, and if there
is no VPD key found then it is empty.

Change-Id: Ia8f1486dcb1edc968b8eb1e6d989b10c05913aca
Signed-off-by: Duncan Laurie <dlaurie@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/32851
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Lijian Zhao <lijian.zhao@intel.com>
Reviewed-by: Furquan Shaikh <furquan@google.com>
This commit is contained in:
Duncan Laurie 2019-05-17 12:06:37 -06:00 committed by Duncan Laurie
parent f85f2f8746
commit 9beb52a17c
1 changed files with 21 additions and 0 deletions

View File

@ -14,6 +14,7 @@
*/
#include <arch/acpi.h>
#include <drivers/vpd/vpd.h>
#include <smbios.h>
#include <soc/gpio.h>
#include <soc/ramstage.h>
@ -21,6 +22,26 @@
#include <vendorcode/google/chromeos/chromeos.h>
#if CONFIG(GENERATE_SMBIOS_TABLES)
#define VPD_KEY_SYSTEM_SERIAL "serial_number"
#define VPD_KEY_MAINBOARD_SERIAL "mlb_serial_number"
#define VPD_SERIAL_LEN 64
const char *smbios_system_serial_number(void)
{
static char serial[VPD_SERIAL_LEN];
if (vpd_gets(VPD_KEY_SYSTEM_SERIAL, serial, VPD_SERIAL_LEN, VPD_RO))
return serial;
return "";
}
const char *smbios_mainboard_serial_number(void)
{
static char serial[VPD_SERIAL_LEN];
if (vpd_gets(VPD_KEY_MAINBOARD_SERIAL, serial, VPD_SERIAL_LEN, VPD_RO))
return serial;
return "";
}
/* mainboard silk screen shows DIMM-A and DIMM-B */
void smbios_fill_dimm_locator(const struct dimm_info *dimm,
struct smbios_type17 *t)