mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] usb: dwc2: core: add no-csftrst-wait DT property
@ 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
  0 siblings, 1 reply; 2+ messages in thread
From: chalianis1 @ 2026-03-31  3:17 UTC (permalink / raw)
  To: s.hauer; +Cc: barebox, Chali Anis

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.

Signed-off-by: Chali Anis <chalianis1@gmail.com>
---
 drivers/usb/dwc2/core.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/dwc2/core.c b/drivers/usb/dwc2/core.c
index 60cc690fdbc0..9a2356ee074e 100644
--- a/drivers/usb/dwc2/core.c
+++ b/drivers/usb/dwc2/core.c
@@ -770,6 +770,7 @@ bool dwc2_iddig_filter_enabled(struct dwc2 *dwc2)
  */
 int dwc2_core_reset(struct dwc2 *dwc2)
 {
+	struct device_node *np = dwc2->dev->of_node;
 	bool wait_for_host_mode = false;
 	uint32_t greset;
 	int ret;
@@ -809,11 +810,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_property_read_bool(np, "no-csftrst-wait")) {
+		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] 2+ messages in thread

* [PATCH 2/2] ARM: dts: bcm2711-rpi: enable USB and skip soft reset  wait on RPi4
  2026-03-31  3:17 [PATCH 1/2] usb: dwc2: core: add no-csftrst-wait DT property chalianis1
@ 2026-03-31  3:17 ` chalianis1
  0 siblings, 0 replies; 2+ messages in thread
From: chalianis1 @ 2026-03-31  3:17 UTC (permalink / raw)
  To: s.hauer; +Cc: barebox, Chali Anis

From: Chali Anis <chalianis1@gmail.com>

The dwc2 controller on bcm2711 does not reliably deassert GRSTCTL_CSFTRST
within the expected window, causing probe to fail with ETIMEDOUT. Enable
the USB node and set no-csftrst-wait to bypass the reset bit polling.

Signed-off-by: Chali Anis <chalianis1@gmail.com>
---
 arch/arm/dts/bcm2711-rpi.dtsi | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/dts/bcm2711-rpi.dtsi b/arch/arm/dts/bcm2711-rpi.dtsi
index 2722133a4afc..892d6a7aecc8 100644
--- a/arch/arm/dts/bcm2711-rpi.dtsi
+++ b/arch/arm/dts/bcm2711-rpi.dtsi
@@ -19,3 +19,7 @@ &uart1 {
 &power {
 	barebox,allow-dummy;
 };
+
+&usb {
+	no-csftrst-wait;
+};



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-03-31  3:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-31  3:17 [PATCH 1/2] usb: dwc2: core: add no-csftrst-wait DT property chalianis1
2026-03-31  3:17 ` [PATCH 2/2] ARM: dts: bcm2711-rpi: enable USB and skip soft reset wait on RPi4 chalianis1

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