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 07:01:53 +0000
commit9c6c2f11b2dfcd2767a7923004ecd4ef4a02f8c8 (patch)
tree745eea08b8f56c686b11b55dd138e7946a76f819
parent82453e2d1a25b4cad739ead6057621f9e81c5db8 (diff)
downloadchrome-ec-9c6c2f11b2dfcd2767a7923004ecd4ef4a02f8c8.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/+/2721146 Reviewed-by: YH Lin <yueherngl@chromium.org> Commit-Queue: YH Lin <yueherngl@chromium.org> Tested-by: YH Lin <yueherngl@chromium.org> (cherry picked from commit 1d057b12f6c232999e69732f9c409fabd672f40a) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2721325 Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> Commit-Queue: Zhuohao Lee <zhuohao@chromium.org> Tested-by: Zhuohao Lee <zhuohao@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 29b07a0767..4c480c4bed 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 30f1d6ac85..b45d7377d6 100644
--- a/common/usbc/usb_tc_drp_acc_trysrc_sm.c
+++ b/common/usbc/usb_tc_drp_acc_trysrc_sm.c
@@ -1692,13 +1692,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 a7177856b3..1d6181e135 100644
--- a/include/config.h
+++ b/include/config.h
@@ -4180,6 +4180,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
@@ -5345,10 +5348,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
/*****************************************************************************/