Patrick Georgi has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/31586 )
Change subject: flapjack: get sku_id from ec (cbi) ......................................................................
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 yueherngl@google.com Change-Id: Iad7a52df38e2045abbdded8ba0a1f1544de961fc Reviewed-on: https://review.coreboot.org/c/31586 Reviewed-by: Daisuke Nojiri dnojiri@chromium.org Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/mainboard/google/kukui/boardid.c 1 file changed, 11 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Daisuke Nojiri: Looks good to me, approved YH Lin: Looks good to me, approved
diff --git a/src/mainboard/google/kukui/boardid.c b/src/mainboard/google/kukui/boardid.c index 2420e78..2af93c8 100644 --- a/src/mainboard/google/kukui/boardid.c +++ b/src/mainboard/google/kukui/boardid.c @@ -16,8 +16,11 @@ #include <assert.h> #include <boardid.h> #include <soc/auxadc.h> +#include <ec/google/chromeec/ec.h> #include <stddef.h>
+#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 @@ { 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) {