summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Herrmann <eherrmann@chromium.org>2021-02-25 13:45:53 -0800
committerCommit Bot <commit-bot@chromium.org>2021-02-26 02:25:27 +0000
commit24f065a6b741805b7f97ce4095a7b871c0501854 (patch)
treec1340d2e173d107d69cf35ece3271f6f8008f158
parent118fa0ff5a6361066b213522798697ab399c1e84 (diff)
downloadchrome-ec-24f065a6b741805b7f97ce4095a7b871c0501854.tar.gz
TCPMv1/v2: Add config option to disable TCPC VCONN
Currently we always source VCONN from the TCPC, and also the PPC if present. However the SYV682 can't handle 5V on its host-side CC pins, so we shouldn't source VCONN in that case. For those TCPCs which will trigger OVP if VCONN isn't enabled, this will not happen with the SYV682, since it isolates VCONN from the TCPC CC signals. BUG=b:180973460 TEST=On delbin, make sure the host-side CC pins are <3.3V when sourcing VCONN BRANCH=None Signed-off-by: Eric Herrmann <eherrmann@chromium.org> Change-Id: I8929a44fc23f93c44559229f1b0d024fd7fbc7db Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2721086 Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
-rw-r--r--common/usb_pd_protocol.c19
-rw-r--r--common/usbc/usb_tc_drp_acc_trysrc_sm.c19
-rw-r--r--include/config.h16
3 files changed, 41 insertions, 13 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c
index b7d0abb2b8..9004246296 100644
--- a/common/usb_pd_protocol.c
+++ b/common/usb_pd_protocol.c
@@ -426,13 +426,20 @@ static void set_vconn(int port, int enable)
ppc_set_vconn(port, 0);
/*
- * We always need to tell the TCPC to enable Vconn first, otherwise some
- * TCPCs get confused when a PPC sets secondary CC line to 5V and TCPC
- * immediately disconnect. If there is a PPC, both devices will
- * potentially source Vconn, but that should be okay since Vconn has
- * "make before break" electrical requirements when swapping anyway.
+ * Some TCPCs/PPC combinations can trigger OVP if the TCPC doesn't
+ * source VCONN. This happens if the TCPC will trip OVP with 5V, and the
+ * PPC doesn't isolate the TCPC from VCONN when sourcing. But, some PPCs
+ * which do isolate the TCPC can't handle 5V on its host-side CC pins,
+ * so the TCPC shouldn't source VCONN in those cases.
+ *
+ * In the first case, both TCPC and PPC will potentially source Vconn,
+ * but that should be okay since Vconn has "make before break"
+ * electrical requirements when swapping anyway.
+ *
+ * See b/72961003 and b/180973460
*/
- tcpm_set_vconn(port, enable);
+ if (IS_ENABLED(CONFIG_USB_PD_TCPC_VCONN))
+ tcpm_set_vconn(port, enable);
if (IS_ENABLED(CONFIG_USBC_PPC_VCONN) && enable)
ppc_set_vconn(port, 1);
diff --git a/common/usbc/usb_tc_drp_acc_trysrc_sm.c b/common/usbc/usb_tc_drp_acc_trysrc_sm.c
index 964d6dda8c..5e3117e582 100644
--- a/common/usbc/usb_tc_drp_acc_trysrc_sm.c
+++ b/common/usbc/usb_tc_drp_acc_trysrc_sm.c
@@ -1791,13 +1791,20 @@ static void set_vconn(int port, int enable)
ppc_set_vconn(port, 0);
/*
- * We always need to tell the TCPC to enable Vconn first, otherwise some
- * TCPCs get confused and think the CC line is in over voltage mode and
- * immediately disconnects. If there is a PPC, both devices will
- * potentially source Vconn, but that should be okay since Vconn has
- * "make before break" electrical requirements when swapping anyway.
+ * Some TCPCs/PPC combinations can trigger OVP if the TCPC doesn't
+ * source VCONN. This happens if the TCPC will trip OVP with 5V, and the
+ * PPC doesn't isolate the TCPC from VCONN when sourcing. But, some PPCs
+ * which do isolate the TCPC can't handle 5V on its host-side CC pins,
+ * so the TCPC shouldn't source VCONN in those cases.
+ *
+ * In the first case, both TCPC and PPC will potentially source Vconn,
+ * but that should be okay since Vconn has "make before break"
+ * electrical requirements when swapping anyway.
+ *
+ * See b/72961003 and b/180973460
*/
- tcpm_set_vconn(port, enable);
+ if (IS_ENABLED(CONFIG_USB_PD_TCPC_VCONN))
+ tcpm_set_vconn(port, enable);
if (IS_ENABLED(CONFIG_USBC_PPC_VCONN) && enable)
ppc_set_vconn(port, 1);
diff --git a/include/config.h b/include/config.h
index 3bc1635a84..487a65c045 100644
--- a/include/config.h
+++ b/include/config.h
@@ -4203,6 +4203,9 @@
/* Define EC and TCPC modules are in one integrated chip */
#undef CONFIG_USB_PD_TCPC_ON_CHIP
+/* If VCONN is enabled, the TCPC will provide VCONN */
+#define CONFIG_USB_PD_TCPC_VCONN
+
/* Enable the encoding of msg SOP* in bits 31-28 of 32-bit msg header type */
#undef CONFIG_USB_PD_DECODE_SOP
@@ -5416,10 +5419,21 @@
#define CONFIG_USBC_PPC_VCONN
#endif
-/* The SYV682X supports VCONN and needs to be informed of CC polarity */
+/*
+ * The SYV682X supports VCONN and needs to be informed of CC polarity.
+ * There is a 3.6V limit on the HOST_CC signals, so the TCPC should not source
+ * 5V VCONN.
+ *
+ * For the ITE integrated TCPC, it wants to be notified of VCONN but won't
+ * source VCONN itself, so is safe to keep enabled.
+ */
#if defined(CONFIG_USBC_PPC_SYV682X)
#define CONFIG_USBC_PPC_POLARITY
#define CONFIG_USBC_PPC_VCONN
+#if !defined(CONFIG_USB_PD_TCPM_DRIVER_IT83XX) && \
+ !defined(CONFIG_USB_PD_TCPM_DRIVER_IT8XXX2)
+#undef CONFIG_USB_PD_TCPC_VCONN
+#endif
#endif
/*****************************************************************************/