diff options
author | Michał Barnaś <mb@semihalf.com> | 2021-08-06 14:20:54 +0200 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-08-18 01:33:11 +0000 |
commit | 9338d58b3ea480ad11fcce3abaa87c91541697a1 (patch) | |
tree | e5880290a7594bf26e9a8b5ad3838b26faebdef5 /board/lazor/board.c | |
parent | dac94834ba1fe8a60ec6e6b0f3884782dd95a270 (diff) | |
download | chrome-ec-9338d58b3ea480ad11fcce3abaa87c91541697a1.tar.gz |
zephyr: add lazor definitions of sku id and board version in dt
Add pins definitions in device tree file used to build zephyr
BRANCH=main
BUG=b:194136536
TEST=Build zephyr for lazor and verify if sku id and board version
in EC console are correct.
Change-Id: Ibdc1dcb456b5cecd48ddafeafff0f765ffa45081
Signed-off-by: Michał Barnaś <mb@semihalf.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3077541
Reviewed-by: Wai-Hong Tam <waihong@google.com>
Reviewed-by: Keith Short <keithshort@chromium.org>
Commit-Queue: Wai-Hong Tam <waihong@google.com>
Tested-by: Wai-Hong Tam <waihong@google.com>
Diffstat (limited to 'board/lazor/board.c')
-rw-r--r-- | board/lazor/board.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/board/lazor/board.c b/board/lazor/board.c index 1e14dc420d..1118f3a845 100644 --- a/board/lazor/board.c +++ b/board/lazor/board.c @@ -413,3 +413,19 @@ static void board_chipset_resume(void) pwm_enable(PWM_CH_DISPLIGHT, 1); } DECLARE_HOOK(HOOK_CHIPSET_RESUME, board_chipset_resume, HOOK_PRIO_DEFAULT); + +__override uint32_t board_get_sku_id(void) +{ + static int sku_id = -1; + + if (sku_id == -1) { + int bits[3]; + + bits[0] = gpio_get_ternary(GPIO_SKU_ID0); + bits[1] = gpio_get_ternary(GPIO_SKU_ID1); + bits[2] = gpio_get_ternary(GPIO_SKU_ID2); + sku_id = binary_first_base3_from_bits(bits, ARRAY_SIZE(bits)); + } + + return (uint32_t)sku_id; +} |