From 41a79a40de6b668a68c20463087a124b4e11dcc1 Mon Sep 17 00:00:00 2001 From: Andrew McRae Date: Thu, 4 Jun 2020 11:21:37 +1000 Subject: Kaisa: Reset TCPC after system reset. Reset the TCPC even in RW if there has been a system reset or after power on. BUG=b:155145509 TEST=Confirm on Kaisa that type-C power replug works. BRANCH=none Change-Id: Ib9fc1298cf165aed2ee386a7f158ee73ba15eb37 Signed-off-by: Andrew McRae Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2227788 Reviewed-by: Peter Marheine Tested-by: Andrew McRae Commit-Queue: Andrew McRae --- board/puff/board.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'board/puff/board.c') diff --git a/board/puff/board.c b/board/puff/board.c index f6f6d8db8e..8a2a89ae62 100644 --- a/board/puff/board.c +++ b/board/puff/board.c @@ -474,8 +474,13 @@ const int usb_port_enable[USB_PORT_COUNT] = { /* Power Delivery and charging functions */ static void board_tcpc_init(void) { - /* Only reset TCPC if not sysjump */ - if (!system_jumped_to_this_image()) + /* + * Reset TCPC if we have had a system reset. + * With EFSv2, it is possible to be in RW without + * having reset the TCPC. + */ + if (system_get_reset_flags() & + (EC_RESET_FLAG_RESET_PIN | EC_RESET_FLAG_POWER_ON)) board_reset_pd_mcu(); /* Enable TCPC interrupts. */ gpio_enable_interrupt(GPIO_USB_C0_TCPPC_INT_ODL); @@ -500,7 +505,6 @@ int64_t get_time_dsw_pwrok(void) void board_reset_pd_mcu(void) { - /* Maybe should only reset if we are powered off barreljack */ int level = !!(tcpc_config[USB_PD_PORT_TCPC_0].flags & TCPC_FLAGS_RESET_ACTIVE_HIGH); -- cgit v1.2.1