Skip to contentSkip to conversation

dt-bindings: usb: Convert TI OMAP MUSB OTG controller and DWC3 USB Glue to DT schema

PATCH Superseded Charan Pedumuru 2 participants 7 messages Jan 26 – Jan 27

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover dt-bindings: usb: Convert TI OMAP MUSB OTG controller and DWC3 USB Glue to DT schema

This series converts the old text-based DeviceTree bindings for TI OMAP MUSB OTG controller and TI DWC3 USB glue to modern JSON-schema (YAML) format.

---
Charan Pedumuru (2):
dt-bindings: usb: ti,omap4-musb: convert to DT schema
dt-bindings: usb: ti,dwc3: convert to DT schema

 Documentation/devicetree/bindings/usb/omap-usb.txt |  80 -------------
 Documentation/devicetree/bindings/usb/ti,dwc3.yaml | 112 +++++++++++++++++
 .../devicetree/bindings/usb/ti,omap4-musb.yaml     | 133 +++++++++++++++++++++
 3 files changed, 245 insertions(+), 80 deletions(-)

---
base-commit: f417b7ffcbef7d76b0d8860518f50dae0e7e5eda
change-id: 20260109-ti-usb-9df63c7ee152

Best regards,

Signature · 1 line
Charan Pedumuru <[email protected]>
#1 lore raw

PATCH 1/2 dt-bindings: usb: ti,omap4-musb: convert to DT schema

Convert OMAP MUSB USB OTG Controller binding to DT schema. Changes during conversion:
- Introduce new compatible string patterns "am35x_otg_hs" and "usb_otg_hs" to properly match existing nodes already defined in the DT sources.
- Include "interrupts" and "interrupt-names" properties in the YAML, as they are used by many in-tree DTS files.
- Extend the "power" property to allow the value 150 (in addition to existing values), since this is present in several in-tree DTS examples.

---
 .../devicetree/bindings/usb/ti,omap4-musb.yaml     | 133 +++++++++++++++++++++
 1 file changed, 133 insertions(+)
Documentation/devicetree/bindings/usb/ti,omap4-musb.yaml new file +133 -0
new file mode 100644
index 000000000000..16e95fe4c38d
@@ -0,0 +1,133 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/usb/ti,omap4-musb.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Texas Instruments OMAP MUSB USB OTG Controller
+
+maintainers:
+  - Felipe Balbi <[email protected]
+
+description:
+  Texas Instruments glue layer for the Mentor Graphics MUSB OTG controller.
+  Handles SoC-specific integration including PHY interface bridging(ULPI/
+  UTMI), interrupt aggregation, DMA engine coordination (internal/
+  external), VBUS/session control via control module mailbox, and
+  clock/reset management. Provides fixed hardware configuration parameters
+  to the generic MUSB core driver.
+
+properties:
+  $nodename:
+    pattern: "^(am35x_otg_hs|usb_otg_hs|usb)@[0-9a-f]+$"
+
+  compatible:
+    enum:
+      - ti,omap3-musb
+      - ti,omap4-musb
+
+  reg:
+    maxItems: 1
+
+  ti,hwmods:
+    $ref: /schemas/types.yaml#/definitions/string
+    description:
+      Specifies the name of the TI PRCM (Power, Reset and Clock Management)
+      hardware module that must be enabled (powered and clocked) for this
+      device node to operate. The value "usb_otg_hs" refers to the USB
+      On-The-Go High-Speed controller IP block.
+    const: usb_otg_hs
+
+  interrupts:
+    minItems: 1
+    maxItems: 2
+
+  interrupt-names:
+    minItems: 1
+    maxItems: 2
+    items:
+      enum: [mc, dma]
+
+  multipoint:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Indicates the MUSB controller supports multipoint. This is a MUSB
+      configuration-specific setting.
+    const: 1
+
+  num-eps:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Specifies the number of endpoints. This is a MUSB configuration
+      specific setting.
+    const: 16
+
+  ram-bits:
+    description:
+      Specifies the RAM address size.
+    const: 12
+
+  interface-type:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Describes the type of interface between the controller and the PHY.
+      0 for ULPI, 1 for UTMI.
+    enum: [0, 1]
+
+  mode:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: 1 for HOST, 2 for PERIPHERAL, 3 for OTG.
+    enum: [1, 2, 3]
+
+  power:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Signifies the controller can supply up to 100mA when operating
+      in host mode.
+    enum: [50, 150]
+
+  phys:
+    maxItems: 1
+
+  phy-names:
+    const: usb2-phy
+
+  usb-phy:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+    description: Phandle for the PHY device.
+    deprecated: true
+
+  ctrl-module:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description:
+      Phandle of the control module this glue uses to write to mailbox.
+
+required:
+  - reg
+  - compatible
+  - interrupts
+  - interrupt-names
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    usb_otg_hs@4a0ab000 {
+        compatible = "ti,omap4-musb";
+        reg = <0x4a0ab000 0x1000>;
+        interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>;
+        interrupt-names = "mc", "dma";
+        ti,hwmods = "usb_otg_hs";
+        multipoint = <1>;
+        num-eps = <16>;
+        ram-bits = <12>;
+        ctrl-module = <&omap_control_usb>;
+        phys = <&usb2_phy>;
+        phy-names = "usb2-phy";
+        interface-type = <1>;
+        mode = <3>;
+        power = <50>;
+    };
+...
Signature · 1 line
2.52.0
#4 lore raw

PATCH 2/2 dt-bindings: usb: ti,dwc3: convert to DT schema

In reply to Charan Pedumuru

Convert OMAP DWC3 USB Glue Layer binding to DT schema. Changes during conversion:
- Introduce a new compatible string pattern "omap_dwc3" to match nodes already present in existing device tree sources.

---
 Documentation/devicetree/bindings/usb/omap-usb.txt |  80 ---------------
 Documentation/devicetree/bindings/usb/ti,dwc3.yaml | 112 +++++++++++++++++++++
 2 files changed, 112 insertions(+), 80 deletions(-)
Documentation/devicetree/bindings/usb/omap-usb.txt deleted +0 -80
deleted file mode 100644
index f0dbc5ae45ae..000000000000
@@ -1,80 +0,0 @@
-OMAP GLUE AND OTHER OMAP SPECIFIC COMPONENTS
-
-OMAP MUSB GLUE
- - compatible : Should be "ti,omap4-musb" or "ti,omap3-musb"
- - ti,hwmods : must be "usb_otg_hs"
- - multipoint : Should be "1" indicating the musb controller supports
-   multipoint. This is a MUSB configuration-specific setting.
- - num-eps : Specifies the number of endpoints. This is also a
-   MUSB configuration-specific setting. Should be set to "16"
- - ram-bits : Specifies the ram address size. Should be set to "12"
- - interface-type : This is a board specific setting to describe the type of
-   interface between the controller and the phy. It should be "0" or "1"
-   specifying ULPI and UTMI respectively.
- - mode : Should be "3" to represent OTG. "1" signifies HOST and "2"
-   represents PERIPHERAL.
- - power : Should be "50". This signifies the controller can supply up to
-   100mA when operating in host mode.
- - usb-phy : the phandle for the PHY device
- - phys : the phandle for the PHY device (used by generic PHY framework)
- - phy-names : the names of the PHY corresponding to the PHYs present in the
-   *phy* phandle.
-
-Optional properties:
- - ctrl-module : phandle of the control module this glue uses to write to
-   mailbox
-
-SOC specific device node entry
-usb_otg_hs: usb_otg_hs@4a0ab000 {
-	compatible = "ti,omap4-musb";
-	ti,hwmods = "usb_otg_hs";
-	multipoint = <1>;
-	num-eps = <16>;
-	ram-bits = <12>;
-	ctrl-module = <&omap_control_usb>;
-	phys = <&usb2_phy>;
-	phy-names = "usb2-phy";
-};
-
-Board specific device node entry
-&usb_otg_hs {
-	interface-type = <1>;
-	mode = <3>;
-	power = <50>;
-};
-
-OMAP DWC3 GLUE
- - compatible : Should be
-	* "ti,dwc3" for OMAP5 and DRA7
-	* "ti,am437x-dwc3" for AM437x
- - ti,hwmods : Should be "usb_otg_ss"
- - reg : Address and length of the register set for the device.
- - interrupts : The irq number of this device that is used to interrupt the
-   MPU
- - #address-cells, #size-cells : Must be present if the device has sub-nodes
- - utmi-mode : controls the source of UTMI/PIPE status for VBUS and OTG ID.
-   It should be set to "1" for HW mode and "2" for SW mode.
- - ranges: the child address space are mapped 1:1 onto the parent address space
-
-Optional Properties:
- - extcon : phandle for the extcon device omap dwc3 uses to detect
-   connect/disconnect events.
- - vbus-supply : phandle to the regulator device tree node if needed.
-
-Sub-nodes:
-The dwc3 core should be added as subnode to omap dwc3 glue.
-- dwc3 :
-   The binding details of dwc3 can be found in:
-   Documentation/devicetree/bindings/usb/snps,dwc3.yaml
-
-omap_dwc3 {
-	compatible = "ti,dwc3";
-	ti,hwmods = "usb_otg_ss";
-	reg = <0x4a020000 0x1ff>;
-	interrupts = <0 93 4>;
-	#address-cells = <1>;
-	#size-cells = <1>;
-	utmi-mode = <2>;
-	ranges;
-};
-
Documentation/devicetree/bindings/usb/ti,dwc3.yaml new file +112 -0

112 lines not on this page · raw message

Signature · 1 line
2.52.0
maintainer
#2 lore raw

Re: [PATCH 1/2] dt-bindings: usb: ti,omap4-musb: convert to DT schema

In reply to Charan Pedumuru
Quoted 20 lines · Charan Pedumuru

Convert OMAP MUSB USB OTG Controller binding to DT schema. Changes during conversion:
- Introduce new compatible string patterns "am35x_otg_hs" and "usb_otg_hs" to properly match existing nodes already defined in the DT sources.
- Include "interrupts" and "interrupt-names" properties in the YAML, as they are used by many in-tree DTS files.
- Extend the "power" property to allow the value 150 (in addition to existing values), since this is present in several in-tree DTS examples.

---
 .../devicetree/bindings/usb/ti,omap4-musb.yaml     | 133 +++++++++++++++++++++
 1 file changed, 133 insertions(+)
Documentation/devicetree/bindings/usb/ti,omap4-musb.yaml new file +0 -0
new file mode 100644
index 000000000000..16e95fe4c38d

Documentation/devicetree/bindings/usb/ti,omap4-musb.yaml line 10

Quoted 10 lines
Documentation/devicetree/bindings/usb/ti,omap4-musb.yaml new file +10 -0
@@ -0,0 +1,133 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/usb/ti,omap4-musb.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Texas Instruments OMAP MUSB USB OTG Controller
+
+maintainers:
+  - Felipe Balbi <[email protected]

Missing '>'

Documentation/devicetree/bindings/usb/ti,omap4-musb.yaml line 22

Quoted 12 lines
Documentation/devicetree/bindings/usb/ti,omap4-musb.yaml new file +12 -0
+
+description:
+  Texas Instruments glue layer for the Mentor Graphics MUSB OTG controller.
+  Handles SoC-specific integration including PHY interface bridging(ULPI/
+  UTMI), interrupt aggregation, DMA engine coordination (internal/
+  external), VBUS/session control via control module mailbox, and
+  clock/reset management. Provides fixed hardware configuration parameters
+  to the generic MUSB core driver.
+
+properties:
+  $nodename:
+    pattern: "^(am35x_otg_hs|usb_otg_hs|usb)@[0-9a-f]+$"

Again, do not document non-standard names. That's anything not in the DT spec.

Quoted 7 lines
Documentation/devicetree/bindings/usb/ti,omap4-musb.yaml new file +7 -0
+
+  compatible:
+    enum:
+      - ti,omap3-musb
+      - ti,omap4-musb
+
+  reg:

Documentation/devicetree/bindings/usb/ti,omap4-musb.yaml line 39

Quoted 10 lines
Documentation/devicetree/bindings/usb/ti,omap4-musb.yaml new file +10 -0
+    maxItems: 1
+
+  ti,hwmods:
+    $ref: /schemas/types.yaml#/definitions/string
+    description:
+      Specifies the name of the TI PRCM (Power, Reset and Clock Management)
+      hardware module that must be enabled (powered and clocked) for this
+      device node to operate. The value "usb_otg_hs" refers to the USB
+      On-The-Go High-Speed controller IP block.
+    const: usb_otg_hs

deprecated: true

(I think we want that everywhere?)

Actually, looks like only omap2430 sets this, but that's not covered by this schema. Unless you need to add "ti,omap2-musb"?

Documentation/devicetree/bindings/usb/ti,omap4-musb.yaml line 49

Quoted 10 lines
Documentation/devicetree/bindings/usb/ti,omap4-musb.yaml new file +10 -0
+
+  interrupts:
+    minItems: 1
+    maxItems: 2
+
+  interrupt-names:
+    minItems: 1
+    maxItems: 2
+    items:
+      enum: [mc, dma]

I would assume only 'dma' is optional? Does this work?:

items:
- const: mc
- const: dma

Quoted 28 lines
Documentation/devicetree/bindings/usb/ti,omap4-musb.yaml new file +28 -0
+
+  multipoint:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Indicates the MUSB controller supports multipoint. This is a MUSB
+      configuration-specific setting.
+    const: 1
+
+  num-eps:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Specifies the number of endpoints. This is a MUSB configuration
+      specific setting.
+    const: 16
+
+  ram-bits:
+    description:
+      Specifies the RAM address size.
+    const: 12
+
+  interface-type:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Describes the type of interface between the controller and the PHY.
+      0 for ULPI, 1 for UTMI.
+    enum: [0, 1]
+
+  mode:

Documentation/devicetree/bindings/usb/ti,omap4-musb.yaml line 87

Quoted 10 lines
Documentation/devicetree/bindings/usb/ti,omap4-musb.yaml new file +10 -0
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: 1 for HOST, 2 for PERIPHERAL, 3 for OTG.
+    enum: [1, 2, 3]
+
+  power:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Signifies the controller can supply up to 100mA when operating
+      in host mode.
+    enum: [50, 150]

Which value corresponds to 100mA?

Quoted 19 lines
Documentation/devicetree/bindings/usb/ti,omap4-musb.yaml new file +19 -0
+
+  phys:
+    maxItems: 1
+
+  phy-names:
+    const: usb2-phy
+
+  usb-phy:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+    description: Phandle for the PHY device.
+    deprecated: true
+
+  ctrl-module:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description:
+      Phandle of the control module this glue uses to write to mailbox.
+
+required:
+  - reg

Documentation/devicetree/bindings/usb/ti,omap4-musb.yaml line 116

Quoted 10 lines
Documentation/devicetree/bindings/usb/ti,omap4-musb.yaml new file +10 -0
+  - compatible
+  - interrupts
+  - interrupt-names
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    usb_otg_hs@4a0ab000 {

usb@...

Quoted 21 lines
Documentation/devicetree/bindings/usb/ti,omap4-musb.yaml new file +17 -0
+        compatible = "ti,omap4-musb";
+        reg = <0x4a0ab000 0x1000>;
+        interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>;
+        interrupt-names = "mc", "dma";
+        ti,hwmods = "usb_otg_hs";
+        multipoint = <1>;
+        num-eps = <16>;
+        ram-bits = <12>;
+        ctrl-module = <&omap_control_usb>;
+        phys = <&usb2_phy>;
+        phy-names = "usb2-phy";
+        interface-type = <1>;
+        mode = <3>;
+        power = <50>;
+    };
+...
Signature · 2 lines
-- 
2.52.0
maintainer
#5 lore raw

Re: [PATCH 2/2] dt-bindings: usb: ti,dwc3: convert to DT schema

In reply to Charan Pedumuru
Quoted 115 lines · Charan Pedumuru

Convert OMAP DWC3 USB Glue Layer binding to DT schema. Changes during conversion:
- Introduce a new compatible string pattern "omap_dwc3" to match nodes already present in existing device tree sources.

---
 Documentation/devicetree/bindings/usb/omap-usb.txt |  80 ---------------
 Documentation/devicetree/bindings/usb/ti,dwc3.yaml | 112 +++++++++++++++++++++
 2 files changed, 112 insertions(+), 80 deletions(-)
Documentation/devicetree/bindings/usb/omap-usb.txt deleted +0 -80
deleted file mode 100644
index f0dbc5ae45ae..000000000000
@@ -1,80 +0,0 @@
-OMAP GLUE AND OTHER OMAP SPECIFIC COMPONENTS
-
-OMAP MUSB GLUE
- - compatible : Should be "ti,omap4-musb" or "ti,omap3-musb"
- - ti,hwmods : must be "usb_otg_hs"
- - multipoint : Should be "1" indicating the musb controller supports
-   multipoint. This is a MUSB configuration-specific setting.
- - num-eps : Specifies the number of endpoints. This is also a
-   MUSB configuration-specific setting. Should be set to "16"
- - ram-bits : Specifies the ram address size. Should be set to "12"
- - interface-type : This is a board specific setting to describe the type of
-   interface between the controller and the phy. It should be "0" or "1"
-   specifying ULPI and UTMI respectively.
- - mode : Should be "3" to represent OTG. "1" signifies HOST and "2"
-   represents PERIPHERAL.
- - power : Should be "50". This signifies the controller can supply up to
-   100mA when operating in host mode.
- - usb-phy : the phandle for the PHY device
- - phys : the phandle for the PHY device (used by generic PHY framework)
- - phy-names : the names of the PHY corresponding to the PHYs present in the
-   *phy* phandle.
-
-Optional properties:
- - ctrl-module : phandle of the control module this glue uses to write to
-   mailbox
-
-SOC specific device node entry
-usb_otg_hs: usb_otg_hs@4a0ab000 {
-	compatible = "ti,omap4-musb";
-	ti,hwmods = "usb_otg_hs";
-	multipoint = <1>;
-	num-eps = <16>;
-	ram-bits = <12>;
-	ctrl-module = <&omap_control_usb>;
-	phys = <&usb2_phy>;
-	phy-names = "usb2-phy";
-};
-
-Board specific device node entry
-&usb_otg_hs {
-	interface-type = <1>;
-	mode = <3>;
-	power = <50>;
-};
-
-OMAP DWC3 GLUE
- - compatible : Should be
-	* "ti,dwc3" for OMAP5 and DRA7
-	* "ti,am437x-dwc3" for AM437x
- - ti,hwmods : Should be "usb_otg_ss"
- - reg : Address and length of the register set for the device.
- - interrupts : The irq number of this device that is used to interrupt the
-   MPU
- - #address-cells, #size-cells : Must be present if the device has sub-nodes
- - utmi-mode : controls the source of UTMI/PIPE status for VBUS and OTG ID.
-   It should be set to "1" for HW mode and "2" for SW mode.
- - ranges: the child address space are mapped 1:1 onto the parent address space
-
-Optional Properties:
- - extcon : phandle for the extcon device omap dwc3 uses to detect
-   connect/disconnect events.
- - vbus-supply : phandle to the regulator device tree node if needed.
-
-Sub-nodes:
-The dwc3 core should be added as subnode to omap dwc3 glue.
-- dwc3 :
-   The binding details of dwc3 can be found in:
-   Documentation/devicetree/bindings/usb/snps,dwc3.yaml
-
-omap_dwc3 {
-	compatible = "ti,dwc3";
-	ti,hwmods = "usb_otg_ss";
-	reg = <0x4a020000 0x1ff>;
-	interrupts = <0 93 4>;
-	#address-cells = <1>;
-	#size-cells = <1>;
-	utmi-mode = <2>;
-	ranges;
-};
-
Documentation/devicetree/bindings/usb/ti,dwc3.yaml new file +12 -0
new file mode 100644
index 000000000000..859da4b1f207
@@ -0,0 +1,112 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/usb/ti,dwc3.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Texas Instruments OMAP DWC3 USB Glue Layer
+
+maintainers:
+  - Felipe Balbi <[email protected]>
+
+description:

Documentation/devicetree/bindings/usb/ti,dwc3.yaml line 22

Quoted 10 lines
Documentation/devicetree/bindings/usb/ti,dwc3.yaml new file +10 -0
+  Texas Instruments glue layer for Synopsys DesignWare USB3 (DWC3)
+  controller on OMAP and AM43xx SoCs. Manages SoC-specific integration
+  including register mapping, interrupt routing, UTMI/PIPE interface mode
+  selection (HW/SW), and child DWC3 core instantiation via address space
+  translation. Supports both legacy single-instance and multi-instance
+  (numbered) configurations.
+
+properties:
+  $nodename:
+    pattern: "^omap_dwc3(_[0-9]+)?@.*$"

Drop.

Quoted 4 lines
Documentation/devicetree/bindings/usb/ti,dwc3.yaml new file +4 -0
+
+  compatible:
+    enum:
+      - ti,dwc3

Documentation/devicetree/bindings/usb/ti,dwc3.yaml line 36

Quoted 10 lines
Documentation/devicetree/bindings/usb/ti,dwc3.yaml new file +10 -0
+      - ti,am437x-dwc3
+
+  ti,hwmods:
+    $ref: /schemas/types.yaml#/definitions/string
+    description:
+      TI PRCM hardware module name that must be enabled (powered and
+      clocked) for this node. "usb_otg_ss" refers to the SuperSpeed
+      (USB3 + USB2 OTG) controller wrapper/glue layer found in OMAP5,
+      DRA7, AM57x, and similar TI SoCs using DWC3.
+    const: usb_otg_ss

Drop. Not used anywhere.

Quoted 80 lines
Documentation/devicetree/bindings/usb/ti,dwc3.yaml new file +76 -0
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  utmi-mode:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Controls the source of UTMI/PIPE status for VBUS and OTG ID.
+      1 for HW mode, 2 for SW mode.
+    enum: [1, 2]
+
+  "#address-cells":
+    const: 1
+
+  "#size-cells":
+    const: 1
+
+  ranges: true
+
+  extcon:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description:
+      Phandle for the extcon device used to detect connect/
+      disconnect events.
+
+  vbus-supply:
+    description: Phandle to the regulator device tree node if needed.
+
+patternProperties:
+  "^usb@[0-9a-f]+$":
+    type: object
+    $ref: snps,dwc3.yaml#
+    unevaluatedProperties: false
+
+required:
+  - reg
+  - compatible
+  - interrupts
+  - "#address-cells"
+  - "#size-cells"
+  - utmi-mode
+  - ranges
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    omap_dwc3_1@0 {
+        compatible = "ti,dwc3";
+        reg = <0x0 0x10000>;
+        interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>;
+        #address-cells = <1>;
+        #size-cells = <1>;
+        utmi-mode = <2>;
+        ranges = <0 0 0x20000>;
+
+        usb@10000 {
+            compatible = "snps,dwc3";
+            reg = <0x10000 0x17000>;
+            interrupts = <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>;
+            interrupt-names = "peripheral", "host", "otg";
+            phys = <&usb2_phy1>, <&usb3_phy1>;
+            phy-names = "usb2-phy", "usb3-phy";
+            maximum-speed = "super-speed";
+            dr_mode = "otg";
+            snps,dis_u3_susphy_quirk;
+            snps,dis_u2_susphy_quirk;
+        };
+    };
+...
Signature · 2 lines
-- 
2.52.0
#6 lore raw

Re: [PATCH 2/2] dt-bindings: usb: ti,dwc3: convert to DT schema

Quoted 120 lines · Rob Herring
Quoted 119 lines · Charan Pedumuru

Convert OMAP DWC3 USB Glue Layer binding to DT schema. Changes during conversion:
- Introduce a new compatible string pattern "omap_dwc3" to match nodes already present in existing device tree sources.

---
 Documentation/devicetree/bindings/usb/omap-usb.txt |  80 ---------------
 Documentation/devicetree/bindings/usb/ti,dwc3.yaml | 112 +++++++++++++++++++++
 2 files changed, 112 insertions(+), 80 deletions(-)
Documentation/devicetree/bindings/usb/omap-usb.txt deleted +0 -80
deleted file mode 100644
index f0dbc5ae45ae..000000000000
@@ -1,80 +0,0 @@
-OMAP GLUE AND OTHER OMAP SPECIFIC COMPONENTS
-
-OMAP MUSB GLUE
- - compatible : Should be "ti,omap4-musb" or "ti,omap3-musb"
- - ti,hwmods : must be "usb_otg_hs"
- - multipoint : Should be "1" indicating the musb controller supports
-   multipoint. This is a MUSB configuration-specific setting.
- - num-eps : Specifies the number of endpoints. This is also a
-   MUSB configuration-specific setting. Should be set to "16"
- - ram-bits : Specifies the ram address size. Should be set to "12"
- - interface-type : This is a board specific setting to describe the type of
-   interface between the controller and the phy. It should be "0" or "1"
-   specifying ULPI and UTMI respectively.
- - mode : Should be "3" to represent OTG. "1" signifies HOST and "2"
-   represents PERIPHERAL.
- - power : Should be "50". This signifies the controller can supply up to
-   100mA when operating in host mode.
- - usb-phy : the phandle for the PHY device
- - phys : the phandle for the PHY device (used by generic PHY framework)
- - phy-names : the names of the PHY corresponding to the PHYs present in the
-   *phy* phandle.
-
-Optional properties:
- - ctrl-module : phandle of the control module this glue uses to write to
-   mailbox
-
-SOC specific device node entry
-usb_otg_hs: usb_otg_hs@4a0ab000 {
-	compatible = "ti,omap4-musb";
-	ti,hwmods = "usb_otg_hs";
-	multipoint = <1>;
-	num-eps = <16>;
-	ram-bits = <12>;
-	ctrl-module = <&omap_control_usb>;
-	phys = <&usb2_phy>;
-	phy-names = "usb2-phy";
-};
-
-Board specific device node entry
-&usb_otg_hs {
-	interface-type = <1>;
-	mode = <3>;
-	power = <50>;
-};
-
-OMAP DWC3 GLUE
- - compatible : Should be
-	* "ti,dwc3" for OMAP5 and DRA7
-	* "ti,am437x-dwc3" for AM437x
- - ti,hwmods : Should be "usb_otg_ss"
- - reg : Address and length of the register set for the device.
- - interrupts : The irq number of this device that is used to interrupt the
-   MPU
- - #address-cells, #size-cells : Must be present if the device has sub-nodes
- - utmi-mode : controls the source of UTMI/PIPE status for VBUS and OTG ID.
-   It should be set to "1" for HW mode and "2" for SW mode.
- - ranges: the child address space are mapped 1:1 onto the parent address space
-
-Optional Properties:
- - extcon : phandle for the extcon device omap dwc3 uses to detect
-   connect/disconnect events.
- - vbus-supply : phandle to the regulator device tree node if needed.
-
-Sub-nodes:
-The dwc3 core should be added as subnode to omap dwc3 glue.
-- dwc3 :
-   The binding details of dwc3 can be found in:
-   Documentation/devicetree/bindings/usb/snps,dwc3.yaml
-
-omap_dwc3 {
-	compatible = "ti,dwc3";
-	ti,hwmods = "usb_otg_ss";
-	reg = <0x4a020000 0x1ff>;
-	interrupts = <0 93 4>;
-	#address-cells = <1>;
-	#size-cells = <1>;
-	utmi-mode = <2>;
-	ranges;
-};
-
Documentation/devicetree/bindings/usb/ti,dwc3.yaml new file +16 -0
new file mode 100644
index 000000000000..859da4b1f207
@@ -0,0 +1,112 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/usb/ti,dwc3.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Texas Instruments OMAP DWC3 USB Glue Layer
+
+maintainers:
+  - Felipe Balbi <[email protected]>
+
+description:
+  Texas Instruments glue layer for Synopsys DesignWare USB3 (DWC3)
+  controller on OMAP and AM43xx SoCs. Manages SoC-specific integration
+  including register mapping, interrupt routing, UTMI/PIPE interface mode
+  selection (HW/SW), and child DWC3 core instantiation via address space
Quoted 8 lines

Documentation/devicetree/bindings/usb/ti,dwc3.yaml line 22

Quoted 6 lines
Documentation/devicetree/bindings/usb/ti,dwc3.yaml new file +6 -0
+  translation. Supports both legacy single-instance and multi-instance
+  (numbered) configurations.
+
+properties:
+  $nodename:
+    pattern: "^omap_dwc3(_[0-9]+)?@.*$"

Drop.

Sure.

Quoted 17 lines
Quoted 5 lines
Documentation/devicetree/bindings/usb/ti,dwc3.yaml new file +4 -0
+
+  compatible:
+    enum:
+      - ti,dwc3

Documentation/devicetree/bindings/usb/ti,dwc3.yaml line 36

Quoted 10 lines
Documentation/devicetree/bindings/usb/ti,dwc3.yaml new file +10 -0
+      - ti,am437x-dwc3
+
+  ti,hwmods:
+    $ref: /schemas/types.yaml#/definitions/string
+    description:
+      TI PRCM hardware module name that must be enabled (powered and
+      clocked) for this node. "usb_otg_ss" refers to the SuperSpeed
+      (USB3 + USB2 OTG) controller wrapper/glue layer found in OMAP5,
+      DRA7, AM57x, and similar TI SoCs using DWC3.
+    const: usb_otg_ss

Drop. Not used anywhere.

Okay.

Quoted 81 lines
Quoted 81 lines
Documentation/devicetree/bindings/usb/ti,dwc3.yaml new file +76 -0
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  utmi-mode:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Controls the source of UTMI/PIPE status for VBUS and OTG ID.
+      1 for HW mode, 2 for SW mode.
+    enum: [1, 2]
+
+  "#address-cells":
+    const: 1
+
+  "#size-cells":
+    const: 1
+
+  ranges: true
+
+  extcon:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description:
+      Phandle for the extcon device used to detect connect/
+      disconnect events.
+
+  vbus-supply:
+    description: Phandle to the regulator device tree node if needed.
+
+patternProperties:
+  "^usb@[0-9a-f]+$":
+    type: object
+    $ref: snps,dwc3.yaml#
+    unevaluatedProperties: false
+
+required:
+  - reg
+  - compatible
+  - interrupts
+  - "#address-cells"
+  - "#size-cells"
+  - utmi-mode
+  - ranges
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    omap_dwc3_1@0 {
+        compatible = "ti,dwc3";
+        reg = <0x0 0x10000>;
+        interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>;
+        #address-cells = <1>;
+        #size-cells = <1>;
+        utmi-mode = <2>;
+        ranges = <0 0 0x20000>;
+
+        usb@10000 {
+            compatible = "snps,dwc3";
+            reg = <0x10000 0x17000>;
+            interrupts = <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>;
+            interrupt-names = "peripheral", "host", "otg";
+            phys = <&usb2_phy1>, <&usb3_phy1>;
+            phy-names = "usb2-phy", "usb3-phy";
+            maximum-speed = "super-speed";
+            dr_mode = "otg";
+            snps,dis_u3_susphy_quirk;
+            snps,dis_u2_susphy_quirk;
+        };
+    };
+...
Signature · 2 lines
-- 
2.52.0
Signature · 2 lines
Best Regards,
Charan.
#3 lore raw

Re: [PATCH 1/2] dt-bindings: usb: ti,omap4-musb: convert to DT schema

In reply to Rob Herring
Quoted 25 lines · Rob Herring
Quoted 24 lines · Charan Pedumuru

Convert OMAP MUSB USB OTG Controller binding to DT schema. Changes during conversion:
- Introduce new compatible string patterns "am35x_otg_hs" and "usb_otg_hs" to properly match existing nodes already defined in the DT sources.
- Include "interrupts" and "interrupt-names" properties in the YAML, as they are used by many in-tree DTS files.
- Extend the "power" property to allow the value 150 (in addition to existing values), since this is present in several in-tree DTS examples.

---
 .../devicetree/bindings/usb/ti,omap4-musb.yaml     | 133 +++++++++++++++++++++
 1 file changed, 133 insertions(+)
Documentation/devicetree/bindings/usb/ti,omap4-musb.yaml new file +4 -0
new file mode 100644
index 000000000000..16e95fe4c38d
@@ -0,0 +1,133 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/usb/ti,omap4-musb.yaml#
Quoted 8 lines

Documentation/devicetree/bindings/usb/ti,omap4-musb.yaml line 10

Quoted 6 lines
Documentation/devicetree/bindings/usb/ti,omap4-musb.yaml new file +6 -0
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Texas Instruments OMAP MUSB USB OTG Controller
+
+maintainers:
+  - Felipe Balbi <[email protected]

Missing '>'

Yeah, I missed it, will add in the next rev.

Quoted 16 lines

Documentation/devicetree/bindings/usb/ti,omap4-musb.yaml line 22

Quoted 13 lines
Documentation/devicetree/bindings/usb/ti,omap4-musb.yaml new file +12 -0
+
+description:
+  Texas Instruments glue layer for the Mentor Graphics MUSB OTG controller.
+  Handles SoC-specific integration including PHY interface bridging(ULPI/
+  UTMI), interrupt aggregation, DMA engine coordination (internal/
+  external), VBUS/session control via control module mailbox, and
+  clock/reset management. Provides fixed hardware configuration parameters
+  to the generic MUSB core driver.
+
+properties:
+  $nodename:
+    pattern: "^(am35x_otg_hs|usb_otg_hs|usb)@[0-9a-f]+$"

Again, do not document non-standard names. That's anything not in the DT spec.

Sure, I will remove pattern entirely.

Quoted 21 lines
Quoted 8 lines
Documentation/devicetree/bindings/usb/ti,omap4-musb.yaml new file +7 -0
+
+  compatible:
+    enum:
+      - ti,omap3-musb
+      - ti,omap4-musb
+
+  reg:

Documentation/devicetree/bindings/usb/ti,omap4-musb.yaml line 39

Quoted 10 lines
Documentation/devicetree/bindings/usb/ti,omap4-musb.yaml new file +10 -0
+    maxItems: 1
+
+  ti,hwmods:
+    $ref: /schemas/types.yaml#/definitions/string
+    description:
+      Specifies the name of the TI PRCM (Power, Reset and Clock Management)
+      hardware module that must be enabled (powered and clocked) for this
+      device node to operate. The value "usb_otg_hs" refers to the USB
+      On-The-Go High-Speed controller IP block.
+    const: usb_otg_hs

deprecated: true

Quoted 4 lines

(I think we want that everywhere?)

Actually, looks like only omap2430 sets this, but that's not covered by this schema. Unless you need to add "ti,omap2-musb"?

Okay, in that case I will drop the property.

Quoted 14 lines

Documentation/devicetree/bindings/usb/ti,omap4-musb.yaml line 49

Quoted 11 lines
Documentation/devicetree/bindings/usb/ti,omap4-musb.yaml new file +10 -0
+
+  interrupts:
+    minItems: 1
+    maxItems: 2
+
+  interrupt-names:
+    minItems: 1
+    maxItems: 2
+    items:
+      enum: [mc, dma]

I would assume only 'dma' is optional? Does this work?:

Quoted 3 lines

items:
- const: mc
- const: dma

Yes, this works.

Quoted 33 lines
Quoted 33 lines
Documentation/devicetree/bindings/usb/ti,omap4-musb.yaml new file +32 -0
+
+  multipoint:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Indicates the MUSB controller supports multipoint. This is a MUSB
+      configuration-specific setting.
+    const: 1
+
+  num-eps:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Specifies the number of endpoints. This is a MUSB configuration
+      specific setting.
+    const: 16
+
+  ram-bits:
+    description:
+      Specifies the RAM address size.
+    const: 12
+
+  interface-type:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Describes the type of interface between the controller and the PHY.
+      0 for ULPI, 1 for UTMI.
+    enum: [0, 1]
+
+  mode:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: 1 for HOST, 2 for PERIPHERAL, 3 for OTG.
+    enum: [1, 2, 3]
+
Quoted 8 lines

Documentation/devicetree/bindings/usb/ti,omap4-musb.yaml line 87

Quoted 6 lines
Documentation/devicetree/bindings/usb/ti,omap4-musb.yaml new file +6 -0
+  power:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Signifies the controller can supply up to 100mA when operating
+      in host mode.
+    enum: [50, 150]

Which value corresponds to 100mA?

50 corresponds to 100mA, I will add it to the description.

Quoted 24 lines
Quoted 24 lines
Documentation/devicetree/bindings/usb/ti,omap4-musb.yaml new file +23 -0
+
+  phys:
+    maxItems: 1
+
+  phy-names:
+    const: usb2-phy
+
+  usb-phy:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+    description: Phandle for the PHY device.
+    deprecated: true
+
+  ctrl-module:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description:
+      Phandle of the control module this glue uses to write to mailbox.
+
+required:
+  - reg
+  - compatible
+  - interrupts
+  - interrupt-names
+
Quoted 8 lines

Documentation/devicetree/bindings/usb/ti,omap4-musb.yaml line 116

Quoted 6 lines
Documentation/devicetree/bindings/usb/ti,omap4-musb.yaml new file +6 -0
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    usb_otg_hs@4a0ab000 {

usb@...

Okay.

Quoted 22 lines
Quoted 22 lines
Documentation/devicetree/bindings/usb/ti,omap4-musb.yaml new file +17 -0
+        compatible = "ti,omap4-musb";
+        reg = <0x4a0ab000 0x1000>;
+        interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>;
+        interrupt-names = "mc", "dma";
+        ti,hwmods = "usb_otg_hs";
+        multipoint = <1>;
+        num-eps = <16>;
+        ram-bits = <12>;
+        ctrl-module = <&omap_control_usb>;
+        phys = <&usb2_phy>;
+        phy-names = "usb2-phy";
+        interface-type = <1>;
+        mode = <3>;
+        power = <50>;
+    };
+...
Signature · 2 lines
-- 
2.52.0
Signature · 2 lines
Best Regards,
Charan.