public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Rohloff <ingo.rohloff@lauterbach.com>
To: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Cc: Krzysztof Kozlowski <krzk@kernel.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: Re: [PATCH v2 2/2] dt-bindings: usb: dwc3: Add property to insert delay before TxValid.
Date: Fri, 27 Feb 2026 12:04:36 +0100	[thread overview]
Message-ID: <20260227120436.6f4e68a9@ingpc2.intern.lauterbach.com> (raw)
In-Reply-To: <20260227002003.gznbxapvqr3slc2o@synopsys.com>

On Fri, 27 Feb 2026 00:20:10 +0000
Thinh Nguyen <Thinh.Nguyen@synopsys.com> wrote:
> On Thu, Feb 26, 2026, Thinh Nguyen wrote:
> > On Thu, Feb 26, 2026, Ingo Rohloff wrote:  
> > > On Thu, 26 Feb 2026 11:51:27 +0100
> > > Krzysztof Kozlowski <krzk@kernel.org> wrote:
> > >   
> > > > On 25/02/2026 14:03, Ingo Rohloff wrote:  
> > > > > The Microchip USB3340x ULPI PHY requires a delay when switching
> > > > > to the high-speed transmitter. See:
> > > > >     https://urldefense.com/v3/__http://ww1.microchip.com/downloads/en/DeviceDoc/80000645A.pdf__;!!A4F2R9G_pg!YRzZkLTZr5Bhh57FiXmyq7e4wVPHUbXZdgH3a627O2kbzpOTPiw_1MKGc_zD5cr8_Y-r1h5XvyFL9c7YRNObAl-lmUNgSuU$ 
> > > > >     Module 2 "Device Enumeration Failure with Link IP Systems"
> > > > >  
> > > > 
> > > > So that's deducible from the compatible and you do not need this
> > > > property at all?
> > > >   
> > >   
> 
> After reading Ingo's comment again, I don't think we can simply deduct
> whether this property is needed from just the Xilinx dwc3 compatible.
> I think this one may need its own devicetree property.

Krzystof gave me another idea though:
In drivers/usb/dwc3/ulpi.c the dwc3 code will call dwc3_ulpi_init(),
if the DWC3 controller is connected via ULPI to an USB ULPI PHY.

dwc3_ulpi_init() will call ulpi_register_interface(), which 
(under the right circumstances) will call ulpi_read_id().

At this point in time it would be easy to use
dwc3_ulpi_read()/dwc3_ulpi_write() to read out the
  USB ULPI PHY VendorID/ProductID
by mimicking the behavior of ulpi_read_id() from drivers/usb/common/ulpi.c

Based on the VendorID/ProductID we then could set
   dwc3->enable_usb2_transceiver_delay
if necessary.

This approach means:
* No new device tree property necessary.
* Code autodetects the problematic combo of DWC3 + USB3340 ULPI PHY
  and applies the necessary settings.
* Will work for any combination of DWC3 IP + USB3340 ULPI PHY,
  and not only for the  Xilinx specific DWC3 implementation.
* Future proof: If there ever is another ULPI PHY, which needs special
  settings in the DWC3 controller, you could then just extend the
  code to detect this new ULPI PHY and apply the necessary settings.

Caveat:
You have the code to read out the ULPI PHY VendorID/ProductID twice:
* Once in ulpi_read_id() from drivers/usb/common/ulpi.c
* Once in drivers/usb/dwc3/ulpi.c

I do not see any easy way to get access to the VendorID/ProductID
from ulpi_read_id(); in particular because right now this function
is only called if the ULPI PHY has a corresponding node in the
device tree, which currently is not the case.
Meaning right now ulpi_read_id() is NOT called.

with best regards
  Ingo

-- 


-------------------------------------------------------------------------
Dipl.-Inform.
Ingo ROHLOFF
Senior Staff Embedded Systems Engineering
phone +49 8102 9876-142 - ingo.rohloff@lauterbach.com

Lauterbach Engineering GmbH & Co. KG
Altlaufstrasse 40, 85635 Hoehenkirchen-Siegertsbrunn, GERMANY
www.lauterbach.com

Registered Office: Hoehenkirchen-Siegertsbrunn, Germany,
Local Court: Munich, HRA 87406, VAT ID: DE246770537,
Managing Directors: Lothar Lauterbach, Stephan Lauterbach, Dr. Thomas
Ullmann

-------------------------------------------------------------------------

  reply	other threads:[~2026-02-27 11:04 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
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 [this message]
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=20260227120436.6f4e68a9@ingpc2.intern.lauterbach.com \
    --to=ingo.rohloff@lauterbach.com \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=krzk@kernel.org \
    --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