summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbe Levkoy <alevkoy@chromium.org>2021-02-22 16:54:23 -0700
committerCommit Bot <commit-bot@chromium.org>2021-02-23 20:44:34 +0000
commitfa57e11644c66e59c04519e51f0d800cd86bb244 (patch)
treea10affc764cdb716a1f4748db7a283d04af41709
parent1b618f480750dd437c676ae7233162df56ffcffb (diff)
downloadchrome-ec-fa57e11644c66e59c04519e51f0d800cd86bb244.tar.gz
TCPMv2: Don't check VBUS when entering BIST mode
Temporarily remove check for VBUS = vSafe5V when entering BIST mode. It does this by measuring VBUS, but this facility is inadequate to the purpose on Volteer. Since this even more of an edge case than actually running BIST tests, remove the check for now, pending a more general solution. BUG=b:180957710,b:173023378 TEST=make buildall; pass TDA.2.1.2.2 BMC PHY RX INT REJ on voxel BRANCH=firmware-volteer-13672.B-main Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I172c1bcc10731c2e405344cdc6ad2b5a1ed80ced Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2714203 Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2715850
-rw-r--r--common/usbc/usb_pe_drp_sm.c15
-rw-r--r--test/usb_pe_drp.c80
2 files changed, 0 insertions, 95 deletions
diff --git a/common/usbc/usb_pe_drp_sm.c b/common/usbc/usb_pe_drp_sm.c
index 6d2e7353fa..16cd8a825c 100644
--- a/common/usbc/usb_pe_drp_sm.c
+++ b/common/usbc/usb_pe_drp_sm.c
@@ -4905,21 +4905,6 @@ static void pe_bist_tx_entry(int port)
print_current_state(port);
- /*
- * Ignore BIST messages when not operating at vSafe5V. If charge_manager
- * isn't enabled, but PD has gotten this far, then VBUS should be at
- * vSafe5V.
- */
- if (IS_ENABLED(CONFIG_CHARGE_MANAGER)) {
- int vbus_voltage_mv = charge_manager_get_vbus_voltage(port);
-
- if (vbus_voltage_mv < PD_V_SAFE5V_MIN ||
- vbus_voltage_mv > PD_V_SAFE5V_MAX) {
- pe_set_ready_state(port);
- return;
- }
- }
-
if (mode == BIST_CARRIER_MODE_2) {
/*
* PE_BIST_Carrier_Mode embedded here.
diff --git a/test/usb_pe_drp.c b/test/usb_pe_drp.c
index 2644ded63b..55be741ad6 100644
--- a/test/usb_pe_drp.c
+++ b/test/usb_pe_drp.c
@@ -134,85 +134,6 @@ test_static int finish_src_discovery(int startup_cable_probes)
}
/*
- * Verify that the PE will ignore BIST packets when not at vSafe5V and BIST
- * packets with unsupported BIST modes.
- */
-test_static int test_bist_ignore(void)
-{
- /* Bring up port as Source/DFP. Get to ready state. */
- /* Enable PE as source, expect SOURCE_CAP. */
- mock_tc_port[PORT0].power_role = PD_ROLE_SOURCE;
- mock_tc_port[PORT0].pd_enable = 1;
- mock_tc_port[PORT0].vconn_src = true;
- TEST_EQ(mock_prl_wait_for_tx_msg(PORT0, TCPC_TX_SOP,
- 0, PD_DATA_SOURCE_CAP, 10 * MSEC),
- EC_SUCCESS, "%d");
- mock_prl_message_sent(PORT0);
- task_wait_event(10 * MSEC);
-
- /* REQUEST 5V, expect ACCEPT, PS_RDY. */
- rx_message(PD_MSG_SOP, 0, PD_DATA_REQUEST,
- PD_ROLE_SINK, PD_ROLE_UFP, RDO_FIXED(1, 500, 500, 0));
- TEST_EQ(mock_prl_wait_for_tx_msg(PORT0, TCPC_TX_SOP,
- PD_CTRL_ACCEPT, 0, 10 * MSEC),
- EC_SUCCESS, "%d");
- mock_prl_message_sent(PORT0);
- TEST_EQ(mock_prl_wait_for_tx_msg(PORT0, TCPC_TX_SOP,
- PD_CTRL_PS_RDY, 0, 35 * MSEC),
- EC_SUCCESS, "%d");
- mock_prl_message_sent(PORT0);
-
- TEST_EQ(finish_src_discovery(0), EC_SUCCESS, "%d");
-
- task_wait_event(5 * SECOND);
-
-
- /* Set VBUS to 1.5V; the PE should ignore the BIST message. */
- mock_charge_manager_set_vbus_voltage(1500);
- rx_message(PD_MSG_SOP, 0, PD_DATA_BIST, PD_ROLE_SINK, PD_ROLE_UFP,
- BDO(BDO_MODE_TEST_DATA, 0));
- /*
- * If the PE ignored the BIST message, it should respond normally to a
- * subsequent Get Source Caps request.
- */
- rx_message(PD_MSG_SOP, PD_CTRL_GET_SINK_CAP, 0, PD_ROLE_SINK,
- PD_ROLE_UFP, 0);
- TEST_EQ(mock_prl_wait_for_tx_msg(PORT0, TCPC_TX_SOP, 0,
- PD_DATA_SINK_CAP, 10 * MSEC),
- EC_SUCCESS, "%d");
- mock_prl_message_sent(PORT0);
-
- /* Set VBUS to 20V; the PE should still ignore the BIST message. */
- mock_charge_manager_set_vbus_voltage(20000);
- rx_message(PD_MSG_SOP, 0, PD_DATA_BIST, PD_ROLE_SINK, PD_ROLE_UFP,
- BDO(BDO_MODE_TEST_DATA, 0));
- task_wait_event(1 * SECOND);
- rx_message(PD_MSG_SOP, PD_CTRL_GET_SINK_CAP, 0, PD_ROLE_SINK,
- PD_ROLE_UFP, 0);
- TEST_EQ(mock_prl_wait_for_tx_msg(PORT0, TCPC_TX_SOP, 0,
- PD_DATA_SINK_CAP, 10 * MSEC),
- EC_SUCCESS, "%d");
- mock_prl_message_sent(PORT0);
-
- /*
- * Set VBUS to 5V but request an unsupported BIST mode; the PE should
- * still ignore the BIST message.
- */
- mock_charge_manager_set_vbus_voltage(5000);
- rx_message(PD_MSG_SOP, 0, PD_DATA_BIST, PD_ROLE_SINK, PD_ROLE_UFP,
- BDO(BDO_MODE_RECV, 0));
- task_wait_event(1 * SECOND);
- rx_message(PD_MSG_SOP, PD_CTRL_GET_SINK_CAP, 0, PD_ROLE_SINK,
- PD_ROLE_UFP, 0);
- TEST_EQ(mock_prl_wait_for_tx_msg(PORT0, TCPC_TX_SOP, 0,
- PD_DATA_SINK_CAP, 10 * MSEC),
- EC_SUCCESS, "%d");
- mock_prl_message_sent(PORT0);
-
- return EC_SUCCESS;
-}
-
-/*
* Verify that, before connection, PE_SRC_Send_Capabilities goes to
* PE_SRC_Discovery on send error, not PE_Send_Soft_Reset.
*/
@@ -345,7 +266,6 @@ void run_test(int argc, char **argv)
{
test_reset();
- RUN_TEST(test_bist_ignore);
RUN_TEST(test_send_caps_error_before_connected);
RUN_TEST(test_send_caps_error_when_connected);