From 967edec25463fada1634e8ccee0e847ae49141e2 Mon Sep 17 00:00:00 2001 From: YH Lin Date: Fri, 22 Feb 2019 19:25:02 -0800 Subject: flapjack: get sku_id from ec (cbi) On flapjack, retrieve the board information via CBI interface. Also reserving 0x2 sku_id for the case of un-provisioned board as this is the id used prior to the readiness of cbi. BUG=b:123676982 BRANCH=kukui TEST=provisioned cbi info and verify the sku_id. Signed-off-by: YH Lin Change-Id: Iad7a52df38e2045abbdded8ba0a1f1544de961fc Reviewed-on: https://review.coreboot.org/c/31586 Reviewed-by: Daisuke Nojiri Tested-by: build bot (Jenkins) --- src/mainboard/google/kukui/boardid.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src') diff --git a/src/mainboard/google/kukui/boardid.c b/src/mainboard/google/kukui/boardid.c index 2420e78f4f..2af93c8a0a 100644 --- a/src/mainboard/google/kukui/boardid.c +++ b/src/mainboard/google/kukui/boardid.c @@ -16,8 +16,11 @@ #include #include #include +#include #include +#define FLAPJACK_UNDEF_SKU_ID 2 /* For all un-provisioned Flapjack boards */ + static uint32_t get_index(unsigned int channel, uint32_t *cached_id) { static const int voltages[] = { @@ -64,6 +67,14 @@ uint32_t sku_id(void) { static uint32_t cached_sku_id = BOARD_ID_INIT; + /* On Flapjack, getting the SKU via CBI */ + if (IS_ENABLED(CONFIG_BOARD_GOOGLE_FLAPJACK)) { + if (cached_sku_id == BOARD_ID_INIT && + google_chromeec_cbi_get_sku_id(&cached_sku_id)) + cached_sku_id = FLAPJACK_UNDEF_SKU_ID; + return cached_sku_id; + } + /* Quirk for KUKUI: All P1/SKU0 had incorrectly set SKU=1. */ if (IS_ENABLED(CONFIG_BOARD_GOOGLE_KUKUI)) { if (cached_sku_id == BOARD_ID_INIT && board_id() == 1) { -- cgit v1.2.3