summaryrefslogtreecommitdiff
path: root/baseboard
diff options
context:
space:
mode:
authorWai-Hong Tam <waihong@google.com>2022-12-02 14:21:54 -0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-01-06 00:47:57 +0000
commit5a99b9b38428215cce0f3c660f003919652595e2 (patch)
tree19e27ce0cf690d310b24dd436c38d89284180db5 /baseboard
parent087952b801e0c9608adc505349b952dea88505d9 (diff)
downloadchrome-ec-5a99b9b38428215cce0f3c660f003919652595e2.tar.gz
trogdor: Pass through AUX termination when DP-Config is acked
The hardware block diagram is like: AUX termination | +----+--- TCPC MUX --- PPC SW --- Type-C connector (port-0) DP PHY -- DP MUX +----+--- TCPC MUX --- PPC SW --- Type-C connector (port-1) | AUX termination The current implementation muxes the path end-to-end on a HPD high event. The dependencies are: * Chromebook muxing the AUX channel depends on a HPD high event, * DP sink raising HPD depends on a cable connection detected (auto- probe), * Successful probe of a cable connection depends on AUX termination, which cause a dead-lock. This change breaks the dead-lock. During the DP-Config phase, when the DP-Config VDM is acked, connect the PPC SW and TCPC MUX, but leave the DP MUX disconnected. So the DP sink can detect the correct AUX termination. The DP port selection mux is not enabled yet so no signal passes through to the DP PHY. As the TCPC MUX is enabled in the DP-Config phase, we can't use the TCPC MUX status as the condition to check if the DP path is muxable. Change it to the DP selection mux. BRANCH=trogdor BUG=b:247005613 TEST=Together with the next CL. Connect the device through a Type-C dongle to a monitor and verify the screen. Try the combinations: * Plug C0 monitor -> plug C0 dongle -> screen on C0 monitor * Plug C0 dongle -> plug C0 monitor -> screen on C0 monitor -> unplug C0 monitor -> plug C0 monitor -> screen on C0 monitor * Plug C0 dongle -> plug C0 monitor -> screen on C0 monitor -> plug C1 dongle -> -> plug C1 monitor -> no screen on C1 monitor -> unplug C0 monitor -> replug C1 monitor -> screen on C0 monitor * Plug C0 dongle -> plug C1 dongle -> plug C1 monitor -> screen on C1 monitor -> unplug C1 dongle -> plug C0 monitor -> screen on C0 monitor Change-Id: Id24ce4627a1c015ad2dc9748578fa1a6d68122c6 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4076560 Reviewed-by: Stephen Boyd <swboyd@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Commit-Queue: Stephen Boyd <swboyd@chromium.org>
Diffstat (limited to 'baseboard')
-rw-r--r--baseboard/trogdor/usb_pd_policy.c35
1 files changed, 25 insertions, 10 deletions
diff --git a/baseboard/trogdor/usb_pd_policy.c b/baseboard/trogdor/usb_pd_policy.c
index 7954d0a352..f707882511 100644
--- a/baseboard/trogdor/usb_pd_policy.c
+++ b/baseboard/trogdor/usb_pd_policy.c
@@ -98,7 +98,7 @@ __override int svdm_dp_config(int port, uint32_t *payload)
return 0;
/*
- * Defer setting the usb_mux until HPD goes high, svdm_dp_attention().
+ * Defer setting the DP mux until HPD goes high, svdm_dp_attention().
* The AP only supports one DP phy. An external DP mux switches between
* the two ports. Should switch those muxes when it is really used,
* i.e. HPD high; otherwise, the real use case is preempted, like:
@@ -118,6 +118,23 @@ __override int svdm_dp_config(int port, uint32_t *payload)
__override void svdm_dp_post_config(int port)
{
dp_flags[port] |= DP_FLAGS_DP_ON;
+
+ /*
+ * Connect the SBU lines in PPC chip such that the AUX termination
+ * can be passed through.
+ */
+ if (IS_ENABLED(CONFIG_USBC_PPC_SBU))
+ ppc_set_sbu(port, 1);
+
+ /*
+ * Connect the USB SS/DP lines in TCPC chip.
+ *
+ * When mf_pref not true, still use the dock muxing
+ * because of the board USB-C topology (limited to 2
+ * lanes DP).
+ */
+ usb_mux_set(port, USB_PD_MUX_DOCK, USB_SWITCH_CONNECT,
+ polarity_rm_dts(pd_get_polarity(port)));
}
/**
@@ -130,15 +147,13 @@ __override void svdm_dp_post_config(int port)
*/
static int is_dp_muxable(int port)
{
- int i;
-
- for (i = 0; i < CONFIG_USB_PD_PORT_MAX_COUNT; i++)
- if (i != port) {
- if (usb_mux_get(i) & USB_PD_MUX_DP_ENABLED)
- return 0;
- }
-
- return 1;
+ /*
+ * Check the DP port selection mux, positive either:
+ * - no port is muxed, OE_L deasserted, HIGH, or
+ * - already muxed to the same port.
+ */
+ return gpio_get_level(GPIO_DP_MUX_OE_L) ||
+ (gpio_get_level(GPIO_DP_MUX_SEL) == port);
}
__override int svdm_dp_attention(int port, uint32_t *payload)