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 <chenzanxi@huaqin.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/57329
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Bob Moragues <moragues@google.com>
Reviewed-by: Julius Werner <jwerner@chromium.org>
This commit is contained in:
Zanxi Chen 2021-09-02 09:53:35 +08:00 committed by Julius Werner
parent ecc459301f
commit 8337e686a6
1 changed files with 10 additions and 0 deletions

View File

@ -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;