Skip to contentSkip to conversation

dt-bindings: usb: atmel: convert Atmel USB controller bindings to YAML

PATCH Superseded Charan Pedumuru 2 participants 12 messages Feb 24 – Mar 10

Subsystems (3)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v2 cover dt-bindings: usb: atmel: convert Atmel USB controller bindings to YAML

This patch series converts the legacy text-based Device Tree bindings for Atmel/Microchip USB controllers to DT schema (YAML) format.

---
Changes in v2:
- Drop the separate YAML patches for OHCI and EHCI.
- Add the compatibles "atmel,at91rm9200-ohci" and "atmel,at91sam9g45-ehci" to the existing generic OHCI and EHCI binding files.
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Charan Pedumuru (4):
dt-bindings: usb: generic-ohci: add AT91RM9200 OHCI binding support
dt-bindings: usb: generic-ehci: fix schema structure and add at91sam9g45 constraints
dt-bindings: usb: atmel,at91rm9200-udc: convert to DT schema
dt-bindings: usb: atmel,at91sam9rl-udc: convert to DT schema

 .../bindings/usb/atmel,at91rm9200-udc.yaml         |  77 +++++++++++++
 .../bindings/usb/atmel,at91sam9rl-udc.yaml         |  81 +++++++++++++
 .../devicetree/bindings/usb/atmel-usb.txt          | 125 ---------------------
 .../devicetree/bindings/usb/generic-ehci.yaml      |  46 +++++---
 .../devicetree/bindings/usb/generic-ohci.yaml      |  27 +++++
 5 files changed, 218 insertions(+), 138 deletions(-)

---
base-commit: 3f24e4edcd1b8981c6b448ea2680726dedd87279
change-id: 20260129-atmel-usb-37f89a141e48

Best regards,

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

PATCH v2 1/4 dt-bindings: usb: generic-ohci: add AT91RM9200 OHCI binding support

Add binding support for the Atmel AT91RM9200 OHCI USB host controller to the generic OHCI schema.

---
 .../devicetree/bindings/usb/generic-ohci.yaml      | 27 ++++++++++++++++++++++
 1 file changed, 27 insertions(+)
Documentation/devicetree/bindings/usb/generic-ohci.yaml +27 -0
index 961cbf85eeb5..ab8a49142386 100644
@@ -55,6 +55,7 @@ properties:
           - ti,ohci-omap3
       - items:
           - enum:
+              - atmel,at91rm9200-ohci
               - cavium,octeon-6335-ohci
               - nintendo,hollywood-usb-ohci
               - nxp,ohci-nxp
@@ -137,6 +138,16 @@ properties:
       The associated ISP1301 device. Necessary for the UDC controller for
       connecting to the USB physical layer.
 
+  atmel,vbus-gpio:
+    description: GPIO used to control or sense the USB VBUS power.
+    minItems: 1
+    maxItems: 3
+
+  atmel,oc-gpio:
+    description: GPIO used to signal USB overcurrent condition.
+    minItems: 1
+    maxItems: 3
+
 required:
   - compatible
   - reg
@@ -144,6 +155,22 @@ required:
 
 allOf:
   - $ref: usb-hcd.yaml
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: atmel,at91rm9200-ohci
+    then:
+      properties:
+        clock-names:
+          items:
+            - const: ohci_clk
+            - const: hclk
+            - const: uhpck
+
+      required:
+        - clocks
+        - clock-names
   - if:
       not:
         properties:
Signature · 1 line
2.53.0
maintainer
#2 lore raw

Re: [PATCH v2 1/4] dt-bindings: usb: generic-ohci: add AT91RM9200 OHCI binding support

Quoted 47 lines · Charan Pedumuru

Add binding support for the Atmel AT91RM9200 OHCI USB host controller to the generic OHCI schema.

---
 .../devicetree/bindings/usb/generic-ohci.yaml      | 27 ++++++++++++++++++++++
 1 file changed, 27 insertions(+)
Documentation/devicetree/bindings/usb/generic-ohci.yaml +17 -0
index 961cbf85eeb5..ab8a49142386 100644
@@ -55,6 +55,7 @@ properties:
           - ti,ohci-omap3
       - items:
           - enum:
+              - atmel,at91rm9200-ohci
               - cavium,octeon-6335-ohci
               - nintendo,hollywood-usb-ohci
               - nxp,ohci-nxp
@@ -137,6 +138,16 @@ properties:
       The associated ISP1301 device. Necessary for the UDC controller for
       connecting to the USB physical layer.
 
+  atmel,vbus-gpio:
+    description: GPIO used to control or sense the USB VBUS power.
+    minItems: 1
+    maxItems: 3
+
+  atmel,oc-gpio:
+    description: GPIO used to signal USB overcurrent condition.
+    minItems: 1
+    maxItems: 3
+
 required:
   - compatible
   - reg
@@ -144,6 +155,22 @@ required:
 
 allOf:
   - $ref: usb-hcd.yaml
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: atmel,at91rm9200-ohci
+    then:

Documentation/devicetree/bindings/usb/generic-ohci.yaml required: · line 173

Quoted 10 lines
Documentation/devicetree/bindings/usb/generic-ohci.yaml +10 -0
+      properties:
+        clock-names:
+          items:
+            - const: ohci_clk
+            - const: hclk
+            - const: uhpck
+
+      required:
+        - clocks
+        - clock-names

else:
properties:
atmel,vbus-gpio: false
atmel,oc-gpio: false

Quoted 7 lines
Documentation/devicetree/bindings/usb/generic-ohci.yaml +0 -0
   - if:
       not:
         properties:
Signature · 2 lines
-- 
2.53.0
#3 lore raw

Re: [PATCH v2 1/4] dt-bindings: usb: generic-ohci: add AT91RM9200 OHCI binding support

Quoted 55 lines · Rob Herring
Quoted 54 lines · Charan Pedumuru

Add binding support for the Atmel AT91RM9200 OHCI USB host controller to the generic OHCI schema.

---
 .../devicetree/bindings/usb/generic-ohci.yaml      | 27 ++++++++++++++++++++++
 1 file changed, 27 insertions(+)
Documentation/devicetree/bindings/usb/generic-ohci.yaml +24 -0
index 961cbf85eeb5..ab8a49142386 100644
@@ -55,6 +55,7 @@ properties:
           - ti,ohci-omap3
       - items:
           - enum:
+              - atmel,at91rm9200-ohci
               - cavium,octeon-6335-ohci
               - nintendo,hollywood-usb-ohci
               - nxp,ohci-nxp
@@ -137,6 +138,16 @@ properties:
       The associated ISP1301 device. Necessary for the UDC controller for
       connecting to the USB physical layer.
 
+  atmel,vbus-gpio:
+    description: GPIO used to control or sense the USB VBUS power.
+    minItems: 1
+    maxItems: 3
+
+  atmel,oc-gpio:
+    description: GPIO used to signal USB overcurrent condition.
+    minItems: 1
+    maxItems: 3
+
 required:
   - compatible
   - reg
@@ -144,6 +155,22 @@ required:
 
 allOf:
   - $ref: usb-hcd.yaml
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: atmel,at91rm9200-ohci
+    then:
+      properties:
+        clock-names:
+          items:
+            - const: ohci_clk
+            - const: hclk
+            - const: uhpck
+
Quoted 8 lines

Documentation/devicetree/bindings/usb/generic-ohci.yaml required: · line 173

Quoted 3 lines
Documentation/devicetree/bindings/usb/generic-ohci.yaml +3 -0
+      required:
+        - clocks
+        - clock-names

else:
properties:
atmel,vbus-gpio: false
atmel,oc-gpio: false

Sure, I will add it.

Quoted 8 lines
Quoted 8 lines
Documentation/devicetree/bindings/usb/generic-ohci.yaml +0 -0
   - if:
       not:
         properties:
Signature · 2 lines
-- 
2.53.0
Signature · 2 lines
Best Regards,
Charan.
#4 lore raw

PATCH v2 2/4 dt-bindings: usb: generic-ehci: fix schema structure and add at91sam9g45 constraints

In reply to Charan Pedumuru

Add clock and phy constraints for atmel,at91sam9g45-ehci and reorganize the allOf section to fix dtbs_check warnings.

---
 .../devicetree/bindings/usb/generic-ehci.yaml      | 46 ++++++++++++++++------
 1 file changed, 33 insertions(+), 13 deletions(-)
Documentation/devicetree/bindings/usb/generic-ehci.yaml +33 -13
index 601f097c09a6..55a5aa7d7a54 100644
@@ -9,19 +9,6 @@ title: USB EHCI Controller
 maintainers:
   - Greg Kroah-Hartman <[email protected]>
 
-allOf:
-  - $ref: usb-hcd.yaml
-  - if:
-      properties:
-        compatible:
-          not:
-            contains:
-              const: ibm,usb-ehci-440epx
-    then:
-      properties:
-        reg:
-          maxItems: 1
-
 properties:
   compatible:
     oneOf:
@@ -167,6 +154,39 @@ required:
   - reg
   - interrupts
 
+allOf:
+  - $ref: usb-hcd.yaml
+  - if:
+      properties:
+        compatible:
+          not:
+            contains:
+              const: ibm,usb-ehci-440epx
+    then:
+      properties:
+        reg:
+          maxItems: 1
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: atmel,at91sam9g45-ehci
+    then:
+      properties:
+        clock-names:
+          items:
+            - const: usb_clk
+            - const: ehci_clk
+
+        phy_type:
+          enum:
+            - utmi
+            - hsic
+
+      required:
+        - clocks
+        - clock-names
+
 unevaluatedProperties: false
 
 examples:
Signature · 1 line
2.53.0
maintainer Reviewed-by on v2 2/4
#5 lore raw

Re: [PATCH v2 2/4] dt-bindings: usb: generic-ehci: fix schema structure and add at91sam9g45 constraints

Quoted 8 lines · Charan Pedumuru

Add clock and phy constraints for atmel,at91sam9g45-ehci and reorganize the allOf section to fix dtbs_check warnings.

---
 .../devicetree/bindings/usb/generic-ehci.yaml      | 46 ++++++++++++++++------
 1 file changed, 33 insertions(+), 13 deletions(-)
#6 lore raw

PATCH v2 3/4 dt-bindings: usb: atmel,at91rm9200-udc: convert to DT schema

In reply to Charan Pedumuru

Convert Atmel AT91 USB Device Controller (UDC) binding to DT schema. Changes during conversion:
- Include "atmel,pullup-gpio" and "atmel,matrix" in the properties since they are required by existing in-tree DTS definitions.

---
 .../bindings/usb/atmel,at91rm9200-udc.yaml         | 77 ++++++++++++++++++++++
 1 file changed, 77 insertions(+)
Documentation/devicetree/bindings/usb/atmel,at91rm9200-udc.yaml new file +77 -0
new file mode 100644
index 000000000000..6961cd5d5d89
@@ -0,0 +1,77 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/usb/atmel,at91rm9200-udc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Atmel AT91 USB Device Controller (UDC)
+
+maintainers:
+  - Nicolas Ferre <[email protected]>
+  - Alexandre Belloni <[email protected]>
+
+description:
+  The Atmel AT91 USB Device Controller provides USB gadget (device-mode)
+  functionality on AT91 SoCs. It requires a peripheral clock and an AHB
+  clock for operation and may optionally control VBUS power through a GPIO.
+
+properties:
+  compatible:
+    enum:
+      - atmel,at91rm9200-udc
+      - atmel,at91sam9260-udc
+      - atmel,at91sam9261-udc
+      - atmel,at91sam9263-udc
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    minItems: 2
+    maxItems: 2
+
+  clock-names:
+    items:
+      - const: pclk
+      - const: hclk
+
+  atmel,vbus-gpio:
+    description: GPIO used to enable or control VBUS power for the USB bus.
+    maxItems: 1
+
+  atmel,matrix:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: Phandle to the Atmel bus matrix controller.
+
+  atmel,pullup-gpio:
+    description:
+      GPIO controlling the USB D+ pull-up resistor used to signal device
+      connection to the host.
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #include <dt-bindings/clock/at91.h>
+    #include <dt-bindings/gpio/gpio.h>
+    gadget@fffa4000 {
+        compatible = "atmel,at91rm9200-udc";
+        reg = <0xfffa4000 0x4000>;
+        interrupts = <11 IRQ_TYPE_LEVEL_HIGH 2>;
+        clocks = <&udc_clk>, <&udpck>;
+        clock-names = "pclk", "hclk";
+        atmel,vbus-gpio = <&pioC 5 GPIO_ACTIVE_HIGH>;
+    };
+...
Signature · 1 line
2.53.0
maintainer Reviewed-by on v2 3/4
#7 lore raw

Re: [PATCH v2 3/4] dt-bindings: usb: atmel,at91rm9200-udc: convert to DT schema

Quoted 10 lines · Charan Pedumuru

Convert Atmel AT91 USB Device Controller (UDC) binding to DT schema. Changes during conversion:
- Include "atmel,pullup-gpio" and "atmel,matrix" in the properties since they are required by existing in-tree DTS definitions.

---
 .../bindings/usb/atmel,at91rm9200-udc.yaml         | 77 ++++++++++++++++++++++
 1 file changed, 77 insertions(+)
#8 lore raw

PATCH v2 4/4 dt-bindings: usb: atmel,at91sam9rl-udc: convert to DT schema

In reply to Charan Pedumuru

Convert Atmel High-Speed USB Device Controller (USBA) binding to DT schema. Changes during conversion:
- Include "#address-cells" and "#size-cells" in the properties since they are required by existing in-tree DTS definitions.

---
 .../bindings/usb/atmel,at91sam9rl-udc.yaml         |  81 +++++++++++++
 .../devicetree/bindings/usb/atmel-usb.txt          | 125 ---------------------
 2 files changed, 81 insertions(+), 125 deletions(-)
Documentation/devicetree/bindings/usb/atmel,at91sam9rl-udc.yaml new file +81 -0
new file mode 100644
index 000000000000..6f5710cecaee
@@ -0,0 +1,81 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/usb/atmel,at91sam9rl-udc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Atmel High-Speed USB Device Controller (USBA)
+
+maintainers:
+  - Nicolas Ferre <[email protected]>
+  - Alexandre Belloni <[email protected]>
+
+description:
+  The Atmel High-Speed USB Device Controller (USBA) provides USB 2.0
+  high-speed gadget functionality on several Atmel and Microchip SoCs.
+  The controller requires a peripheral clock and a host clock for operation
+  and may optionally use a GPIO to detect VBUS presence.
+
+properties:
+  compatible:
+    oneOf:
+      - enum:
+          - atmel,at91sam9rl-udc
+          - atmel,at91sam9g45-udc
+          - atmel,sama5d3-udc
+      - items:
+          - const: microchip,lan9662-udc
+          - const: atmel,sama5d3-udc
+      - const: microchip,sam9x60-udc
+
+  reg:
+    maxItems: 2
+
+  interrupts:
+    maxItems: 1
+
+  "#address-cells":
+    const: 1
+
+  "#size-cells":
+    const: 0
+
+  clocks:
+    minItems: 2
+    maxItems: 2
+
+  clock-names:
+    minItems: 2
+    maxItems: 2
+    items:
+      enum: [pclk, hclk]
+
+  atmel,vbus-gpio:
+    description: GPIO used to detect the presence of VBUS, indicating that
+      the USB cable is connected.
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #include <dt-bindings/clock/at91.h>
+    #include <dt-bindings/gpio/gpio.h>
+    gadget@fff78000 {
+        compatible = "atmel,at91sam9g45-udc";
+        reg = <0x00600000 0x80000
+               0xfff78000 0x400>;
+        interrupts = <27 IRQ_TYPE_LEVEL_HIGH 0>;
+        clocks = <&pmc PMC_TYPE_PERIPHERAL 27>, <&pmc PMC_TYPE_CORE PMC_UTMI>;
+        clock-names = "pclk", "hclk";
+        atmel,vbus-gpio = <&pioC 15 GPIO_ACTIVE_HIGH>;
+    };
+...
Documentation/devicetree/bindings/usb/atmel-usb.txt deleted +0 -125

125 lines not on this page · raw message

Signature · 1 line
2.53.0
maintainer
#9 lore raw

Re: [PATCH v2 4/4] dt-bindings: usb: atmel,at91sam9rl-udc: convert to DT schema

Quoted 4 lines · Charan Pedumuru

Convert Atmel High-Speed USB Device Controller (USBA) binding to DT schema. Changes during conversion:
- Include "#address-cells" and "#size-cells" in the properties since they are required by existing in-tree DTS definitions.

The DTS files are wrong unless there are child nodes and there aren't. Drop those.

#10 lore raw

Re: [PATCH v2 4/4] dt-bindings: usb: atmel,at91sam9rl-udc: convert to DT schema

Quoted 7 lines · Rob Herring
Quoted 4 lines · Charan Pedumuru

Convert Atmel High-Speed USB Device Controller (USBA) binding to DT schema. Changes during conversion:
- Include "#address-cells" and "#size-cells" in the properties since they are required by existing in-tree DTS definitions.

The DTS files are wrong unless there are child nodes and there aren't.

Yes, there is no child node but these properties are defined in sam9x60.dtsi for the compatible "microchip,sam9x60-udc" and the yaml fails dtbs_check if I remove them, can I send an another patch for removing these properties from sam9x60.dtsi?

Quoted 1 line

Drop those.

Signature · 2 lines
Best Regards,
Charan.
maintainer
#11 lore raw

Re: [PATCH v2 4/4] dt-bindings: usb: atmel,at91sam9rl-udc: convert to DT schema

Quoted 5 lines · Charan Pedumuru
Quoted 1 line · Rob Herring

On Tue, Feb 24, 2026 at 01:13:01PM +0000, Charan Pedumuru wrote:

Quoted 9 lines
Quoted 6 lines
Quoted 4 lines

Convert Atmel High-Speed USB Device Controller (USBA) binding to DT schema. Changes during conversion:
- Include "#address-cells" and "#size-cells" in the properties since they are required by existing in-tree DTS definitions.

The DTS files are wrong unless there are child nodes and there aren't.

Yes, there is no child node but these properties are defined in sam9x60.dtsi for the compatible "microchip,sam9x60-udc" and the yaml fails dtbs_check if I remove them, can I send an another patch for removing these properties from sam9x60.dtsi?

Yes. There's no requirement to fix the .dts files when doing the conversion, but a fix would be nice.

Rob