summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorScott Collyer <scollyer@google.com>2021-03-10 21:43:46 -0800
committerCommit Bot <commit-bot@chromium.org>2021-03-12 17:55:59 +0000
commit42051e03688e24b0a3550306f15c66edc2313f32 (patch)
tree30588d66a548c064afd8cd26acb44641aee8bbec /common
parent3eeaf9c10014218f84bf5f797eb6f5d78a419f3e (diff)
downloadchrome-ec-42051e03688e24b0a3550306f15c66edc2313f32.tar.gz
TCPMv2: Add support for disabling type-2 BIST mode
This CL adds a TCPCI method to disable BIST mode for the case where the TCPC does not handle the duration automatically. This is required for the ucpd driver as once type-2 BIST mode is started, the ucpd peripheral needs to be reset to stop. This CL also reduces the timer value from 60 msec to 55 msec to ensure that there is enough time for BIST to be stopped and still be in spec. BUG=b:182436876 BRANCH=None TEST=verifed on Quiche that when type-2 BIST is started then it stops when the timer in PE expires. This fixes TDA.2.1.1.1: BMC-PHY-TX-EYE Signed-off-by: Scott Collyer <scollyer@google.com> Change-Id: I59ee7ac0dead09ac3a1b5783cfa3fe9db238eb7e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2660803 Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Scott Collyer <scollyer@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/usbc/usb_pe_drp_sm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/common/usbc/usb_pe_drp_sm.c b/common/usbc/usb_pe_drp_sm.c
index 985a9ea531..b87c947c7d 100644
--- a/common/usbc/usb_pe_drp_sm.c
+++ b/common/usbc/usb_pe_drp_sm.c
@@ -4926,6 +4926,12 @@ static void pe_bist_tx_entry(int port)
static void pe_bist_tx_run(int port)
{
if (pd_timer_is_expired(port, PE_TIMER_BIST_CONT_MODE)) {
+ /*
+ * Entry point to disable BIST in TCPC if that's not already
+ * handled automatically by the TCPC. Unless this method is
+ * implemented in a TCPM driver, this function does nothing.
+ */
+ tcpm_reset_bist_type_2(port);
if (pe[port].power_role == PD_ROLE_SOURCE)
set_state_pe(port, PE_SRC_TRANSITION_TO_DEFAULT);