diff options
author | Andrew McRae <amcrae@google.com> | 2020-06-11 18:15:58 +1000 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-06-12 02:05:40 +0000 |
commit | e691a252a35e0d19c8aed57aeefa140d16e5a8ee (patch) | |
tree | d1e02cfe9decc64ab514fecb9faec4454bb850c1 | |
parent | c29dcac009b642a9a46c6703e354cd5a9c1ba885 (diff) | |
download | chrome-ec-e691a252a35e0d19c8aed57aeefa140d16e5a8ee.tar.gz |
Puff: When fw_config is missing, use sku ID to set it
For board versions 1 and 2, the fw_config field was not set correctly
in the factory, so attempt to use the SKU ID to set it to a correct
value.
BUG=b:158728444
TEST=Boot on various SKU ids and check they are recognised.
BRANCH=none
Signed-off-by: Andrew McRae <amcrae@google.com>
Change-Id: Ie590f9f6d9ee230b6f55764bf3d6e9ae1e42c82f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2241074
Tested-by: Andrew McRae <amcrae@chromium.org>
Reviewed-by: Sam McNally <sammc@chromium.org>
Commit-Queue: Andrew McRae <amcrae@chromium.org>
-rw-r--r-- | board/puff/board.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/board/puff/board.c b/board/puff/board.c index 303b2258d6..fe73dbd48a 100644 --- a/board/puff/board.c +++ b/board/puff/board.c @@ -408,6 +408,7 @@ const struct ina3221_t ina3221[] = { const unsigned int ina3221_count = ARRAY_SIZE(ina3221); static uint16_t board_version; +static uint32_t sku_id; static uint32_t fw_config; static void cbi_init(void) @@ -422,10 +423,26 @@ static void cbi_init(void) if (cbi_get_board_version(&val) == EC_SUCCESS && val <= UINT16_MAX) board_version = val; + if (cbi_get_sku_id(&val) == EC_SUCCESS) + sku_id = val; if (cbi_get_fw_config(&val) == EC_SUCCESS) fw_config = val; - CPRINTS("Board Version: %d, F/W config: 0x%08x", - board_version, fw_config); + else if (board_version == 1 || board_version == 2) { + /* Hack to set the barrel-jack adapter using SKU ID */ + switch (sku_id) { + case 0x00000001: + case 0x00000002: + case 0x01000001: + case 0x01000003: + case 0x01000004: + case 0x02000000: + fw_config = 0x1; + break; + } + CPRINTS("F/W config NOT SET, defaulting to 0x%08x", fw_config); + } + CPRINTS("Board Version: %d, SKU ID: 0x%08x, F/W config: 0x%08x", + board_version, sku_id, fw_config); } DECLARE_HOOK(HOOK_INIT, cbi_init, HOOK_PRIO_INIT_I2C + 1); |