diff options
author | Devin Lu <Devin.Lu@quantatw.com> | 2021-12-10 10:40:08 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-12-24 02:39:58 +0000 |
commit | ab05ff627f299fa0315c48d21a7b94d4839c01e7 (patch) | |
tree | c0fa8c88509255d447860b831bb37e1757d65a6c | |
parent | 5e6399a05ad1af6ef0a96ce52b1d65ab44f6d8b2 (diff) | |
download | chrome-ec-ab05ff627f299fa0315c48d21a7b94d4839c01e7.tar.gz |
vell: Always initialize ioex data structures after sysjump
[Cherry-pick from: https://crrev.com/c/3299277]
BUG=none
BRANCH=none
TEST=1. make BOARD=vell
2. On console, ioexget to make sure gpio pins on ioex initialized
after sysjump.
Signed-off-by: Devin Lu <Devin.Lu@quantatw.com>
Change-Id: I95cc808ab218ebc424db397cfda50c5a03f35f50
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3329185
Reviewed-by: Boris Mittelberg <bmbm@google.com>
Reviewed-by: caveh jalali <caveh@chromium.org>
-rw-r--r-- | board/vell/usbc_config.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/board/vell/usbc_config.c b/board/vell/usbc_config.c index 5021a7fb96..6a81f04bb5 100644 --- a/board/vell/usbc_config.c +++ b/board/vell/usbc_config.c @@ -320,27 +320,21 @@ void board_reset_pd_mcu(void) msleep(50); } -static void enable_ioex(int ioex) -{ - ioex_init(ioex); -} - static void board_tcpc_init(void) { + int i; + /* Don't reset TCPCs after initial reset */ - if (!system_jumped_late()) { + if (!system_jumped_late()) board_reset_pd_mcu(); - /* - * These IO expander pins are implemented using the - * C0/C1/C2/C3 TCPCs, so they must be set up after the TCPC - * has been taken out of reset. - */ - enable_ioex(IOEX_C0_NCT38XX); - enable_ioex(IOEX_C1_NCT38XX); - enable_ioex(IOEX_C2_NCT38XX); - enable_ioex(IOEX_C3_NCT38XX); - } + /* + * These IO expander pins are implemented using the + * C0/C1/C2/C3 TCPCs, so they must be set up after the TCPC + * has been taken out of reset. + */ + for (i = 0; i < CONFIG_IO_EXPANDER_PORT_COUNT; ++i) + ioex_init(i); /* Enable PPC interrupts. */ gpio_enable_interrupt(GPIO_USB_C0_PPC_INT_ODL); |