summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAbe Levkoy <alevkoy@chromium.org>2020-12-07 15:42:04 -0700
committerCommit Bot <commit-bot@chromium.org>2020-12-15 15:39:20 +0000
commit4c6709899bc811fa9c07f04f4bb826d7025f19c2 (patch)
treefd0882990c07a54ee4521ef13fbcb6f79863f56b /test
parent0a561def48d4e673c834f4d01506ba8b9886cdd4 (diff)
downloadchrome-ec-4c6709899bc811fa9c07f04f4bb826d7025f19c2.tar.gz
tcpci: Base retry count on active PD rev
Retry twice when operating at PD 3.0 and thrice when operating at PD 2.0. Provide a TCPM-agnostic interface to get the number of retries. BUG=b:173025773,b:173025737 TEST=Pass TD.PD.LL.E3 Soft Reset Usage and TD.PD.LL.E4 Hard Reset Usage BRANCH=firmware-volteer-13521.B-master Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I422447718f1bfc9a9d4f8ffc5b284723a5332833 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2578201 Commit-Queue: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Diffstat (limited to 'test')
-rw-r--r--test/fake_usbc.c5
-rw-r--r--test/test_config.h2
2 files changed, 7 insertions, 0 deletions
diff --git a/test/fake_usbc.c b/test/fake_usbc.c
index dc513b5be9..3f84f26219 100644
--- a/test/fake_usbc.c
+++ b/test/fake_usbc.c
@@ -56,6 +56,11 @@ __overridable enum pd_cable_plug tc_get_cable_plug(int port)
return PD_PLUG_FROM_DFP_UFP;
}
+__overridable int pd_get_rev(int port, enum tcpm_transmit_type type)
+{
+ return IS_ENABLED(CONFIG_USB_PD_REV30) ? PD_REV30 : PD_REV20;
+}
+
int tc_check_vconn_swap(int port)
{
return 0;
diff --git a/test/test_config.h b/test/test_config.h
index 4e9024f6c1..00dbcab5c9 100644
--- a/test/test_config.h
+++ b/test/test_config.h
@@ -477,6 +477,8 @@ int ncp15wb_calculate_temp(uint16_t adc);
#define CONFIG_USB_PD_DUAL_ROLE
#define CONFIG_USB_PD_DUAL_ROLE_AUTO_TOGGLE
#define CONFIG_USB_PD_REV30
+#undef CONFIG_PD_RETRY_COUNT
+#define CONFIG_PD_RETRY_COUNT 2
#define CONFIG_USB_PD_TCPC_LOW_POWER
#define CONFIG_USB_PD_TRY_SRC
#define CONFIG_USB_PD_TCPMV2