mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] usb: dwc2: skip polling for the soft reset clear bit and add  after reset delay
@ 2026-06-23 14:23 chalianis1
  0 siblings, 0 replies; only message in thread
From: chalianis1 @ 2026-06-23 14:23 UTC (permalink / raw)
  To: s.hauer; +Cc: barebox, Chali Anis

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.

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.

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)



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-23 14:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-23 14:23 [PATCH] usb: dwc2: skip polling for the soft reset clear bit and add after reset delay chalianis1

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