ec/google/chromeec: add smbios_mainboard_manufacturer()

When EC_GOOGLE_CHROMEEC_SKUID is selected provide an
implementation of smbios_mainboard_manufacturer() so the code
doesn't need to be duplicated in the mainboards.

BUG=b:153767369

Change-Id: Ib65fe373a79d606cffcba71882b0db61be5a18c3
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/40317
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
This commit is contained in:
Aaron Durbin 2020-04-11 09:14:48 -06:00
parent d2d93829bb
commit 4ed96f2443
4 changed files with 19 additions and 67 deletions

View File

@ -37,3 +37,22 @@ const char *smbios_system_sku(void)
{ {
return google_chromeec_smbios_system_sku(); return google_chromeec_smbios_system_sku();
} }
const char *smbios_mainboard_manufacturer(void)
{
static char oem_name[32];
static const char *manuf;
if (manuf)
return manuf;
if (google_chromeec_cbi_get_oem_name(&oem_name[0],
ARRAY_SIZE(oem_name)) < 0) {
printk(BIOS_ERR, "Couldn't obtain OEM name from CBI\n");
manuf = CONFIG_MAINBOARD_SMBIOS_MANUFACTURER;
} else {
manuf = &oem_name[0];
}
return manuf;
}

View File

@ -11,25 +11,6 @@
#include <smbios.h> #include <smbios.h>
#include <string.h> #include <string.h>
const char *smbios_mainboard_manufacturer(void)
{
static char oem_name[32];
static const char *manuf;
if (manuf)
return manuf;
if (google_chromeec_cbi_get_oem_name(&oem_name[0],
ARRAY_SIZE(oem_name)) < 0) {
printk(BIOS_ERR, "Couldn't obtain OEM name from CBI\n");
manuf = CONFIG_MAINBOARD_SMBIOS_MANUFACTURER;
} else {
manuf = &oem_name[0];
}
return manuf;
}
int board_info_get_fw_config(uint32_t *fw_config) int board_info_get_fw_config(uint32_t *fw_config)
{ {
return google_chromeec_cbi_get_fw_config(fw_config); return google_chromeec_cbi_get_fw_config(fw_config);

View File

@ -1,29 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/* This file is part of the coreboot project. */
#include <baseboard/variants.h>
#include <boardid.h>
#include <console/console.h>
#include <ec/google/chromeec/ec.h>
#include <smbios.h>
#include <string.h>
#include <stdint.h>
const char *smbios_mainboard_manufacturer(void)
{
static char oem_name[32];
static const char *manuf;
if (manuf)
return manuf;
if (google_chromeec_cbi_get_oem_name(&oem_name[0],
ARRAY_SIZE(oem_name)) < 0) {
printk(BIOS_INFO, "Couldn't obtain OEM name from CBI\n");
manuf = CONFIG_MAINBOARD_SMBIOS_MANUFACTURER;
} else {
manuf = &oem_name[0];
}
return manuf;
}

View File

@ -139,25 +139,6 @@ void mainboard_devtree_update(struct device *dev)
variant_update_devtree(dev); variant_update_devtree(dev);
} }
const char *smbios_mainboard_manufacturer(void)
{
static char oem_name[32];
static const char *manuf;
if (manuf)
return manuf;
if (google_chromeec_cbi_get_oem_name(&oem_name[0],
ARRAY_SIZE(oem_name)) < 0) {
printk(BIOS_ERR, "Couldn't obtain OEM name from CBI\n");
manuf = CONFIG_MAINBOARD_SMBIOS_MANUFACTURER;
} else {
manuf = &oem_name[0];
}
return manuf;
}
bool __weak variant_ext_usb_status(unsigned int port_type, unsigned int port_id) bool __weak variant_ext_usb_status(unsigned int port_type, unsigned int port_id)
{ {
/* All externally visible USB ports are present */ /* All externally visible USB ports are present */