summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward O'Callaghan <quasisec@google.com>2020-02-21 15:14:17 +1100
committerEdward O'Callaghan <quasisec@chromium.org>2020-02-28 14:27:00 +0000
commit2f55726609bb27d550b58f735b1426065558fee0 (patch)
treef9ce0665bebfdae740363dd3c713a99c48b2ac50
parent6d295ac9506864a4e3e156c4cea04d1dc7e00716 (diff)
mainboard/google/volteer: Migrate onto SKU ID helpers
Leverage the common sku id space helper encoders. volteer uses the non-legacy SKU ID space. BUG=b:149348474 BRANCH=none TEST=only tested on hatch Change-Id: Ic66908afb7abb34527b4177cfd07f03ad718317c Signed-off-by: Edward O'Callaghan <quasisec@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/39037 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Furquan Shaikh <furquan@google.com>
-rw-r--r--src/mainboard/google/volteer/Kconfig1
-rw-r--r--src/mainboard/google/volteer/mainboard.c29
2 files changed, 2 insertions, 28 deletions
diff --git a/src/mainboard/google/volteer/Kconfig b/src/mainboard/google/volteer/Kconfig
index 572a10020e..699cdeae8d 100644
--- a/src/mainboard/google/volteer/Kconfig
+++ b/src/mainboard/google/volteer/Kconfig
@@ -6,6 +6,7 @@ config BOARD_GOOGLE_BASEBOARD_VOLTEER
select DRIVERS_SPI_ACPI
select EC_GOOGLE_CHROMEEC
select EC_GOOGLE_CHROMEEC_BOARDID
+ select EC_GOOGLE_CHROMEEC_SKUID
select EC_GOOGLE_CHROMEEC_LPC
select HAVE_ACPI_RESUME
select HAVE_ACPI_TABLES
diff --git a/src/mainboard/google/volteer/mainboard.c b/src/mainboard/google/volteer/mainboard.c
index 51cbc40cfc..dcefb5d9cd 100644
--- a/src/mainboard/google/volteer/mainboard.c
+++ b/src/mainboard/google/volteer/mainboard.c
@@ -17,36 +17,9 @@
#include <vendorcode/google/chromeos/chromeos.h>
#include <variant/gpio.h>
-#define SKU_UNKNOWN 0xFFFFFFFF
-#define SKU_MAX 0x7FFFFFFF
-
-static uint32_t get_board_sku(void)
-{
- static uint32_t sku_id = SKU_UNKNOWN;
-
- if (sku_id != SKU_UNKNOWN)
- return sku_id;
-
- if (google_chromeec_cbi_get_sku_id(&sku_id))
- sku_id = SKU_UNKNOWN;
-
- return sku_id;
-}
-
const char *smbios_system_sku(void)
{
- static char sku_str[14]; /* sku{0..2147483647} */
- uint32_t sku_id = get_board_sku();
-
- if ((sku_id == SKU_UNKNOWN) || (sku_id > SKU_MAX)) {
- printk(BIOS_ERR, "%s: Unexpected SKU ID %u\n",
- __func__, sku_id);
- return "";
- }
-
- snprintf(sku_str, sizeof(sku_str), "sku%u", sku_id);
-
- return sku_str;
+ return google_chromeec_smbios_system_sku();
}
static void mainboard_init(struct device *dev)