public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: dwc3: Support for USB3340x ULPI PHY, via "snps,enable_xcvrdly_quirk"
@ 2026-02-24 14:14 Ingo Rohloff
  2026-02-25  0:05 ` Thinh Nguyen
  0 siblings, 1 reply; 19+ messages in thread
From: Ingo Rohloff @ 2026-02-24 14:14 UTC (permalink / raw)
  To: Thinh.Nguyen, gregkh; +Cc: linux-usb, Ingo Rohloff

The Microchip USB3340x ULPI PHY requires a delay when switching to the
high-speed transmitter.

Original description is/was in Xilinx Wiki under
"USB Debug Guide for Zynq UltraScale+ and Versal Devices"

Signed-off-by: Ingo Rohloff <ingo.rohloff@lauterbach.com>
---
 drivers/usb/dwc3/core.c | 20 ++++++++++++++++++++
 drivers/usb/dwc3/core.h |  2 ++
 2 files changed, 22 insertions(+)

diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 161a4d58b2ce..92ad701a9340 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -777,6 +777,23 @@ static int dwc3_hs_phy_setup(struct dwc3 *dwc, int index)
 	if (dwc->ulpi_ext_vbus_drv)
 		reg |= DWC3_GUSB2PHYCFG_ULPIEXTVBUSDRV;
 
+	/*
+	 * Fixes High-speed negotiation issue with USB3340, see:
+	 *    http://ww1.microchip.com/downloads/en/DeviceDoc/80000645A.pdf
+	 *    "Device Enumeration Failure with Link IP Systems"
+	 * According to documentation on the Internet,
+	 * DWC3_GUSB2PHYCFG_XCVRDLY:
+	 *    Adds a delay between the assertion of the
+	 *    ULPI Transceiver Select signal (for HS) and
+	 *    the assertion of the TxValid signal during a HS Chirp.
+	 *
+	 * This bit also needs to be set again when the device comes out
+	 * of hibernation, this is currently not an issue since hibernation
+	 * is not enabled.
+	 */
+	if (dwc->enable_xcvrdly_quirk)
+		reg |= DWC3_GUSB2PHYCFG_XCVRDLY;
+
 	dwc3_writel(dwc, DWC3_GUSB2PHYCFG(index), reg);
 
 	return 0;
@@ -1855,6 +1872,9 @@ static void dwc3_get_properties(struct dwc3 *dwc)
 	dwc->dis_split_quirk = device_property_read_bool(dev,
 				"snps,dis-split-quirk");
 
+	dwc->enable_xcvrdly_quirk = device_property_read_bool(dev,
+				"snps,enable_xcvrdly_quirk");
+
 	dwc->lpm_nyet_threshold = lpm_nyet_threshold;
 	dwc->tx_de_emphasis = tx_de_emphasis;
 
diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
index a35b3db1f9f3..41418f3f85e1 100644
--- a/drivers/usb/dwc3/core.h
+++ b/drivers/usb/dwc3/core.h
@@ -302,6 +302,7 @@
 #define DWC3_GUSB2PHYCFG_SUSPHY		BIT(6)
 #define DWC3_GUSB2PHYCFG_ULPI_UTMI	BIT(4)
 #define DWC3_GUSB2PHYCFG_ENBLSLPM	BIT(8)
+#define DWC3_GUSB2PHYCFG_XCVRDLY	BIT(9)
 #define DWC3_GUSB2PHYCFG_PHYIF(n)	(n << 3)
 #define DWC3_GUSB2PHYCFG_PHYIF_MASK	DWC3_GUSB2PHYCFG_PHYIF(1)
 #define DWC3_GUSB2PHYCFG_USBTRDTIM(n)	(n << 10)
@@ -1403,6 +1404,7 @@ struct dwc3 {
 	unsigned		dis_metastability_quirk:1;
 
 	unsigned		dis_split_quirk:1;
+	unsigned		enable_xcvrdly_quirk:1;
 	unsigned		async_callbacks:1;
 	unsigned		sys_wakeup:1;
 	unsigned		wakeup_configured:1;
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2026-02-28  1:05 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-24 14:14 [PATCH] usb: dwc3: Support for USB3340x ULPI PHY, via "snps,enable_xcvrdly_quirk" Ingo Rohloff
2026-02-25  0:05 ` Thinh Nguyen
2026-02-25 12:49   ` Ingo Rohloff
2026-02-26  2:39     ` Thinh Nguyen
2026-02-26 11:32       ` Ingo Rohloff
2026-02-26 19:26         ` Thinh Nguyen
2026-02-26 20:27           ` Ingo Rohloff
2026-02-26 23:51             ` Thinh Nguyen
2026-02-27  0:02               ` Thinh Nguyen
2026-02-25 13:03   ` [PATCH v2 0/2] Re: [PATCH] usb: dwc3: Support for USB3340x ULPI PHY Ingo Rohloff
2026-02-25 13:03     ` [PATCH v2 1/2] usb: dwc3: Support USB3340x ULPI PHY high-speed negotiation Ingo Rohloff
2026-02-25 13:03     ` [PATCH v2 2/2] dt-bindings: usb: dwc3: Add property to insert delay before TxValid Ingo Rohloff
2026-02-26 10:51       ` Krzysztof Kozlowski
2026-02-26 16:12         ` Ingo Rohloff
2026-02-26 19:04           ` Thinh Nguyen
2026-02-27  0:20             ` Thinh Nguyen
2026-02-27 11:04               ` Ingo Rohloff
2026-02-28  1:05                 ` Thinh Nguyen
2026-02-26 10:51     ` [PATCH v2 0/2] Re: [PATCH] usb: dwc3: Support for USB3340x ULPI PHY Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox