summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormadhusudanarao amara <madhusudanarao.amara@intel.corp-partner.google.com>2021-07-28 12:26:30 +0530
committerCommit Bot <commit-bot@chromium.org>2021-08-06 13:27:40 +0000
commitf0985f8a11585f6a704aa94a8354bd5b934619ac (patch)
tree430aa4cfd58ee3a91d0af596a646ec842695e935
parentfaa5ff511aa464f5fee621eef7b8bf4cdeb26ad5 (diff)
downloadchrome-ec-f0985f8a11585f6a704aa94a8354bd5b934619ac.tar.gz
DP/TBT/USB4: Retimer WA resolved Brya TBT lane bonding issue in AP mode
In AP Mode DP exit to TBT entry is causing TBT lane bonding issue. Issue is not seen by calling the retimer reset as WA at the time of disconnect mode configuration. Revert this patch after getting the actual fix. BUG=b:193402306 BRANCH=None TEST=Checked TBT enumeration in AP Mode TOREVERT=b:195375738 Signed-off-by: madhusudanarao amara <madhusudanarao.amara@intel.corp-partner.google.com> Change-Id: Ia22e061a863940b2a13ad5a38f4fe130737c5c20 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3058157 Reviewed-by: Keith Short <keithshort@chromium.org>
-rw-r--r--board/brya/usbc_config.c14
-rw-r--r--driver/retimer/bb_retimer.c20
-rw-r--r--include/driver/retimer/bb_retimer_public.h12
3 files changed, 46 insertions, 0 deletions
diff --git a/board/brya/usbc_config.c b/board/brya/usbc_config.c
index 818397aa31..40476c3f4f 100644
--- a/board/brya/usbc_config.c
+++ b/board/brya/usbc_config.c
@@ -268,6 +268,20 @@ __override int bb_retimer_power_enable(const struct usb_mux *me, bool enable)
return EC_SUCCESS;
}
+__override int bb_retimer_reset(const struct usb_mux *me)
+{
+ /*
+ * TODO(b/193402306, b/195375738): Remove this once transition to
+ * QS Silicon is complete
+ */
+ bb_retimer_power_enable(me, false);
+ msleep(5);
+ bb_retimer_power_enable(me, true);
+ msleep(25);
+
+ return EC_SUCCESS;
+}
+
void board_reset_pd_mcu(void)
{
enum gpio_signal tcpc_rst;
diff --git a/driver/retimer/bb_retimer.c b/driver/retimer/bb_retimer.c
index 4f5a240869..919e278a8b 100644
--- a/driver/retimer/bb_retimer.c
+++ b/driver/retimer/bb_retimer.c
@@ -365,6 +365,18 @@ static void retimer_set_state_ufp(int port, mux_state_t mux_state,
}
/**
+ * Driver interface function: reset retimer
+ */
+__overridable int bb_retimer_reset(const struct usb_mux *me)
+{
+ /*
+ * TODO(b/193402306, b/195375738): Remove this once transition to
+ * QS Silicon is complete
+ */
+ return EC_SUCCESS;
+}
+
+/**
* Driver interface functions
*/
static int retimer_set_state(const struct usb_mux *me, mux_state_t mux_state)
@@ -463,6 +475,14 @@ static int retimer_set_state(const struct usb_mux *me, mux_state_t mux_state)
else
retimer_set_state_ufp(port, mux_state, &set_retimer_con);
+ /*
+ * In AP Mode DP exit to TBT entry is causing TBT lane bonding issue
+ * Issue is not seen by calling the retimer reset as WA at the time of
+ * disconnect mode configuration
+ */
+ if (mux_state == USB_PD_MUX_NONE)
+ bb_retimer_reset(me);
+
/* Writing the register4 */
return bb_retimer_write(me, BB_RETIMER_REG_CONNECTION_STATE,
set_retimer_con);
diff --git a/include/driver/retimer/bb_retimer_public.h b/include/driver/retimer/bb_retimer_public.h
index 78047d3f7c..e4a6e4ca2f 100644
--- a/include/driver/retimer/bb_retimer_public.h
+++ b/include/driver/retimer/bb_retimer_public.h
@@ -41,4 +41,16 @@ extern struct bb_usb_control bb_controls[];
__override_proto int bb_retimer_power_enable(const struct usb_mux *me,
bool enable);
+/**
+ * reset the BB retimer
+ *
+ * Define override function at board level if the platform specific changes
+ * are needed to reset the BB retimer.
+ *
+ * @param me Pointer to USB mux
+ *
+ * @return EC_SUCCESS, or non-zero on error.
+ */
+__override_proto int bb_retimer_reset(const struct usb_mux *me);
+
#endif /* __CROS_EC_DRIVER_RETIMER_BB_RETIMER_PUBLIC_H */