diff options
author | Zanxi Chen <chenzanxi@huaqin.corp-partner.google.com> | 2021-09-02 09:53:35 +0800 |
---|---|---|
committer | Julius Werner <jwerner@chromium.org> | 2021-09-13 23:27:34 +0000 |
commit | 8337e686a6043f900b251c9748b0430b3d880215 (patch) | |
tree | b204e05d58c7ccc72a4cb71792ed6f383169bd9e /src/mainboard/google | |
parent | ecc459301f54d412bba67507e7e9fbac1834f0c2 (diff) |
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>
Diffstat (limited to 'src/mainboard/google')
-rw-r--r-- | src/mainboard/google/trogdor/boardid.c | 10 |
1 files changed, 10 insertions, 0 deletions
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; |