From 6de382f0b11005d741c01c38b807635e5f5c7768 Mon Sep 17 00:00:00 2001 From: Devin Lu Date: Thu, 25 Nov 2021 17:41:03 +0800 Subject: anahera: Always initialize ioex data structures after sysjump [Cherry-pick from: https://crrev.com/c/3299277] BUG=none BRANCH=none TEST=1. make BOARD=anahera 2. On console, ioexget to make sure gpio pins on ioex initialized after sysjump. Signed-off-by: Devin Lu Change-Id: I70908409301684cafd9d6409e4f2e1d370abe2b6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3302225 Reviewed-by: Boris Mittelberg Commit-Queue: Boris Mittelberg --- board/anahera/usbc_config.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/board/anahera/usbc_config.c b/board/anahera/usbc_config.c index 00b6589a46..aae3a4493b 100644 --- a/board/anahera/usbc_config.c +++ b/board/anahera/usbc_config.c @@ -208,12 +208,16 @@ 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(); - for (i = 0; i < CONFIG_IO_EXPANDER_PORT_COUNT; ++i) - ioex_init(i); - } + /* + * These IO expander pins are implemented using the + * C0/C1 TCPCs, so they must be set up after the TCPCs 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); -- cgit v1.2.1