Hung-Te Lin has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/32263
Change subject: google/kukui: Include panel identifier (LCM ID) into SKU ID ......................................................................
google/kukui: Include panel identifier (LCM ID) into SKU ID
Kukui is using MIPI display panel and needs some identifier to tell payloads which panel is installed, and select right kernel device tree. Following Scarlet, the decision is to embed panel ID as part of SKU ID.
BUG=b:129299873 TEST=make -j; boots on Kukui P2 unit.
Change-Id: Ib0c00bc8ce3c71c445c5c4561403ce8ef4dd5844 Signed-off-by: Hung-Te Lin hungte@chromium.org --- M src/mainboard/google/kukui/boardid.c 1 file changed, 17 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/63/32263/1
diff --git a/src/mainboard/google/kukui/boardid.c b/src/mainboard/google/kukui/boardid.c index ff910fe..84a0663 100644 --- a/src/mainboard/google/kukui/boardid.c +++ b/src/mainboard/google/kukui/boardid.c @@ -66,24 +66,37 @@
uint32_t sku_id(void) { + uint32_t sku = BOARD_ID_INIT, lcm = BOARD_ID_INIT; static uint32_t cached_sku_id = BOARD_ID_INIT;
+ if (cached_sku_id != BOARD_ID_INIT) + return cached_sku_id; + /* On Flapjack, getting the SKU via CBI. */ if (CONFIG(BOARD_GOOGLE_FLAPJACK)) { - if (cached_sku_id == BOARD_ID_INIT && - google_chromeec_cbi_get_sku_id(&cached_sku_id)) + if (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 (CONFIG(BOARD_GOOGLE_KUKUI)) { - if (cached_sku_id == BOARD_ID_INIT && board_id() == 1) { + if (board_id() == 1) { cached_sku_id = 0; return cached_sku_id; } } - return get_index(4, &cached_sku_id); + + /* + * The SKU is combined from: + * ADC2[4bit] = Panel ID (LCM_ID). + * ADC4[4bit] = SKU ID from board straps. + */ + get_index(2, &lcm); + get_index(4, &sku); + cached_sku_id = lcm << 4 || sku; + + return cached_sku_id; }
uint32_t ram_code(void)