* [PATCH 0/3] usb: dwc2: Add Siflower SF19A2890 support
@ 2026-11-04 7:22 Joseph Telaak via B4 Relay
2026-11-04 7:22 ` [PATCH 1/3] dt-bindings: usb: dwc2: Add Siflower SF19A2890 Joseph Telaak via B4 Relay
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Joseph Telaak via B4 Relay @ 2026-11-04 7:22 UTC (permalink / raw)
To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Minas Harutyunyan
Cc: Chuanhong Guo, linux-usb, devicetree, linux-kernel, 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 MultValIpChg 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.
---
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] 5+ messages in thread
* [PATCH 1/3] dt-bindings: usb: dwc2: Add Siflower SF19A2890
2026-11-04 7:22 [PATCH 0/3] usb: dwc2: Add Siflower SF19A2890 support Joseph Telaak via B4 Relay
@ 2026-11-04 7:22 ` Joseph Telaak via B4 Relay
2026-11-04 23:43 ` Conor Dooley
2026-11-04 7:22 ` [PATCH 2/3] usb: dwc2: Add Siflower SF19A2890 support Joseph Telaak via B4 Relay
2026-11-04 7:22 ` [PATCH 3/3] usb: dwc2: Handle OTG interrupts that GINTSTS does not flag Joseph Telaak via B4 Relay
2 siblings, 1 reply; 5+ messages in thread
From: Joseph Telaak via B4 Relay @ 2026-11-04 7:22 UTC (permalink / raw)
To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Minas Harutyunyan
Cc: Chuanhong Guo, linux-usb, devicetree, linux-kernel, 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.
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 6c3a10991..8217e84be 100644
--- a/Documentation/devicetree/bindings/usb/dwc2.yaml
+++ b/Documentation/devicetree/bindings/usb/dwc2.yaml
@@ -59,6 +59,7 @@ properties:
- const: amcc,dwc-otg
- const: apm,apm82181-dwc-otg
- const: snps,dwc2
+ - const: siflower,sf19a2890-usb
- const: sophgo,cv1800b-usb
- const: st,stm32f4x9-fsotg
- const: st,stm32f4x9-hsotg
--
Git-155)
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/3] usb: dwc2: Add Siflower SF19A2890 support
2026-11-04 7:22 [PATCH 0/3] usb: dwc2: Add Siflower SF19A2890 support Joseph Telaak via B4 Relay
2026-11-04 7:22 ` [PATCH 1/3] dt-bindings: usb: dwc2: Add Siflower SF19A2890 Joseph Telaak via B4 Relay
@ 2026-11-04 7:22 ` Joseph Telaak via B4 Relay
2026-11-04 7:22 ` [PATCH 3/3] usb: dwc2: Handle OTG interrupts that GINTSTS does not flag Joseph Telaak via B4 Relay
2 siblings, 0 replies; 5+ messages in thread
From: Joseph Telaak via B4 Relay @ 2026-11-04 7:22 UTC (permalink / raw)
To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Minas Harutyunyan
Cc: Chuanhong Guo, 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>
[jt: from OpenWrt's siflower target, rebased on v7.4-rc1, commit message,
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 091bfcfef..f6379e616 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;
@@ -336,6 +344,8 @@ const struct of_device_id dwc2_of_match_table[] = {
{ .compatible = "apm,apm82181-dwc-otg", .data = dwc2_set_amcc_params },
{ .compatible = "sophgo,cv1800b-usb",
.data = dwc2_set_cv1800_params },
+ { .compatible = "siflower,sf19a2890-usb",
+ .data = dwc2_set_sf19a2890_params },
{ .compatible = "st,stm32f4x9-fsotg",
.data = dwc2_set_stm32f4x9_fsotg_params },
{ .compatible = "st,stm32f4x9-hsotg" },
--
Git-155)
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 3/3] usb: dwc2: Handle OTG interrupts that GINTSTS does not flag
2026-11-04 7:22 [PATCH 0/3] usb: dwc2: Add Siflower SF19A2890 support Joseph Telaak via B4 Relay
2026-11-04 7:22 ` [PATCH 1/3] dt-bindings: usb: dwc2: Add Siflower SF19A2890 Joseph Telaak via B4 Relay
2026-11-04 7:22 ` [PATCH 2/3] usb: dwc2: Add Siflower SF19A2890 support Joseph Telaak via B4 Relay
@ 2026-11-04 7:22 ` Joseph Telaak via B4 Relay
2 siblings, 0 replies; 5+ messages in thread
From: Joseph Telaak via B4 Relay @ 2026-11-04 7:22 UTC (permalink / raw)
To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Minas Harutyunyan
Cc: Chuanhong Guo, linux-usb, devicetree, linux-kernel, Joseph Telaak
From: Chuanhong Guo <gch981213@gmail.com>
The DWC OTG 3.30a found on Siflower SF19A2890 has battery charger
support enabled. It triggers MultVallpChng interrupt (bit 20 of
GOTGINT) but doesn't set OTGInt in GINTSTS. As a result, this
interrupt is never handled, and Linux disables USB interrupt
because "nobody cares".
Handle OTG interrupt in IRQ handler regardless of whether the
OTGInt bit in GINTSTS is set or not.
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.
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
[jt: only on cores with the new otg_int_unflagged parameter, which
SF19A2890 sets, in the one place that already handles flagged OTG
interrupts and with IRQ_HANDLED returned; the others still handle OTG
interrupts only when GINTSTS flags them; what a GL-SFT1200 does without
the patch, subject]
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 015a5fb78..288baaaf4 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 9565e6a52..e7bb9709c 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 f6379e616..22ab9ce13 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 [flat|nested] 5+ messages in thread
* Re: [PATCH 1/3] dt-bindings: usb: dwc2: Add Siflower SF19A2890
2026-11-04 7:22 ` [PATCH 1/3] dt-bindings: usb: dwc2: Add Siflower SF19A2890 Joseph Telaak via B4 Relay
@ 2026-11-04 23:43 ` Conor Dooley
0 siblings, 0 replies; 5+ messages in thread
From: Conor Dooley @ 2026-11-04 23:43 UTC (permalink / raw)
To: joseph
Cc: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Minas Harutyunyan, Chuanhong Guo, linux-usb,
devicetree, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 75 bytes --]
Acked-by: Conor Dooley <conor.dooley@microchip.com>
pw-bot: not-applicable
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-11-04 23:43 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-04 7:22 [PATCH 0/3] usb: dwc2: Add Siflower SF19A2890 support Joseph Telaak via B4 Relay
2026-11-04 7:22 ` [PATCH 1/3] dt-bindings: usb: dwc2: Add Siflower SF19A2890 Joseph Telaak via B4 Relay
2026-11-04 23:43 ` Conor Dooley
2026-11-04 7:22 ` [PATCH 2/3] usb: dwc2: Add Siflower SF19A2890 support Joseph Telaak via B4 Relay
2026-11-04 7:22 ` [PATCH 3/3] usb: dwc2: Handle OTG interrupts that GINTSTS does not flag Joseph Telaak via B4 Relay
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®