diff options
author | Abe Levkoy <alevkoy@chromium.org> | 2020-12-23 12:08:14 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-01-06 22:22:35 +0000 |
commit | 3bbe4b51f61c03ee8e4d397fcf0e6137514d532d (patch) | |
tree | 03a19ae842d5915595e66e9878f0c3357d72a7cd | |
parent | 81341cc6e21b5086c75e975e45fb5c3a83673dbd (diff) | |
download | chrome-ec-3bbe4b51f61c03ee8e4d397fcf0e6137514d532d.tar.gz |
TCPMv2: Remove PE_BIST_RX state
Nothing uses this, and anyway, the EC doesn't have the means to evaluate
the results of a BIST Carrier Mode test that it initiates.
BUG=none
TEST=make buildall
BRANCH=none
Signed-off-by: Abe Levkoy <alevkoy@chromium.org>
Change-Id: I8aa0d97c81422689de4ca165cb2c0c34c324f6a2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2602719
Reviewed-by: Diana Z <dzigterman@chromium.org>
-rw-r--r-- | common/usbc/usb_pe_drp_sm.c | 41 | ||||
-rw-r--r-- | include/usb_pd.h | 21 | ||||
-rw-r--r-- | test/usb_pe.h | 1 |
3 files changed, 10 insertions, 53 deletions
diff --git a/common/usbc/usb_pe_drp_sm.c b/common/usbc/usb_pe_drp_sm.c index 8e2ff806e6..0671cde87b 100644 --- a/common/usbc/usb_pe_drp_sm.c +++ b/common/usbc/usb_pe_drp_sm.c @@ -306,7 +306,6 @@ enum usb_pe_state { PE_HANDLE_CUSTOM_VDM_REQUEST, PE_WAIT_FOR_ERROR_RECOVERY, PE_BIST_TX, - PE_BIST_RX, PE_DEU_SEND_ENTER_USB, PE_DR_GET_SINK_CAP, PE_DR_SNK_GIVE_SOURCE_CAP, @@ -425,7 +424,6 @@ __maybe_unused static const char * const pe_state_names[] = { [PE_HANDLE_CUSTOM_VDM_REQUEST] = "PE_Handle_Custom_Vdm_Request", [PE_WAIT_FOR_ERROR_RECOVERY] = "PE_Wait_For_Error_Recovery", [PE_BIST_TX] = "PE_Bist_TX", - [PE_BIST_RX] = "PE_Bist_RX", [PE_DEU_SEND_ENTER_USB] = "PE_DEU_Send_Enter_USB", [PE_DR_GET_SINK_CAP] = "PE_DR_Get_Sink_Cap", [PE_DR_SNK_GIVE_SOURCE_CAP] = "PE_DR_SNK_Give_Source_Cap", @@ -1464,11 +1462,6 @@ static bool common_src_snk_dpm_requests(int port) set_state_pe(port, PE_VCS_SEND_SWAP); return true; } else if (PE_CHK_DPM_REQUEST(port, - DPM_REQUEST_BIST_RX)) { - pe_set_dpm_curr_request(port, DPM_REQUEST_BIST_RX); - set_state_pe(port, PE_BIST_RX); - return true; - } else if (PE_CHK_DPM_REQUEST(port, DPM_REQUEST_BIST_TX)) { pe_set_dpm_curr_request(port, DPM_REQUEST_BIST_TX); set_state_pe(port, PE_BIST_TX); @@ -4769,36 +4762,6 @@ static void pe_bist_tx_run(int port) } /** - * BIST RX - */ -static void pe_bist_rx_entry(int port) -{ - /* currently only support bist carrier 2 */ - uint32_t bdo = BDO(BDO_MODE_CARRIER2, 0); - - print_current_state(port); - - tx_emsg[port].len = sizeof(bdo); - memcpy(tx_emsg[port].buf, (uint8_t *)&bdo, tx_emsg[port].len); - send_data_msg(port, TCPC_TX_SOP, PD_DATA_BIST); - - /* Delay at least enough for partner to finish BIST */ - pe[port].bist_cont_mode_timer = - get_time().val + PD_T_BIST_RECEIVE; -} - -static void pe_bist_rx_run(int port) -{ - if (get_time().val < pe[port].bist_cont_mode_timer) - return; - - if (pe[port].power_role == PD_ROLE_SOURCE) - set_state_pe(port, PE_SRC_TRANSITION_TO_DEFAULT); - else - set_state_pe(port, PE_SNK_TRANSITION_TO_DEFAULT); -} - -/** * Give_Sink_Cap Message */ static void pe_snk_give_sink_cap_entry(int port) @@ -6822,10 +6785,6 @@ static const struct usb_state pe_states[] = { .entry = pe_bist_tx_entry, .run = pe_bist_tx_run, }, - [PE_BIST_RX] = { - .entry = pe_bist_rx_entry, - .run = pe_bist_rx_run, - }, [PE_DR_GET_SINK_CAP] = { .entry = pe_dr_get_sink_cap_entry, .run = pe_dr_get_sink_cap_run, diff --git a/include/usb_pd.h b/include/usb_pd.h index 8222a93e4d..bcde9fabef 100644 --- a/include/usb_pd.h +++ b/include/usb_pd.h @@ -966,17 +966,16 @@ enum pd_dpm_request { DPM_REQUEST_SOURCE_CAP = BIT(7), DPM_REQUEST_NEW_POWER_LEVEL = BIT(8), DPM_REQUEST_VDM = BIT(9), - DPM_REQUEST_BIST_RX = BIT(10), - DPM_REQUEST_BIST_TX = BIT(11), - DPM_REQUEST_SNK_STARTUP = BIT(12), - DPM_REQUEST_SRC_STARTUP = BIT(13), - DPM_REQUEST_HARD_RESET_SEND = BIT(14), - DPM_REQUEST_SOFT_RESET_SEND = BIT(15), - DPM_REQUEST_PORT_DISCOVERY = BIT(16), - DPM_REQUEST_SEND_ALERT = BIT(17), - DPM_REQUEST_ENTER_USB = BIT(18), - DPM_REQUEST_GET_SRC_CAPS = BIT(19), - DPM_REQUEST_EXIT_MODES = BIT(20), + DPM_REQUEST_BIST_TX = BIT(10), + DPM_REQUEST_SNK_STARTUP = BIT(11), + DPM_REQUEST_SRC_STARTUP = BIT(12), + DPM_REQUEST_HARD_RESET_SEND = BIT(13), + DPM_REQUEST_SOFT_RESET_SEND = BIT(14), + DPM_REQUEST_PORT_DISCOVERY = BIT(15), + DPM_REQUEST_SEND_ALERT = BIT(16), + DPM_REQUEST_ENTER_USB = BIT(17), + DPM_REQUEST_GET_SRC_CAPS = BIT(18), + DPM_REQUEST_EXIT_MODES = BIT(19), }; /** diff --git a/test/usb_pe.h b/test/usb_pe.h index 8c1177f1f3..373bf9f5b2 100644 --- a/test/usb_pe.h +++ b/test/usb_pe.h @@ -129,7 +129,6 @@ enum usb_pe_state { PE_HANDLE_CUSTOM_VDM_REQUEST, PE_WAIT_FOR_ERROR_RECOVERY, PE_BIST_TX, - PE_BIST_RX, PE_DEU_SEND_ENTER_USB, PE_DR_SNK_GET_SINK_CAP, PE_DR_SNK_GIVE_SOURCE_CAP, |