From 1000b0f0887cfe6fa5cc8dba8db759ac1d68a164 Mon Sep 17 00:00:00 2001 From: Yidi Lin Date: Thu, 9 Feb 2023 14:46:06 +0800 Subject: [PATCH] mb/google/geralt: Report SKU ID and panel ID for unprovisioned devices To make MIPI/eDP panel functional on unprovisioned devices, it requires passing SKU ID and panel ID info to the payload(depthcharge) to load the corresponded device tree for kernel. BUG=b:247415660 TEST=cbmem -1 |grep "SKU Code". Change-Id: Id2254729b7bd621d1e9bc520e8f40916d0f81030 Signed-off-by: Yidi Lin Reviewed-on: https://review.coreboot.org/c/coreboot/+/73076 Reviewed-by: Rex-BC Chen Tested-by: build bot (Jenkins) Reviewed-by: Yu-Ping Wu --- src/mainboard/google/geralt/boardid.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/mainboard/google/geralt/boardid.c b/src/mainboard/google/geralt/boardid.c index 19d25c4a10..7a627416be 100644 --- a/src/mainboard/google/geralt/boardid.c +++ b/src/mainboard/google/geralt/boardid.c @@ -96,9 +96,14 @@ uint32_t sku_id(void) if (cached_sku_code == BOARD_ID_INIT) { cached_sku_code = google_chromeec_get_board_sku(); - if (cached_sku_code == CROS_SKU_UNKNOWN) { - printk(BIOS_WARNING, "Failed to get SKU code from EC\n"); - cached_sku_code = get_adc_index(SKU_ID_CHANNEL); + if (cached_sku_code == CROS_SKU_UNKNOWN || + cached_sku_code == CROS_SKU_UNPROVISIONED) { + printk(BIOS_WARNING, "SKU code from EC: %s\n", + (cached_sku_code == CROS_SKU_UNKNOWN) ? + "CROS_SKU_UNKNOWN" : "CROS_SKU_UNPROVISIONED"); + /* Reserve last 8 bits to report SKU_ID and PANEL_ID */ + cached_sku_code = 0x7FFFFF00UL | get_adc_index(SKU_ID_CHANNEL) << 4 | + panel_id(); } printk(BIOS_DEBUG, "SKU Code: %#02x\n", cached_sku_code); }