summaryrefslogtreecommitdiff
path: root/board/eve/board.h
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@google.com>2017-07-28 17:13:26 -0700
committerCommit Bot <commit-bot@chromium.org>2020-08-31 01:53:09 +0000
commitbd018841f6f2856c949dcf9b6dd462872cd18d7f (patch)
tree245d6874e54040b49d7cd3e166528f3939b513e9 /board/eve/board.h
parentbd67306369e6141fefaf8d8a6ea814a03d02f88d (diff)
downloadchrome-ec-bd018841f6f2856c949dcf9b6dd462872cd18d7f.tar.gz
eve: Move board level TCPC init to happen in pd_task init
When the board level TCPC run as an init hook it will frequently lead to an EC reset when we are trying to recovery a disconnected battery, potentially even a reboot loop with the most unlucky timing. If we instead call it from the pd_task before tcpc_init is called then the board init hook can stall the pd_task init until the battery is out of disconnect mode, or giving up after 2 seconds in case the battery never seems to recover. This accomplishes two goals: ensure the PD chips are not reset until the battery is out of disconnect and delay start of the pd_task (and PD negotiation) until the battery is out of disconnect state. With this change I never see an EC reset when recovering from a disconnected battery state. BUG=b:63957122 BRANCH=eve TEST=manual testing on Eve with 50+ battery disconnect and battery cutoff cycles to ensure it never triggers an unexpected EC reset. Change-Id: Ie1604e82916ea203a32cbdde98f6697e344bba4c Signed-off-by: Duncan Laurie <dlaurie@google.com> Reviewed-on: https://chromium-review.googlesource.com/592716 Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2320248 Commit-Queue: Patryk Duda <pdk@semihalf.com> Tested-by: Patryk Duda <pdk@semihalf.com> Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'board/eve/board.h')
-rw-r--r--board/eve/board.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/board/eve/board.h b/board/eve/board.h
index 086ada0de7..8a9a9f2faa 100644
--- a/board/eve/board.h
+++ b/board/eve/board.h
@@ -163,6 +163,7 @@
#define CONFIG_USB_PD_MAX_SINGLE_SOURCE_CURRENT TYPEC_RP_3A0
#define CONFIG_USB_PD_PORT_MAX_COUNT 2
#define CONFIG_USB_PD_VBUS_DETECT_CHARGER
+#define CONFIG_USB_PD_TCPC_BOARD_INIT
#define CONFIG_USB_PD_TCPC_LOW_POWER
#define CONFIG_USB_PD_TCPM_MUX
#define CONFIG_USB_PD_TCPM_ANX3429
@@ -286,6 +287,7 @@ enum adc_channel {
int board_get_version(void);
void board_reset_pd_mcu(void);
void board_set_tcpc_power_mode(int port, int mode);
+void board_tcpc_init(void);
void led_register_double_tap(void);
void board_update_ac_status(void);