public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
To: Ingo Rohloff <ingo.rohloff@lauterbach.com>
Cc: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: Re: [PATCH] usb: dwc3: Support for USB3340x ULPI PHY, via "snps,enable_xcvrdly_quirk"
Date: Wed, 25 Feb 2026 00:05:17 +0000	[thread overview]
Message-ID: <20260225000512.tle2eu4gkd4ut6bf@synopsys.com> (raw)
In-Reply-To: <20260224141438.39524-1-ingo.rohloff@lauterbach.com>

On Tue, Feb 24, 2026, Ingo Rohloff wrote:
> 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:
> +	 *    https://urldefense.com/v3/__http://ww1.microchip.com/downloads/en/DeviceDoc/80000645A.pdf__;!!A4F2R9G_pg!dXav8YHma6OhZWR1jhFvBxM4Wgv7OAUPjMgBS8CRz-P0x2OTr8PGbErUg7RtcbLfsNihsPay4lHdvoLJnN9nJoxGJqwb2qg$ 
> +	 *    "Device Enumeration Failure with Link IP Systems"

This platform specific info and how it was found should go into the
commit message and not here.

> +	 * According to documentation on the Internet,

We should not just reference the "Internet". If you want to reference
some documentation, please provide the DWC_usb3x document section and
version.

> +	 * DWC3_GUSB2PHYCFG_XCVRDLY:
> +	 *    Adds a delay between the assertion of the
> +	 *    ULPI Transceiver Select signal (for HS) and

It can be for both ULPI and UTMI.

> +	 *    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.
> +	 */

IMO, this doc should go in the commit message.

> +	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");

Use "-" instead of "_" for property name, and change it to
"snps,enable-usb2-transceiver-delay"

Also, how are you passing this quirk? Through devicetree or software
node? I don't see the user of this property.

> +
>  	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;

Document the new field. Rename to enable_usb2_transceiver_delay.

>  	unsigned		async_callbacks:1;
>  	unsigned		sys_wakeup:1;
>  	unsigned		wakeup_configured:1;
> -- 
> 2.52.0
> 

BR,
Thinh

  reply	other threads:[~2026-02-25  0:05 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260225000512.tle2eu4gkd4ut6bf@synopsys.com \
    --to=thinh.nguyen@synopsys.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=ingo.rohloff@lauterbach.com \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox