diff options
author | Edward O'Callaghan <quasisec@google.com> | 2020-02-20 13:46:38 +1100 |
---|---|---|
committer | Edward O'Callaghan <quasisec@chromium.org> | 2020-02-28 00:03:59 +0000 |
commit | d51665600e0ddbd4e1ae7144e29d179287ec285f (patch) | |
tree | e09f0c1b62a993d1fe091eb9450eac1e20c43068 /src/mainboard/google/hatch/mainboard.c | |
parent | 9ed10bff317097c42b1545279f88af95ca796ab0 (diff) |
mainboard/google/hatch: Migrate onto SKU ID helpers
Leverage the common sku id space helper encoders.
BUG=b:149348474
BRANCH=none
TEST=tested on hatch
Change-Id: I96e10010fd375b127f1e10387d6f7a839bc35fdd
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/39019
Reviewed-by: Furquan Shaikh <furquan@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/mainboard/google/hatch/mainboard.c')
-rw-r--r-- | src/mainboard/google/hatch/mainboard.c | 29 |
1 files changed, 1 insertions, 28 deletions
diff --git a/src/mainboard/google/hatch/mainboard.c b/src/mainboard/google/hatch/mainboard.c index 5761b085dd..888acf720f 100644 --- a/src/mainboard/google/hatch/mainboard.c +++ b/src/mainboard/google/hatch/mainboard.c @@ -21,36 +21,9 @@ #include <string.h> #include <stdint.h> -#define SKU_UNKNOWN 0xFFFFFFFF -#define SKU_MAX 255 - -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[7]; /* sku{0..255} */ - 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(); } const char *smbios_mainboard_manufacturer(void) |