summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorAbe Levkoy <alevkoy@chromium.org>2020-11-17 18:20:29 -0700
committerCommit Bot <commit-bot@chromium.org>2021-01-22 00:01:57 +0000
commit251827028c193eea50630ece1b22b4513e167cd2 (patch)
tree96b267fd8272fb734fe4671169472b79c7376f6d /common
parent2034650b0b3aeb6685f26334491e9f5cacbe915e (diff)
downloadchrome-ec-251827028c193eea50630ece1b22b4513e167cd2.tar.gz
TCPMv2: Support BIST Test Mode
After the first BIST Test Data packet, enable BIST Test Mode if the TCPC supports it (currently just TCPCI). While in BIST Test Mode, mask ALERT.ReceivedSOP*MessageStatus. Unmask it when the test ends, due to Hard Reset or to detach. BUG=b:173023378,b:169385081,b:172709198,b:173028832,b:173028791 BUG=b:173141941,b:173142113 TEST=Complete TDA.2.1.2.2 BMC PHY RX INT REJ on volteer without running out of Rx buffer space or watchdog timeout (still fail though) BRANCH=firmware-volteer-13521.B-master Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I03bbc4cfacceebd0334aa814e11a16e09177a322 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2545667 Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/usbc/usb_pe_drp_sm.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/common/usbc/usb_pe_drp_sm.c b/common/usbc/usb_pe_drp_sm.c
index fe2c7baec2..128a5027da 100644
--- a/common/usbc/usb_pe_drp_sm.c
+++ b/common/usbc/usb_pe_drp_sm.c
@@ -968,6 +968,9 @@ void pe_got_hard_reset(int port)
*/
pe[port].power_role = pd_get_power_role(port);
+ /* Exit BIST Test mode, in case the TCPC entered it. */
+ tcpc_set_bist_test_mode(port, false);
+
if (pe[port].power_role == PD_ROLE_SOURCE)
set_state_pe(port, PE_SRC_HARD_RESET_RECEIVED);
else
@@ -1444,6 +1447,9 @@ static void pe_handle_detach(void)
pe_set_snk_caps(port, 0, NULL);
dpm_remove_sink(port);
+
+ /* Exit BIST Test mode, in case the TCPC entered it. */
+ tcpc_set_bist_test_mode(port, false);
}
DECLARE_HOOK(HOOK_USB_PD_DISCONNECT, pe_handle_detach, HOOK_PRIO_DEFAULT);
@@ -4855,6 +4861,8 @@ static void pe_bist_tx_entry(int port)
* response to received Messages.... The test Shall be ended by
* sending Hard Reset Signaling to reset the UUT.
*/
+ if (tcpc_set_bist_test_mode(port, true) != EC_SUCCESS)
+ CPRINTS("C%d: Failed to enter BIST Test Mode", port);
pe[port].bist_cont_mode_timer = TIMER_DISABLED;
} else {
/* Ignore unsupported BIST messages. */