summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2020-08-10 12:04:27 -0600
committerCommit Bot <commit-bot@chromium.org>2020-08-10 22:40:09 +0000
commitcd8110cefeb725c6c6d38c8888df6a47b7d13124 (patch)
tree5cec6026b93c5ebc607a19ca03c6783ca30c0eab /common
parenta842ef086796d5a36e279b06dd648f120d5a5873 (diff)
downloadchrome-ec-cd8110cefeb725c6c6d38c8888df6a47b7d13124.tar.gz
TCPMv2: Downgrade cable to PD 2.0 halfway through discovery attempts
Since some PD 2.0 cables will GoodCRC PD 3.0 requests without replying, also assume there may be some PD 2.0 cables which may not GoodCRC PD 3.0 requests at all. Downgrade the cable revision to PD 2.0 halfway through the allowed number of discovery attempts. BRANCH=None BUG=b:154653135 TEST=on drawlat, verify cable discovery attempts with HooToo downgrade to PD 2.0 halfway through Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ifc9128d1b8cef03235cfe7662e1f016d15f7878e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2346593 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/usbc/usb_pe_drp_sm.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/common/usbc/usb_pe_drp_sm.c b/common/usbc/usb_pe_drp_sm.c
index 1035df9d90..fbe12f2e4c 100644
--- a/common/usbc/usb_pe_drp_sm.c
+++ b/common/usbc/usb_pe_drp_sm.c
@@ -4494,9 +4494,26 @@ static void pe_vdm_identity_request_cbl_exit(int port)
prl_set_rev(port, TCPC_TX_SOP_PRIME, PD_REV20);
}
+ /*
+ * 6.6.15 DiscoverIdentityTimer
+ *
+ * No more than nDiscoverIdentityCount Discover Identity Messages
+ * without a GoodCRC Message response Shall be sent. If no GoodCRC
+ * Message response is received after nDiscoverIdentityCount Discover
+ * Identity Command requests have been sent by a Port, the Port Shall
+ * Not send any further SOP’/SOP’’ Messages.
+ */
if (pe[port].discover_identity_counter >= N_DISCOVER_IDENTITY_COUNT)
pd_set_identity_discovery(port, pe[port].tx_type,
PD_DISC_FAIL);
+ else if (pe[port].discover_identity_counter ==
+ (N_DISCOVER_IDENTITY_COUNT / 2))
+ /*
+ * Downgrade to PD 2.0 if the partner hasn't replied halfway
+ * through discovery as well, in case the cable is
+ * non-compliant about GoodCRC-ing higher revisions
+ */
+ prl_set_rev(port, TCPC_TX_SOP_PRIME, PD_REV20);
/*
* Set discover identity timer unless BUSY case already did so