From 8337e686a6043f900b251c9748b0430b3d880215 Mon Sep 17 00:00:00 2001 From: Zanxi Chen Date: Thu, 2 Sep 2021 09:53:35 +0800 Subject: mb/google/trogdor: Add PANEL_ID to SKU_ID In order to distinguish which mipi panel to use, it need to read the PANEL_ID, and combine the PANEL_ID and SKU_ID into a new SKU_ID. BUG=b:197708579,b:191574572,b:198548221 TEST=PANEL_ID should be set correctly. BRANCH=none Change-Id: I018b3f460f9d084d1a3f0dac026f1cd9dde284e2 Signed-off-by: Zanxi Chen Reviewed-on: https://review.coreboot.org/c/coreboot/+/57329 Tested-by: build bot (Jenkins) Reviewed-by: Bob Moragues Reviewed-by: Julius Werner --- src/mainboard/google/trogdor/boardid.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/mainboard') diff --git a/src/mainboard/google/trogdor/boardid.c b/src/mainboard/google/trogdor/boardid.c index c972160fd4..6db17069d3 100644 --- a/src/mainboard/google/trogdor/boardid.c +++ b/src/mainboard/google/trogdor/boardid.c @@ -42,6 +42,13 @@ uint32_t ram_code(void) return id; } +static uint8_t panel_id(void) +{ + const gpio_t pins[] = {[1] = GPIO(11), [0] = GPIO(4)}; + + return gpio_binary_first_base3_value(pins, ARRAY_SIZE(pins)); +} + uint32_t sku_id(void) { static uint32_t id = UNDEFINED_STRAPPING_ID; @@ -54,6 +61,9 @@ uint32_t sku_id(void) id = gpio_binary_first_base3_value(old_pins, ARRAY_SIZE(old_pins)); else id = gpio_binary_first_base3_value(pins, ARRAY_SIZE(pins)); + + if (CONFIG(TROGDOR_HAS_MIPI_PANEL)) + id = panel_id() << 8 | id; } return id; -- cgit v1.2.3