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 01:36:53 +0000
commitb3c8abc9a71a516f6aad5759b83bfadd131c2b07 (patch)
tree8ad38261d802cb790778330132718472d8cd64dc
parente193be9c9b02c97cb303605eb473d7a3a4ba7a65 (diff)
downloadchrome-ec-b3c8abc9a71a516f6aad5759b83bfadd131c2b07.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>
-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 2c3d442dfb..3c17a17d4d 100644
--- a/common/usbc/usb_pe_drp_sm.c
+++ b/common/usbc/usb_pe_drp_sm.c
@@ -4898,21 +4898,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);