summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorWai-Hong Tam <waihong@google.com>2020-03-13 22:02:22 -0700
committerCommit Bot <commit-bot@chromium.org>2020-03-24 19:27:56 +0000
commit2b86994b8368c36a54d32f36984b2ae9a2997295 (patch)
tree4e0f38dd6ada8349b23b0df9b6a6530356c3d74d /test
parent0252cc3de4092702043b367ace18dfc97f3327aa (diff)
downloadchrome-ec-2b86994b8368c36a54d32f36984b2ae9a2997295.tar.gz
TCPMv2: Not enable PD comm on TX Phy reset if not in a connected state
If PD is not in a connected state, the previous approach was to enable PD comm on TX Phy reset and then disable it later (the SM_RUN case in prl_run()). In this short period of time, the TCPC wil respond GoodCRC to the PD message and the PD partner will go forward to the next state that messes up its state machine and causes an unexpected hard reset. We should not enable PD comm if not in a connected state. BRANCH=None BUG=b:151159750 TEST=Tested on Trogdor, with extra patches to fix the DP discovery and separate the Tx and Rx buffers. Unplugged battery and plugged a 20V charger and verified it boot fine, no reboot loop. TEST=Built chocodile_vpdmcu image successfully. TEST=make runtests -j Change-Id: Ic819787f1ec0085abdded3bab8ecbcb813495408 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2107882 Reviewed-by: Sam Hurst <shurst@google.com>
Diffstat (limited to 'test')
-rw-r--r--test/fake_usbc.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/test/fake_usbc.c b/test/fake_usbc.c
index c9163f1cfe..bbc565a14d 100644
--- a/test/fake_usbc.c
+++ b/test/fake_usbc.c
@@ -178,12 +178,20 @@ uint8_t pd_get_src_cap_cnt(int port)
}
#endif
-#ifndef CONFIG_USB_TYPEC_DRP_ACC_TRYSRC
+#if !defined(CONFIG_USB_TYPEC_DRP_ACC_TRYSRC) && \
+ !defined(CONFIG_USB_TYPEC_CTVPD)
+int pd_is_connected(int port)
+{
+ return true;
+}
+
bool pd_is_disconnected(int port)
{
return false;
}
+#endif /* !CONFIG_USB_TYPEC_DRP_ACC_TRYSRC && !CONFIG_USB_TYPEC_CTVPD */
+#ifndef CONFIG_USB_TYPEC_DRP_ACC_TRYSRC
void pd_set_dual_role(int port, enum pd_dual_role_states state)
{
}
@@ -213,11 +221,6 @@ enum pd_cc_states pd_get_task_cc_state(int port)
return PD_CC_NONE;
}
-int pd_is_connected(int port)
-{
- return true;
-}
-
bool pd_get_partner_unconstr_power(int port)
{
return 0;