mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: chalianis1@gmail.com, s.hauer@pengutronix.de
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/2] usb: dwc2: core: add no-csftrst-wait DT property
Date: Mon, 13 Apr 2026 15:50:27 +0200	[thread overview]
Message-ID: <a7593c0f-07ae-476b-846e-3dbaf2ab75d7@pengutronix.de> (raw)
In-Reply-To: <20260331031723.195128-1-chalianis1@gmail.com>

Hello Anis,

On 3/31/26 5:17 AM, chalianis1@gmail.com wrote:
> From: Chali Anis <chalianis1@gmail.com>
> 
> Some platforms (e.g. RPi4/bcm2711) do not deassert GRSTCTL_CSFTRST within
> the expected window but continue to operate correctly, causing probe to
> fail with ETIMEDOUT.
> 
> Per the datasheet, GRSTCTL_CSFTRST is self-clearing but requires at least
> 3 PHY clocks after reset before any PHY domain access. Add a 1us delay to
> satisfy this requirement.
> 
> Additionally introduce the 'no-csftrst-wait' devicetree property to skip
> polling for the bit to clear on platforms where the reset completes but the
> status bit is unreliable.

I still wonder why there are no workarounds for this particular issue in
Linux or U-Boot. We seem to do something different when we run into this
reliably, but others don't?

I originally thought, it may be related to the version of the IP,
because both Linux and U-Boot have special handling for >= 4.20, but I
checked on my Rpi4 and DWC2 has v2.80 there (Synopsis ID 4f54280a)

> -	ret = dwc2_wait_bit_clear(dwc2, GRSTCTL, GRSTCTL_CSFTRST, 10000);
> -	if (ret) {
> -		dwc2_warn(dwc2, "%s: Timeout! Waiting for Core Soft Reset\n",
> +	/* Wait for at least 3 PHY Clocks */
> +	udelay(1);
> +
> +	if (!of_property_read_bool(np, "no-csftrst-wait")) {

barebox-specific Device Tree properties should be documented in
Documentation/devicetree/bindings/.

Alternatively, you can check of_machine_is_compatible("brcm,bcm2711")

Cheers,
Ahmad

> +		ret = dwc2_wait_bit_clear(dwc2, GRSTCTL, GRSTCTL_CSFTRST, 10000);
> +		if (ret) {
> +			dwc2_warn(dwc2, "%s: Timeout! Waiting for Core Soft Reset\n",
>  				__func__);
> -		return ret;
> +			return ret;
> +		}
>  	}
>  
>  	if (wait_for_host_mode)
> 
> 

-- 
Pengutronix e.K.                  |                             |
Steuerwalder Str. 21              | http://www.pengutronix.de/  |
31137 Hildesheim, Germany         | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |




  parent reply	other threads:[~2026-04-13 13:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-31  3:17 chalianis1
2026-03-31  3:17 ` [PATCH 2/2] ARM: dts: bcm2711-rpi: enable USB and skip soft reset wait on RPi4 chalianis1
2026-04-13 13:50 ` Ahmad Fatoum [this message]
2026-04-13 17:41   ` [PATCH 1/2] usb: dwc2: core: add no-csftrst-wait DT property anis chali
2026-04-13 19:31     ` Ahmad Fatoum
2026-04-15  6:38     ` Sascha Hauer

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=a7593c0f-07ae-476b-846e-3dbaf2ab75d7@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=chalianis1@gmail.com \
    --cc=s.hauer@pengutronix.de \
    /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