diff options
author | Hung-Te Lin <hungte@chromium.org> | 2019-01-03 14:31:04 +0800 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2019-01-10 12:17:52 +0000 |
commit | e7184b0ad07b0d3fe3e2f58bacd5e10e3cd88a79 (patch) | |
tree | 234013a36c19f0ee7aa262e48213de9b3668ed84 /src/mainboard | |
parent | a2333c3935d5a31d9bcd2e48755767887e33ddc1 (diff) |
google/kukui: Correct boardid sources and add sku_id
Kukui is going to use ADC#4 as SKU ID, and utilizing EC BoardID as
global board_id (i.e., board revision).
BUG=b:122060615
TEST=make; manually tested on Kukui P1 board.
Change-Id: I7bba368c141a7ba6db11f24b8e8e7158f0fc729e
Signed-off-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-on: https://review.coreboot.org/c/30617
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: You-Cheng Syu <youcheng@google.com>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src/mainboard')
-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 287fd0d1de..d8ad84bb0d 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 d4b4b3e748..2420e78f4f 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) |