summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorli feng <li1.feng@intel.com>2021-08-30 20:19:38 -0700
committerCommit Bot <commit-bot@chromium.org>2021-09-07 23:10:20 +0000
commit13c8b5688f6cb501ce04bcf10e3f4ddca66b2b63 (patch)
tree213abba37a2fedf46c1cd635bee94b339eef75c4
parent1fba781b9f6d17dbab70227c4b90c268d6fe7af7 (diff)
downloadchrome-ec-13c8b5688f6cb501ce04bcf10e3f4ddca66b2b63.tar.gz
TCPMV2: check if vconn swap is allowed
Connect TBT/USB4 device to PD port in G3 state, port discovery requests to be vconn source even the PP5000_A rail is turned off in G3, as a result system won't be able to source vconn and cable discovery fails. Port discovery should check if sourcing vconn is possible at board level before it requests swap vconn so to prevent this failure. BUG=b:198226223 BRANCH=none TEST=Boot up ADL RVP, put system in G3 by "shutdown -h now", plug in Gatkex board to port 0, confirmed EC does not request vconn swap in G3 if 5V is not available. Wake up system by "powerbtn" on EC console, cable discovery is successful. Signed-off-by: li feng <li1.feng@intel.com> Change-Id: Ic94c21dbfe0c910b6c9826302b8658eeeff44b72 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3131408 Reviewed-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
-rw-r--r--common/usbc/usbc_pd_policy.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/common/usbc/usbc_pd_policy.c b/common/usbc/usbc_pd_policy.c
index 2170734d6a..6a06d4014f 100644
--- a/common/usbc/usbc_pd_policy.c
+++ b/common/usbc/usbc_pd_policy.c
@@ -32,14 +32,15 @@ __overridable bool port_discovery_dr_swap_policy(int port,
/*
* Default Port Discovery VCONN Swap Policy.
*
- * 1) If vconn_swap_to_on_flag == true and vconn is currently off,
- * transition to pe_vcs_send_swap
+ * 1) If vconn_swap_to_on_flag == true, and vconn is currently off,
+ * 2) Sourcing VCONN is possible
+ * then transition to pe_vcs_send_swap
*/
__overridable bool port_discovery_vconn_swap_policy(int port,
bool vconn_swap_flag)
{
if (IS_ENABLED(CONFIG_USBC_VCONN) && vconn_swap_flag &&
- !tc_is_vconn_src(port))
+ !tc_is_vconn_src(port) && tc_check_vconn_swap(port))
return true;
/* Do not perform a VCONN swap */