Linux USB
 help / color / mirror / Atom feed
* [PATCH v2 0/3] usb: dwc2: Add Siflower SF19A2890 support
@ 2026-11-11  8:26 Joseph Telaak via B4 Relay
  2026-11-11  8:26 ` [PATCH v2 1/3] dt-bindings: usb: dwc2: Add Siflower SF19A2890 Joseph Telaak via B4 Relay
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Joseph Telaak via B4 Relay @ 2026-11-11  8:26 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Minas Harutyunyan
  Cc: Chuanhong Guo, linux-mips, linux-usb, devicetree, linux-kernel,
	Conor Dooley, Joseph Telaak

The Siflower SF19A2890, a MIPS SoC for home routers, has a DWC OTG 3.30a.
This series adds its compatible and parameters, and handles an
interrupt it raises without flagging it: with battery charger support
enabled, the core sets MultValIpChng in GOTGINT but not OTGINT in GINTSTS,
so the interrupt is never cleared. Chuanhong saw the line disabled with
"nobody cares"; on the GL-SFT1200 the system stalls instead (below).

The two driver patches are Chuanhong Guo's, from OpenWrt and his
SF19A2890 branch. The OTG one handled GOTGINT on every interrupt for
every core; here it does so only for cores that set the new
otg_int_unflagged parameter, which only the SF19A2890 does.

Tested on a GL.iNet GL-SFT1200 with the USB PHY driver: a USB stick
enumerates at 480 Mb/s, reads at 5.6 MB/s and comes back cleanly after
two replugs. Without patch 3, a couple of replugs leave the system
stuck, the console repeating its last message with the same timestamp
until a power cycle; no "nobody cares" message appears first.

---
Changes in v2:
- Write my notes on Chuanhong's patches as lists, with Co-developed-by
  on the OTG interrupt patch.
- Sort the new compatible in the binding and in the match table.
- Describe the OTG interrupt fix as it is now in its commit message.
- Patch 1: add Conor's Ack.
- Link to v1: https://patch.msgid.link/20261104-sf19a2890-dwc2-v1-0-d959375e26ab@telaak.dev

---
Chuanhong Guo (2):
      usb: dwc2: Add Siflower SF19A2890 support
      usb: dwc2: Handle OTG interrupts that GINTSTS does not flag

Joseph Telaak (1):
      dt-bindings: usb: dwc2: Add Siflower SF19A2890

 Documentation/devicetree/bindings/usb/dwc2.yaml |  1 +
 drivers/usb/dwc2/core.h                         |  6 ++++++
 drivers/usb/dwc2/core_intr.c                    |  5 ++++-
 drivers/usb/dwc2/params.c                       | 11 +++++++++++
 4 files changed, 22 insertions(+), 1 deletion(-)
---
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
change-id: 20261102-sf19a2890-dwc2-87573f7cebed

Best regards,
--  
Joseph Telaak <joseph@telaak.dev>



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

* [PATCH v2 1/3] dt-bindings: usb: dwc2: Add Siflower SF19A2890
  2026-11-11  8:26 [PATCH v2 0/3] usb: dwc2: Add Siflower SF19A2890 support Joseph Telaak via B4 Relay
@ 2026-11-11  8:26 ` Joseph Telaak via B4 Relay
  2026-11-11  8:29   ` sashiko-bot
  2026-11-11  8:26 ` [PATCH v2 2/3] usb: dwc2: Add Siflower SF19A2890 support Joseph Telaak via B4 Relay
  2026-11-11  8:26 ` [PATCH v2 3/3] usb: dwc2: Handle OTG interrupts that GINTSTS does not flag Joseph Telaak via B4 Relay
  2 siblings, 1 reply; 7+ messages in thread
From: Joseph Telaak via B4 Relay @ 2026-11-11  8:26 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Minas Harutyunyan
  Cc: Chuanhong Guo, linux-mips, linux-usb, devicetree, linux-kernel,
	Conor Dooley, Joseph Telaak

From: Joseph Telaak <joseph@telaak.dev>

The Siflower SF19A2890 has a DWC OTG 3.30a controller, with its own
bus burst limit and an OTG interrupt quirk.

Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Joseph Telaak <joseph@telaak.dev>
---
 Documentation/devicetree/bindings/usb/dwc2.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/usb/dwc2.yaml b/Documentation/devicetree/bindings/usb/dwc2.yaml
index 6c3a10991b8b..3b4763f476ea 100644
--- a/Documentation/devicetree/bindings/usb/dwc2.yaml
+++ b/Documentation/devicetree/bindings/usb/dwc2.yaml
@@ -58,6 +58,7 @@ properties:
           - const: snps,dwc2
       - const: amcc,dwc-otg
       - const: apm,apm82181-dwc-otg
+      - const: siflower,sf19a2890-usb
       - const: snps,dwc2
       - const: sophgo,cv1800b-usb
       - const: st,stm32f4x9-fsotg

-- 
Git-155)



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

* [PATCH v2 2/3] usb: dwc2: Add Siflower SF19A2890 support
  2026-11-11  8:26 [PATCH v2 0/3] usb: dwc2: Add Siflower SF19A2890 support Joseph Telaak via B4 Relay
  2026-11-11  8:26 ` [PATCH v2 1/3] dt-bindings: usb: dwc2: Add Siflower SF19A2890 Joseph Telaak via B4 Relay
@ 2026-11-11  8:26 ` Joseph Telaak via B4 Relay
  2026-11-11  8:30   ` sashiko-bot
  2026-11-11  8:26 ` [PATCH v2 3/3] usb: dwc2: Handle OTG interrupts that GINTSTS does not flag Joseph Telaak via B4 Relay
  2 siblings, 1 reply; 7+ messages in thread
From: Joseph Telaak via B4 Relay @ 2026-11-11  8:26 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Minas Harutyunyan
  Cc: Chuanhong Guo, linux-mips, linux-usb, devicetree, linux-kernel,
	Joseph Telaak

From: Chuanhong Guo <gch981213@gmail.com>

The Siflower SF19A2890 has a DWC OTG 3.30a controller. Limit its
transfers to 65535 bytes and its AHB bursts to INCR4, the settings the
OpenWrt port has run it with.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
[Joseph Telaak:
  - take it from OpenWrt's siflower target and rebase on v7.4-rc1
  - commit message and subject]
Signed-off-by: Joseph Telaak <joseph@telaak.dev>
---
 drivers/usb/dwc2/params.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c
index 091bfcfef753..b31fa1f5ad64 100644
--- a/drivers/usb/dwc2/params.c
+++ b/drivers/usb/dwc2/params.c
@@ -237,6 +237,14 @@ static void dwc2_set_cv1800_params(struct dwc2_hsotg *hsotg)
 	p->power_down = DWC2_POWER_DOWN_PARAM_NONE;
 }
 
+static void dwc2_set_sf19a2890_params(struct dwc2_hsotg *hsotg)
+{
+	struct dwc2_core_params *p = &hsotg->params;
+
+	p->max_transfer_size = 65535;
+	p->ahbcfg = GAHBCFG_HBSTLEN_INCR4 << GAHBCFG_HBSTLEN_SHIFT;
+}
+
 static void dwc2_set_stm32f4x9_fsotg_params(struct dwc2_hsotg *hsotg)
 {
 	struct dwc2_core_params *p = &hsotg->params;
@@ -334,6 +342,8 @@ const struct of_device_id dwc2_of_match_table[] = {
 	  .data = dwc2_set_amlogic_a1_params },
 	{ .compatible = "amcc,dwc-otg", .data = dwc2_set_amcc_params },
 	{ .compatible = "apm,apm82181-dwc-otg", .data = dwc2_set_amcc_params },
+	{ .compatible = "siflower,sf19a2890-usb",
+	  .data = dwc2_set_sf19a2890_params },
 	{ .compatible = "sophgo,cv1800b-usb",
 	  .data = dwc2_set_cv1800_params },
 	{ .compatible = "st,stm32f4x9-fsotg",

-- 
Git-155)



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

* [PATCH v2 3/3] usb: dwc2: Handle OTG interrupts that GINTSTS does not flag
  2026-11-11  8:26 [PATCH v2 0/3] usb: dwc2: Add Siflower SF19A2890 support Joseph Telaak via B4 Relay
  2026-11-11  8:26 ` [PATCH v2 1/3] dt-bindings: usb: dwc2: Add Siflower SF19A2890 Joseph Telaak via B4 Relay
  2026-11-11  8:26 ` [PATCH v2 2/3] usb: dwc2: Add Siflower SF19A2890 support Joseph Telaak via B4 Relay
@ 2026-11-11  8:26 ` Joseph Telaak via B4 Relay
  2026-11-11  8:34   ` sashiko-bot
  2 siblings, 1 reply; 7+ messages in thread
From: Joseph Telaak via B4 Relay @ 2026-11-11  8:26 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Minas Harutyunyan
  Cc: Chuanhong Guo, linux-mips, linux-usb, devicetree, linux-kernel,
	Joseph Telaak

From: Chuanhong Guo <gch981213@gmail.com>

The DWC OTG 3.30a of the Siflower SF19A2890 has battery charger support
enabled. It raises the MultValIpChng interrupt (bit 20 of GOTGINT)
without setting OTGInt in GINTSTS, so the interrupt is never handled
and the kernel disables the USB interrupt because nobody cared.

On a GL.iNet GL-SFT1200 it shows differently: after a few replugs of a
USB stick the system stops making progress, the console repeating its
last message with the same timestamp, until a power cycle.

Add an otg_int_unflagged parameter for such cores. With it set, the
common interrupt handler also reads GOTGINT on every interrupt and
handles any OTG interrupt it finds there, as it does when OTGInt is
set. The SF19A2890 sets it; other cores are unchanged.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
[Joseph Telaak:
  - handle the unflagged OTG interrupts only on cores with the new
    otg_int_unflagged parameter, which the SF19A2890 sets
  - do it in the one place that already handles flagged OTG
    interrupts, and return IRQ_HANDLED
  - describe what a GL-SFT1200 does without the patch, and the fix as
    it is now
  - subject]
Co-developed-by: Joseph Telaak <joseph@telaak.dev>
Signed-off-by: Joseph Telaak <joseph@telaak.dev>
---
 drivers/usb/dwc2/core.h      | 6 ++++++
 drivers/usb/dwc2/core_intr.c | 5 ++++-
 drivers/usb/dwc2/params.c    | 1 +
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2/core.h
index 015a5fb7842d..288baaaf4736 100644
--- a/drivers/usb/dwc2/core.h
+++ b/drivers/usb/dwc2/core.h
@@ -367,6 +367,11 @@ enum dwc2_ep0_state {
  * @no_clock_gating:	Specifies whether to avoid clock gating feature.
  *			0 - No (use clock gating)
  *			1 - Yes (avoid it)
+ * @otg_int_unflagged:	Specifies whether the core raises OTG interrupts
+ *			without setting OTGINT in GINTSTS, so that GOTGINT
+ *			has to be checked on every interrupt.
+ *			0 - No
+ *			1 - Yes
  * @lpm:		Enable LPM support.
  *			0 - No
  *			1 - Yes
@@ -466,6 +471,7 @@ struct dwc2_core_params {
 #define DWC2_POWER_DOWN_PARAM_PARTIAL		1
 #define DWC2_POWER_DOWN_PARAM_HIBERNATION	2
 	bool no_clock_gating;
+	bool otg_int_unflagged;
 
 	bool lpm;
 	bool lpm_clock_gating;
diff --git a/drivers/usb/dwc2/core_intr.c b/drivers/usb/dwc2/core_intr.c
index 9565e6a52725..e7bb9709c985 100644
--- a/drivers/usb/dwc2/core_intr.c
+++ b/drivers/usb/dwc2/core_intr.c
@@ -874,8 +874,11 @@ irqreturn_t dwc2_handle_common_intr(int irq, void *dev)
 
 	if (gintsts & GINTSTS_MODEMIS)
 		dwc2_handle_mode_mismatch_intr(hsotg);
-	if (gintsts & GINTSTS_OTGINT)
+	if ((gintsts & GINTSTS_OTGINT) ||
+	    (hsotg->params.otg_int_unflagged && dwc2_readl(hsotg, GOTGINT))) {
 		dwc2_handle_otg_intr(hsotg);
+		retval = IRQ_HANDLED;
+	}
 	if (gintsts & GINTSTS_CONIDSTSCHNG)
 		dwc2_handle_conn_id_status_change_intr(hsotg);
 	if (gintsts & GINTSTS_DISCONNINT)
diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c
index b31fa1f5ad64..8e814a925dd1 100644
--- a/drivers/usb/dwc2/params.c
+++ b/drivers/usb/dwc2/params.c
@@ -243,6 +243,7 @@ static void dwc2_set_sf19a2890_params(struct dwc2_hsotg *hsotg)
 
 	p->max_transfer_size = 65535;
 	p->ahbcfg = GAHBCFG_HBSTLEN_INCR4 << GAHBCFG_HBSTLEN_SHIFT;
+	p->otg_int_unflagged = true;
 }
 
 static void dwc2_set_stm32f4x9_fsotg_params(struct dwc2_hsotg *hsotg)

-- 
Git-155)



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

* Re: [PATCH v2 1/3] dt-bindings: usb: dwc2: Add Siflower SF19A2890
  2026-11-11  8:26 ` [PATCH v2 1/3] dt-bindings: usb: dwc2: Add Siflower SF19A2890 Joseph Telaak via B4 Relay
@ 2026-11-11  8:29   ` sashiko-bot
  0 siblings, 0 replies; 7+ messages in thread
From: sashiko-bot @ 2026-11-11  8:29 UTC (permalink / raw)
  To: Joseph Telaak; +Cc: linux-usb

> From: Joseph Telaak <joseph@telaak.dev>
> 
> The Siflower SF19A2890 has a DWC OTG 3.30a controller, with its own
> bus burst limit and an OTG interrupt quirk.
> 
> Acked-by: Conor Dooley <conor.dooley@microchip.com>
> Signed-off-by: Joseph Telaak <joseph@telaak.dev>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261111-sf19a2890-dwc2-v2-0-cba9dd4a4256@telaak.dev?part=1


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

* Re: [PATCH v2 2/3] usb: dwc2: Add Siflower SF19A2890 support
  2026-11-11  8:26 ` [PATCH v2 2/3] usb: dwc2: Add Siflower SF19A2890 support Joseph Telaak via B4 Relay
@ 2026-11-11  8:30   ` sashiko-bot
  0 siblings, 0 replies; 7+ messages in thread
From: sashiko-bot @ 2026-11-11  8:30 UTC (permalink / raw)
  To: Joseph Telaak; +Cc: linux-usb

> From: Chuanhong Guo <gch981213@gmail.com>
> 
> The Siflower SF19A2890 has a DWC OTG 3.30a controller. Limit its
> transfers to 65535 bytes and its AHB bursts to INCR4, the settings the
> OpenWrt port has run it with.
> 
> Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
> [Joseph Telaak:
>   - take it from OpenWrt's siflower target and rebase on v7.4-rc1
>   - commit message and subject]
> Signed-off-by: Joseph Telaak <joseph@telaak.dev>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261111-sf19a2890-dwc2-v2-0-cba9dd4a4256@telaak.dev?part=2


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

* Re: [PATCH v2 3/3] usb: dwc2: Handle OTG interrupts that GINTSTS does not flag
  2026-11-11  8:26 ` [PATCH v2 3/3] usb: dwc2: Handle OTG interrupts that GINTSTS does not flag Joseph Telaak via B4 Relay
@ 2026-11-11  8:34   ` sashiko-bot
  0 siblings, 0 replies; 7+ messages in thread
From: sashiko-bot @ 2026-11-11  8:34 UTC (permalink / raw)
  To: Joseph Telaak; +Cc: linux-usb

> From: Chuanhong Guo <gch981213@gmail.com>
> 
> The DWC OTG 3.30a of the Siflower SF19A2890 has battery charger support
> enabled. It raises the MultValIpChng interrupt (bit 20 of GOTGINT)
> without setting OTGInt in GINTSTS, so the interrupt is never handled
> and the kernel disables the USB interrupt because nobody cared.
> 
> On a GL.iNet GL-SFT1200 it shows differently: after a few replugs of a
> USB stick the system stops making progress, the console repeating its
> last message with the same timestamp, until a power cycle.
> 
> Add an otg_int_unflagged parameter for such cores. With it set, the
> common interrupt handler also reads GOTGINT on every interrupt and
> handles any OTG interrupt it finds there, as it does when OTGInt is
> set. The SF19A2890 sets it; other cores are unchanged.
> 
> Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
> [Joseph Telaak:
>   - handle the unflagged OTG interrupts only on cores with the new
>     otg_int_unflagged parameter, which the SF19A2890 sets
>   - do it in the one place that already handles flagged OTG
>     interrupts, and return IRQ_HANDLED
>   - describe what a GL-SFT1200 does without the patch, and the fix as
>     it is now
>   - subject]
> Co-developed-by: Joseph Telaak <joseph@telaak.dev>
> Signed-off-by: Joseph Telaak <joseph@telaak.dev>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261111-sf19a2890-dwc2-v2-0-cba9dd4a4256@telaak.dev?part=3


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

end of thread, other threads:[~2026-11-11  8:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-11  8:26 [PATCH v2 0/3] usb: dwc2: Add Siflower SF19A2890 support Joseph Telaak via B4 Relay
2026-11-11  8:26 ` [PATCH v2 1/3] dt-bindings: usb: dwc2: Add Siflower SF19A2890 Joseph Telaak via B4 Relay
2026-11-11  8:29   ` sashiko-bot
2026-11-11  8:26 ` [PATCH v2 2/3] usb: dwc2: Add Siflower SF19A2890 support Joseph Telaak via B4 Relay
2026-11-11  8:30   ` sashiko-bot
2026-11-11  8:26 ` [PATCH v2 3/3] usb: dwc2: Handle OTG interrupts that GINTSTS does not flag Joseph Telaak via B4 Relay
2026-11-11  8:34   ` sashiko-bot

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