summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbe Levkoy <alevkoy@chromium.org>2022-05-03 15:47:30 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-05-09 19:10:01 +0000
commit5cbb8b80b52abe1df380e65c1c0ad1008d7449f3 (patch)
treebc0d49c0756555f3ab7700a93097487c9a2f6cd6
parent181ad49b51a7a5468235e6a4ea32f44a41824fa1 (diff)
downloadchrome-ec-5cbb8b80b52abe1df380e65c1c0ad1008d7449f3.tar.gz
TCPMv2: Wait for VCONN discharge during Data Reset
During PE_DDR_Perform_Data_Reset, do not start tVconnReapplied until VCONN has discharged, according to the VCONN transition time configured for the board. BUG=b:209625351,b:209624473 TEST=Observe DFP-initiated Data Reset with scope on VCONN BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I8d0e59b4b873d26f179e9d4b1b3ca0f93d944b8f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3625573 Reviewed-by: Diana Z <dzigterman@chromium.org>
-rw-r--r--common/usbc/usb_pe_drp_sm.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/common/usbc/usb_pe_drp_sm.c b/common/usbc/usb_pe_drp_sm.c
index bafbbbdbad..6906c4c6f8 100644
--- a/common/usbc/usb_pe_drp_sm.c
+++ b/common/usbc/usb_pe_drp_sm.c
@@ -7607,8 +7607,14 @@ static void pe_ddr_perform_data_reset_run(int port)
if (IS_ENABLED(CONFIG_USBC_VCONN) && !tc_is_vconn_src(port) &&
PE_CHK_FLAG(port, PE_FLAGS_VCONN_SWAP_COMPLETE)) {
PE_CLR_FLAG(port, PE_FLAGS_VCONN_SWAP_COMPLETE);
+ /* Wait until VCONN has discharged to start tVconnReapplied. */
+ pd_timer_enable(port, PE_TIMER_TIMEOUT,
+ CONFIG_USBC_VCONN_SWAP_DELAY_US);
+ } else if (IS_ENABLED(CONFIG_USBC_VCONN) &&
+ pd_timer_is_expired(port, PE_TIMER_TIMEOUT)) {
+ pd_timer_disable(port, PE_TIMER_TIMEOUT);
pd_timer_enable(port, PE_TIMER_VCONN_REAPPLIED,
- PD_T_VCONN_REAPPLIED);
+ PD_T_VCONN_REAPPLIED);
} else if (IS_ENABLED(CONFIG_USBC_VCONN) &&
pd_timer_is_expired(port, PE_TIMER_VCONN_REAPPLIED)) {
pd_request_vconn_swap_on(port);
@@ -7616,9 +7622,9 @@ static void pe_ddr_perform_data_reset_run(int port)
/*
* 4) After tDataReset the DFP shall:
- * a) Reconnect the [USB 2.0] D+/D- signals
- * b) If the Port was operating in [USB 3.2] or [USB4]
- * reapply the port’s Rx Terminations
+ * a) Reconnect the USB 2.0 D+/D- signals.
+ * b) If the Port was operating in USB 3.2 or USB4 reapply
+ * the port’s Rx Terminations.
* TODO: Section 6.3.14 implies that tDataReset is a minimum
* time for the DFP to leave the lines disconnected during Data
* Reset, possibly starting after the cable reset. Section