diff options
-rw-r--r-- | src/mainboard/google/kukui/Kconfig | 1 | ||||
-rw-r--r-- | src/mainboard/google/kukui/boardid.c | 16 |
2 files changed, 14 insertions, 3 deletions
diff --git a/src/mainboard/google/kukui/Kconfig b/src/mainboard/google/kukui/Kconfig index 287fd0d1ded5..d8ad84bb0d68 100644 --- a/src/mainboard/google/kukui/Kconfig +++ b/src/mainboard/google/kukui/Kconfig @@ -14,6 +14,7 @@ config BOARD_SPECIFIC_OPTIONS select FATAL_ASSERTS select SPI_FLASH_INCLUDE_ALL_DRIVERS select EC_GOOGLE_CHROMEEC + select EC_GOOGLE_CHROMEEC_BOARDID select EC_GOOGLE_CHROMEEC_SPI select MAINBOARD_HAS_SPI_TPM_CR50 if VBOOT select MAINBOARD_HAS_TPM2 if VBOOT diff --git a/src/mainboard/google/kukui/boardid.c b/src/mainboard/google/kukui/boardid.c index d4b4b3e74898..2420e78f4f1b 100644 --- a/src/mainboard/google/kukui/boardid.c +++ b/src/mainboard/google/kukui/boardid.c @@ -58,10 +58,20 @@ static uint32_t get_index(unsigned int channel, uint32_t *cached_id) return id; } -uint32_t board_id(void) +/* board_id is provided by ec/google/chromeec/ec_boardid.c */ + +uint32_t sku_id(void) { - static uint32_t cached_board_id = BOARD_ID_INIT; - return get_index(4, &cached_board_id); + static uint32_t cached_sku_id = BOARD_ID_INIT; + + /* 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) { + cached_sku_id = 0; + return cached_sku_id; + } + } + return get_index(4, &cached_sku_id); } uint32_t ram_code(void) |