summaryrefslogtreecommitdiff
path: root/include/usb_pd.h
diff options
context:
space:
mode:
authorDenis Brockus <dbrockus@google.com>2021-01-20 09:33:37 -0700
committerCommit Bot <commit-bot@chromium.org>2021-01-20 21:44:21 +0000
commit2eae769ad34ceaae5ce770beae546724801f4ef8 (patch)
treea4c8aa21333160576a10703c43175691febde440 /include/usb_pd.h
parent5fef5654ceb57364872ab5352eaff6a7f5cae91e (diff)
downloadchrome-ec-2eae769ad34ceaae5ce770beae546724801f4ef8.tar.gz
TCPMv2: TCPMv2 Send message with timed response should hard reset within range
PE_SRC_Send_Capabilities is supposed to wait for 24ms before sending HardReset but that reset must be sent before 30ms. Setting the delay to 30ms will guarantee we never are within this range and will always be after it. TD.PD.SRC.E5 is guaranteed to fail with this set to 30ms BUG=b:177999668 BRANCH=zork TEST=make run-usb_tcpmv2_compliance Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: I8d743680b62e5dea840c935f06eb987c8358e473 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2640228 Tested-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Diana Z <dzigterman@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org>
Diffstat (limited to 'include/usb_pd.h')
-rw-r--r--include/usb_pd.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/usb_pd.h b/include/usb_pd.h
index 071e61386c..cee449860c 100644
--- a/include/usb_pd.h
+++ b/include/usb_pd.h
@@ -187,7 +187,21 @@ enum pd_rx_errors {
#define PD_T_SINK_WAIT_CAP (600*MSEC) /* between 310ms and 620ms */
#define PD_T_SINK_TRANSITION (35*MSEC) /* between 20ms and 35ms */
#define PD_T_SOURCE_ACTIVITY (45*MSEC) /* between 40ms and 50ms */
+/*
+ * Adjusting for TCPMv2 PD2 Compliance. In tests like TD.PD.SRC.E5 this
+ * value is the duration before the Hard Reset can be sent. Setting the
+ * timer value to the maximum will delay sending the HardReset until
+ * after the window has closed instead of when it is desired at the
+ * beginning of the window.
+ * Leaving TCPMv1 as it was as there are no current requests to adjust
+ * for compliance on the old stack and making this change breaks the
+ * usb_pd unit test.
+ */
+#ifndef CONFIG_USB_PD_TCPMV2
#define PD_T_SENDER_RESPONSE (30*MSEC) /* between 24ms and 30ms */
+#else
+#define PD_T_SENDER_RESPONSE (24*MSEC) /* between 24ms and 30ms */
+#endif
#define PD_T_PS_TRANSITION (500*MSEC) /* between 450ms and 550ms */
#define PD_T_PS_SOURCE_ON (480*MSEC) /* between 390ms and 480ms */
#define PD_T_PS_SOURCE_OFF (920*MSEC) /* between 750ms and 920ms */