[PATCH v3 0/3] Add SpacemiT K1 USB3.0 host controller support

Ze Huang
2025-05-17T19:19:53Z

The USB 3.0 controller found in the SpacemiT K1 SoC[1] supports both USB3.0
Host and USB2.0 Dual-Role Device (DRD). The PHY interfaces required for the
K1 USB subsystem — PIPE3 (for USB 3.0) and UTMI+ (for USB 2.0) — have
already been supported in a separate patchset [2].

This controller is compatible with DesignWare Core USB 3 (DWC3) driver.
However, constraints in the snps,dwc3 binding limit the ability to extend
properties to describe hardware variations. The existing generic DWC3 driver,
dwc3-of-simple, still functions as a glue layer.

To address this and promote trasition to flattened dwc node, this patch
introduces dwc3-common, building upon prior work that exposed the DWC3 core
driver [3].

This patchset is based on usb-next (6.15-rc6) and has been tested on BananaPi and Jupiter development boards.

Link: https://developer.spacemit.com/documentation?token=AjHDwrW78igAAEkiHracBI9HnTb [1]
Link: https://lore.kernel.org/linux-riscv/20250418-b4-k1-usb3-phy-v2-v2-0-b69e02da84eb@whut.edu.cn [2]
Link: https://lore.kernel.org/all/20250414-dwc3-refactor-v7-3-f015b358722d@oss.qualcomm.com [3]

Signed-off-by: Ze Huang <huangze@whut.edu.cn>
---
Changes in v3:
- introduce dwc3-common for generic dwc3 hardware
- fix warnings in usb host dt-bindings
- fix errors in dts
- Link to v2: https://lore.kernel.org/r/20250428-b4-k1-dwc3-v2-v1-0-7cb061abd619@whut.edu.cn

Changes in v2:
- dt-bindings:
- add missing 'maxItems'
- remove 'status' property in exmaple
- fold dwc3 node into parent
- drop dwc3 glue driver and use snps,dwc3 driver directly
- rename dts nodes and reorder properties to fit coding style
- Link to v1: https://lore.kernel.org/all/20250407-b4-k1-usb3-v3-2-v1-0-bf0bcc41c9ba@whut.edu.cn

---
Ze Huang (3):
dt-bindings: usb: dwc3: add support for SpacemiT K1
usb: dwc3: add common driver to support flattened DT
riscv: dts: spacemit: add usb3.0 support for K1

.../devicetree/bindings/usb/spacemit,k1-dwc3.yaml | 84 +++++++++
arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts | 50 ++++++
arch/riscv/boot/dts/spacemit/k1.dtsi | 69 ++++++++
drivers/usb/dwc3/Kconfig | 9 +
drivers/usb/dwc3/Makefile | 1 +
drivers/usb/dwc3/dwc3-common.c | 191 +++++++++++++++++++++
6 files changed, 404 insertions(+)
---
base-commit: ab6dc9a6c721c2eed867c157447764ae68ff9b7e
change-id: 20250517-b4-k1-dwc3-v3-5208a002728a

Best regards,
--
Ze Huang <huangze@whut.edu.cn>