diff options
author | Diana Z <dzigterman@chromium.org> | 2021-07-08 16:18:41 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-07-12 18:08:41 +0000 |
commit | e912085070cd8bff49ae3b3bb3cd7ce3b274caa9 (patch) | |
tree | 2c7b5335d76e91c6770adc9e5fcc221870917582 | |
parent | b86dfea40060ba8e5037ba5cb3ea971b28ec541c (diff) | |
download | chrome-ec-e912085070cd8bff49ae3b3bb3cd7ce3b274caa9.tar.gz |
TCPMv2: Gate requesting sink capabilities on related features
There are a number of features that may cause a board to need sink
capabilities (3.0 A port balancing, FRS, or AP host commands). However,
other boards may not need these and the added traffic can increase the
liklihood of collisions on PD 2.0 connections.
BRANCH=None
BUG=b:192051705
TEST=connect honeybuns to TCPMv1 DUT and verify DP alternate mode can be
reliably entered
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: I70e2f360a9a45eee85ed555cb0165937c01a661a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3016407
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
-rw-r--r-- | common/usbc/usb_pe_drp_sm.c | 16 | ||||
-rw-r--r-- | test/test_config.h | 2 | ||||
-rw-r--r-- | test/usb_pe_drp.c | 13 |
3 files changed, 14 insertions, 17 deletions
diff --git a/common/usbc/usb_pe_drp_sm.c b/common/usbc/usb_pe_drp_sm.c index 7661e8b2ec..0230e0bbb2 100644 --- a/common/usbc/usb_pe_drp_sm.c +++ b/common/usbc/usb_pe_drp_sm.c @@ -2153,8 +2153,11 @@ static void pe_src_startup_entry(int port) /* Reset VCONN swap counter */ pe[port].vconn_swap_counter = 0; - /* Request partner sink caps */ - pd_dpm_request(port, DPM_REQUEST_GET_SNK_CAPS); + /* Request partner sink caps if a feature requires them */ + if (IS_ENABLED(CONFIG_USB_PD_HOST_CMD) || + CONFIG_USB_PD_3A_PORTS > 0 || + IS_ENABLED(CONFIG_USB_PD_FRS)) + pd_dpm_request(port, DPM_REQUEST_GET_SNK_CAPS); } } @@ -3005,13 +3008,18 @@ static void pe_snk_startup_entry(int port) PE_SET_FLAG(port, PE_FLAGS_VCONN_SWAP_TO_ON); } - /* Request sink caps for FRS and PRS evaluation. + /* + * Request sink caps for FRS, output power consideration, or reporting + * to the AP through host commands. * * On entry to the PE_SNK_Ready state if the Sink supports Fast Role * Swap, then the Policy Engine Shall do the following: * - Send a Get_Sink_Cap Message */ - pd_dpm_request(port, DPM_REQUEST_GET_SNK_CAPS); + if (IS_ENABLED(CONFIG_USB_PD_HOST_CMD) || + CONFIG_USB_PD_3A_PORTS > 0 || + IS_ENABLED(CONFIG_USB_PD_FRS)) + pd_dpm_request(port, DPM_REQUEST_GET_SNK_CAPS); } diff --git a/test/test_config.h b/test/test_config.h index d06db8252e..9e74a8646b 100644 --- a/test/test_config.h +++ b/test/test_config.h @@ -404,6 +404,7 @@ int ncp15wb_calculate_temp(uint16_t adc); #undef CONFIG_USB_PD_HOST_CMD #define CONFIG_USB_PD_ALT_MODE_DFP #define CONFIG_USBC_SS_MUX +#define CONFIG_USB_PD_3A_PORTS 0 /* Host does not define a 3.0 A PDO */ #endif #if defined(TEST_USB_PE_DRP) || defined(TEST_USB_PE_DRP_NOEXTENDED) @@ -429,6 +430,7 @@ int ncp15wb_calculate_temp(uint16_t adc); #define CONFIG_USBC_SS_MUX #define I2C_PORT_HOST_TCPC 0 #define CONFIG_CHARGE_MANAGER +#define CONFIG_USB_PD_3A_PORTS 0 /* Host does not define a 3.0 A PDO */ #endif /* TEST_USB_PE_DRP || TEST_USB_PE_DRP_NOEXTENDED */ /* Common TypeC tests defines */ diff --git a/test/usb_pe_drp.c b/test/usb_pe_drp.c index da204f3610..086e2263a5 100644 --- a/test/usb_pe_drp.c +++ b/test/usb_pe_drp.c @@ -97,19 +97,6 @@ test_static int finish_src_discovery(int startup_cable_probes) PD_ROLE_SINK, PD_ROLE_UFP, 0); /* - * Expect GET_SINK_CAP, reply with a simple Sink Cap since sink partners - * must support this message. - */ - TEST_EQ(mock_prl_wait_for_tx_msg(PORT0, TCPC_TX_SOP, - PD_CTRL_GET_SINK_CAP, 0, 10 * MSEC), - EC_SUCCESS, "%d"); - mock_prl_message_sent(PORT0); - task_wait_event(10 * MSEC); - rx_message(PD_MSG_SOP, 0, PD_DATA_SINK_CAP, - PD_ROLE_SINK, PD_ROLE_UFP, - PDO_FIXED(5000, 500, PDO_FIXED_COMM_CAP)); - - /* * Cable identity discovery is attempted 6 times total. 1 was done * above, so expect 5 more now. */ |