mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Sascha Hauer" <s.hauer@pengutronix.de>
To: chalianis1@gmail.com
Cc: Chali Anis <chalianis1@gmail.com>, barebox@lists.infradead.org
Subject: Re: [PATCH] usb: dwc2: skip polling for the soft reset clear bit and add  after reset delay
Date: Mon, 29 Jun 2026 10:56:50 +0000	[thread overview]
Message-ID: <E1we9fW-00000005ggu-3u1v@pty.whiteo.stw.pengutronix.de> (raw)
In-Reply-To: <20260623142330.79621-1-chalianis1@gmail.com>

On 2026-06-23 10:23, chalianis1 wrote:
> From: Chali Anis <chalianis1@gmail.com>
> 
> The RPi4 SoC do not deassert GRSTCTL_CSFTRST within the expected
> window but continue to operate correctly, causing probe to fail
> with ETIMEDOUT.

Does "within the expected window" imply that there is a bigger window in
which it is de-asserted?

> 
> 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.

Which datasheet, the SoC datasheet or a DWC2 datasheet?

I'm just asking if there is a chance to not need a SoC check here.

Sascha

> 
> Signed-off-by: Chali Anis <chalianis1@gmail.com>
> ---
>  drivers/usb/dwc2/core.c | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/usb/dwc2/core.c b/drivers/usb/dwc2/core.c
> index 60cc690fdbc0..6d4b7930da9e 100644
> --- a/drivers/usb/dwc2/core.c
> +++ b/drivers/usb/dwc2/core.c
> @@ -809,11 +809,16 @@ int dwc2_core_reset(struct dwc2 *dwc2)
>  	greset |= GRSTCTL_CSFTRST;
>  	dwc2_writel(dwc2, greset, GRSTCTL);
>  
> -	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_machine_is_compatible("brcm,bcm2711")) {
> +		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 |



      reply	other threads:[~2026-06-29 10:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-23 14:23 chalianis1
2026-06-29 10:56 ` Sascha Hauer [this message]

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=E1we9fW-00000005ggu-3u1v@pty.whiteo.stw.pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=chalianis1@gmail.com \
    /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