Skip to contentSkip to conversation

Add StarFive JHB100 soc BMC DRD USB support

PATCH In review Minda Chen 2 participants 4 messages Apr 10 – Apr 14

Subsystems (4)
lore
Share & tools
lore
author maintainer
#2 lore raw

PATCH v2 2/2 usb: dwc3: starfive: Add JHB100 USB 2.0 DRD controller

In reply to Minda Chen

JHB100 contains 2 dwc3 USB controllers and PHYs and working as USB 2.0 speed. It can working in generic platform and setting default properties.

---
 drivers/usb/dwc3/dwc3-generic-plat.c | 1 +
 1 file changed, 1 insertion(+)
drivers/usb/dwc3/dwc3-generic-plat.c +1 -0
index e846844e0023..e9e29b63aaa4 100644
@@ -214,6 +214,7 @@ static const struct of_device_id dwc3_generic_of_match[] = {
 	{ .compatible = "spacemit,k1-dwc3", },
 	{ .compatible = "fsl,ls1028a-dwc3", &fsl_ls1028_dwc3},
 	{ .compatible = "eswin,eic7700-dwc3", &eic7700_dwc3},
+	{ .compatible = "starfive,jhb100-dwc3", },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, dwc3_generic_of_match);
Signature · 1 line
2.17.1

Minda Chen

author maintainer
#0 lore raw

v2 cover Add StarFive JHB100 soc BMC DRD USB support

JHB100 is a Starfive new RISC-V SoC for datacenter BMC (Baseboard Managent Controller). Similar with Aspeed 27x0.

The JHB100 minimal system upstream is in progress:
https://patchwork.kernel.org/project/linux-riscv/cover/[email protected]/

JHB100 contain 2 USB 2.0 dwc3 USB port, and integrated with USB 2.0 PHY. These 2 ports just for BMC soc use. Actually JHB100 contain other dwc3 usb controllers, which is using as xhci over PCIe and locate in PCIe EP. It is working for host server. But now PCIe EP driver is not in upstream progress. So just commit BMC USB 2.0 port driver patches to upstream first.

The patch base in V7.0-rc5

changes form v1:
1. Add review tag to patch1
2.v1 patch 2 delte one more line, v2 just add device compatible.

Minda Chen (2):
dt-bindings: usb: dwc3: add support for StarFive JHB100
usb: dwc3: starfive: Add JHB100 USB 2.0 DRD controller

 .../bindings/usb/starfive,jhb100-dwc3.yaml    | 64 +++++++++++++++++++
 MAINTAINERS                                   |  3 +-
 drivers/usb/dwc3/dwc3-generic-plat.c          |  1 +
 3 files changed, 67 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/usb/starfive,jhb100-dwc3.yaml

base-commit: c369299895a591d96745d6492d4888259b004a9e

Signature · 1 line
2.17.1
author maintainer
#1 lore raw

PATCH v2 1/2 dt-bindings: usb: dwc3: add support for StarFive JHB100

Add support for the USB 2.0 Dual-Role Device (DRD) controller embedded in the StarFive JHB100 SoC. The controller is based on the Synopsys DesignWare Core USB 3 (DWC3) IP.

---
 .../bindings/usb/starfive,jhb100-dwc3.yaml    | 64 +++++++++++++++++++
 MAINTAINERS                                   |  3 +-
 2 files changed, 66 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/usb/starfive,jhb100-dwc3.yaml
Documentation/devicetree/bindings/usb/starfive,jhb100-dwc3.yaml new file +64 -0
new file mode 100644
index 000000000000..fbabe99e9d5c
@@ -0,0 +1,64 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/usb/starfive,jhb100-dwc3.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: StarFive JHB100 DWC3 USB SoC Controller
+
+maintainers:
+  - Minda Chen <[email protected]>
+
+description:
+  The USB DRD controller on JHB100 BMC SoC.
+
+allOf:
+  - $ref: snps,dwc3-common.yaml#
+
+properties:
+  compatible:
+    const: starfive,jhb100-dwc3
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    items:
+      - description: USB main enable clk
+      - description: DWC3 bus early clock
+      - description: DWC3 ref clock
+
+  clock-names:
+    items:
+      - const: main
+      - const: bus_early
+      - const: ref
+
+  resets:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - interrupts
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    usb@11800000 {
+        compatible = "starfive,jhb100-dwc3";
+        reg = <0x11800000 0x10000>;
+        clocks = <&usbcrg 9>,
+                 <&usbcrg 5>,
+                 <&usbcrg 6>;
+        clock-names = "main", "bus_early", "ref";
+        resets = <&usbcrg 4>;
+        interrupts = <105>;
+        dr_mode = "host";
+    };
MAINTAINERS +2 -1
index 32bd94a0b94c..2f3475e0b678 100644
@@ -25252,10 +25252,11 @@ F:	Documentation/devicetree/bindings/reset/starfive,jh7100-reset.yaml
 F:	drivers/reset/starfive/reset-starfive-jh71*
 F:	include/dt-bindings/reset/starfive?jh71*.h
 
-STARFIVE JH71X0 USB DRIVERS
+STARFIVE USB DRIVERS
 M:	Minda Chen <[email protected]>
 S:	Maintained
 F:	Documentation/devicetree/bindings/usb/starfive,jh7110-usb.yaml
+F:	Documentation/devicetree/bindings/usb/starfive,jhb100-dwc3.yaml
 F:	drivers/usb/cdns3/cdns3-starfive.c
 
 STARFIVE JH71XX PMU CONTROLLER DRIVER
Signature · 1 line
2.17.1
maintainer Acked-by on v2 2/2
#3 lore raw

Re: [PATCH v2 2/2] usb: dwc3: starfive: Add JHB100 USB 2.0 DRD controller

In reply to Minda Chen
Quoted 24 lines · Minda Chen

JHB100 contains 2 dwc3 USB controllers and PHYs and working as USB 2.0 speed. It can working in generic platform and setting default properties.

---
 drivers/usb/dwc3/dwc3-generic-plat.c | 1 +
 1 file changed, 1 insertion(+)
drivers/usb/dwc3/dwc3-generic-plat.c +1 -0
index e846844e0023..e9e29b63aaa4 100644
@@ -214,6 +214,7 @@ static const struct of_device_id dwc3_generic_of_match[] = {
 	{ .compatible = "spacemit,k1-dwc3", },
 	{ .compatible = "fsl,ls1028a-dwc3", &fsl_ls1028_dwc3},
 	{ .compatible = "eswin,eic7700-dwc3", &eic7700_dwc3},
+	{ .compatible = "starfive,jhb100-dwc3", },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, dwc3_generic_of_match);
Signature · 1 line
2.17.1

BR,
Thinh