dt-bindings: usb: atmel: convert Atmel USB controller bindings to YAML
Subsystems (3)
v3 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.
Note:
The patch "dt-bindings: usb: atmel,at91sam9rl-udc: convert to DT schema" depends on the patch "arm: dts: at91: remove unused #address-cells/#size-cells from sam9x60 UDC node". If the DT schema patch is applied before the DTS cleanup patch, dtbs_check will fail due to the presence of the removed properties in the existing DTS.
---
Changes in v3:
- sam9x60: Add a new patch removing the unnecessary #address-cells and #size-cells properties from the sam9x60 UDC node.
- atmel,at91sam9rl-udc: Remove #address-cells and #size-cells from the atmel,at91sam9rl-udc binding properties.
- generic-ohci: Add an else condition to the generic-ohci schema properties for improved validation precision.
- Link to v2: https://lore.kernel.org/r/[email protected]
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 (5):
arm: dts: at91: remove unused #address-cells/#size-cells from sam9x60 udc node
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 | 75 +++++++++++++ .../devicetree/bindings/usb/atmel-usb.txt | 125 --------------------- .../devicetree/bindings/usb/generic-ehci.yaml | 46 +++++--- .../devicetree/bindings/usb/generic-ohci.yaml | 33 ++++++ arch/arm/boot/dts/microchip/sam9x60.dtsi | 2 - 6 files changed, 218 insertions(+), 140 deletions(-)
---
base-commit: 3f24e4edcd1b8981c6b448ea2680726dedd87279
change-id: 20260129-atmel-usb-37f89a141e48
Best regards,
Signature · 1 line
Charan Pedumuru <[email protected]>
PATCH v3 1/5 arm: dts: at91: remove unused #address-cells/#size-cells from sam9x60 udc node
The UDC node does not define any child nodes, so the "#address-cells" and "#size-cells" properties are unnecessary. Remove these unused properties to simplify the devicetree node and keep it consistent with DT conventions.
--- arch/arm/boot/dts/microchip/sam9x60.dtsi | 2 -- 1 file changed, 2 deletions(-)
arch/arm/boot/dts/microchip/sam9x60.dtsi +0 -2
@@ -75,8 +75,6 @@ ahb { ranges; usb0: gadget@500000 { - #address-cells = <1>; - #size-cells = <0>; compatible = "microchip,sam9x60-udc"; reg = <0x00500000 0x100000 0xf803c000 0x400>;
Signature · 1 line
2.53.0
PATCH v3 2/5 dt-bindings: usb: generic-ohci: add AT91RM9200 OHCI binding support
In reply to Charan PedumuruAdd binding support for the Atmel AT91RM9200 OHCI USB host controller to the generic OHCI schema.
--- .../devicetree/bindings/usb/generic-ohci.yaml | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+)
Documentation/devicetree/bindings/usb/generic-ohci.yaml +33 -0
@@ -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,28 @@ 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 + + else: + properties: + atmel,vbus-gpio: false + atmel,oc-gpio: false + - if: not: properties:
Signature · 1 line
2.53.0
PATCH v3 3/5 dt-bindings: usb: generic-ehci: fix schema structure and add at91sam9g45 constraints
In reply to Charan PedumuruAdd 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
@@ -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
PATCH v3 4/5 dt-bindings: usb: atmel,at91rm9200-udc: convert to DT schema
In reply to Charan PedumuruConvert 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
@@ -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
PATCH v3 5/5 dt-bindings: usb: atmel,at91sam9rl-udc: convert to DT schema
In reply to Charan PedumuruConvert Atmel High-Speed USB Device Controller (USBA) binding to DT schema.
--- .../bindings/usb/atmel,at91sam9rl-udc.yaml | 75 +++++++++++++ .../devicetree/bindings/usb/atmel-usb.txt | 125 --------------------- 2 files changed, 75 insertions(+), 125 deletions(-)
Documentation/devicetree/bindings/usb/atmel,at91sam9rl-udc.yaml new file +75 -0
@@ -0,0 +1,75 @@ +# 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 + + 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
Re: [PATCH v3 2/5] dt-bindings: usb: generic-ohci: add AT91RM9200 OHCI binding support
In reply to Charan PedumuruQuoted 21 lines · Charan Pedumuru
Add binding support for the Atmel AT91RM9200 OHCI USB host controller to the generic OHCI schema.
Signed-off-by Charan Pedumuru <[email protected]>--- .../devicetree/bindings/usb/generic-ohci.yaml | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+)Documentation/devicetree/bindings/usb/generic-ohci.yaml +1
-0@@ -55,6 +55,7 @@ properties: - ti,ohci-omap3 - items: - enum: + - atmel,at91rm9200-ohci - cavium,octeon-6335-ohci - nintendo,hollywood-usb-ohci - nxp,ohci-nxp
Documentation/devicetree/bindings/usb/generic-ohci.yaml properties: · line 141
Quoted 4 lines
Documentation/devicetree/bindings/usb/generic-ohci.yaml +1
-0@@ -137,6 +138,16 @@ properties: The associated ISP1301 device. Necessary for the UDC controller for connecting to the USB physical layer. + atmel,vbus-gpio:
gpio is deprecated. All bindings use gpios. Also, pins do not use vendor prefixes.
Documentation/devicetree/bindings/usb/generic-ohci.yaml properties: · line 144
Quoted 3 lines
Documentation/devicetree/bindings/usb/generic-ohci.yaml +3
-0+ description: GPIO used to control or sense the USB VBUS power. + minItems: 1 + maxItems: 3
Why is this flexible? There is only one VBUS, no? Which pin is it exactly on this device?
Documentation/devicetree/bindings/usb/generic-ohci.yaml properties: · line 149
Quoted 5 lines
Documentation/devicetree/bindings/usb/generic-ohci.yaml +5
-0+ + atmel,oc-gpio: + description: GPIO used to signal USB overcurrent condition. + minItems: 1 + maxItems: 3
Same question here - how is the pin called in the schematics?
Quoted 14 lines
Documentation/devicetree/bindings/usb/generic-ohci.yaml +7
-0+ required: - compatible - reg@@ -144,6 +155,28 @@ 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
There is already if:then:else covering clocks, so this makes multiple clauses being applied to same device. That's not really readable. Unfortunately that's a bit of a mess from existing binding. This can be solved by moving this to separate schema, especially that you want to add some specific properties to this device.
Quoted 13 lines
Documentation/devicetree/bindings/usb/generic-ohci.yaml +6
-0+ + else: + properties: + atmel,vbus-gpio: false + atmel,oc-gpio: false + - if: not: properties:Signature · 2 lines
-- 2.53.0
Re: [PATCH v3 4/5] dt-bindings: usb: atmel,at91rm9200-udc: convert to DT schema
In reply to Charan PedumuruQuoted 9 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.Reviewed-by Rob Herring (Arm) <[email protected]>Signed-off-by Charan Pedumuru <[email protected]>--- .../bindings/usb/atmel,at91rm9200-udc.yaml | 77 ++++++++++++++++++++++
Where is the actual conversion? You are supposed to remove other file for this to be a "convert".
Quoted 31 lines
1 file changed, 77 insertions(+)Documentation/devicetree/bindings/usb/atmel,at91rm9200-udc.yaml new file +23
-0@@ -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
Documentation/devicetree/bindings/usb/atmel,at91rm9200-udc.yaml line 33
Quoted 10 lines
Documentation/devicetree/bindings/usb/atmel,at91rm9200-udc.yaml new file +10
-0+ - atmel,at91sam9263-udc + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + minItems: 2
Drop
Quoted 19 lines
Documentation/devicetree/bindings/usb/atmel,at91rm9200-udc.yaml new file +19
-0+ 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.
Documentation/devicetree/bindings/usb/atmel,at91rm9200-udc.yaml line 62
Quoted 10 lines
Documentation/devicetree/bindings/usb/atmel,at91rm9200-udc.yaml new file +10
-0+ maxItems: 1 + +required: + - compatible + - reg + - interrupts + - clocks + - clock-names + +unevaluatedProperties: false
additionalProperties
Best regards,
Krzysztof
Re: [PATCH v3 2/5] dt-bindings: usb: generic-ohci: add AT91RM9200 OHCI binding support
In reply to Krzysztof KozlowskiQuoted 5 lines · Krzysztof Kozlowski
Quoted 4 lines · Charan Pedumuru
Add binding support for the Atmel AT91RM9200 OHCI USB host controller to the generic OHCI schema.
Signed-off-by Charan Pedumuru <[email protected]>
Also:
A nit, subject: drop second/last, redundant "binding support". The "dt-bindings" prefix is already stating that these are bindings. See also:
https://elixir.bootlin.com/linux/v6.17-rc3/source/Documentation/devicetree/bindings/submitting-patches.rst#L18
And you cannot add support for bindings. The DT schema or some kernel Makefile gave that support, not this file.
Quoted 63 lines
Quoted 17 lines
--- .../devicetree/bindings/usb/generic-ohci.yaml | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+)Documentation/devicetree/bindings/usb/generic-ohci.yaml +1
-0@@ -55,6 +55,7 @@ properties: - ti,ohci-omap3 - items: - enum: + - atmel,at91rm9200-ohci - cavium,octeon-6335-ohci - nintendo,hollywood-usb-ohci - nxp,ohci-nxpDocumentation/devicetree/bindings/usb/generic-ohci.yaml properties: · line 141
Quoted 4 lines
Documentation/devicetree/bindings/usb/generic-ohci.yaml +1
-0@@ -137,6 +138,16 @@ properties: The associated ISP1301 device. Necessary for the UDC controller for connecting to the USB physical layer. + atmel,vbus-gpio:gpio is deprecated. All bindings use gpios. Also, pins do not use vendor prefixes.
Documentation/devicetree/bindings/usb/generic-ohci.yaml properties: · line 144
Quoted 3 lines
Documentation/devicetree/bindings/usb/generic-ohci.yaml +3
-0+ description: GPIO used to control or sense the USB VBUS power. + minItems: 1 + maxItems: 3Why is this flexible? There is only one VBUS, no? Which pin is it exactly on this device?
Documentation/devicetree/bindings/usb/generic-ohci.yaml properties: · line 149
Quoted 5 lines
Documentation/devicetree/bindings/usb/generic-ohci.yaml +5
-0+ + atmel,oc-gpio: + description: GPIO used to signal USB overcurrent condition. + minItems: 1 + maxItems: 3Same question here - how is the pin called in the schematics?
Quoted 22 lines
Documentation/devicetree/bindings/usb/generic-ohci.yaml +15
-0+ required: - compatible - reg@@ -144,6 +155,28 @@ 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:
Quoted 8 lines
Documentation/devicetree/bindings/usb/generic-ohci.yaml required: · line 173
Quoted 2 lines
Documentation/devicetree/bindings/usb/generic-ohci.yaml +2
-0+ - clocks + - clock-namesThere is already if:then:else covering clocks, so this makes multiple clauses being applied to same device. That's not really readable. Unfortunately that's a bit of a mess from existing binding. This can be solved by moving this to separate schema, especially that you want to add some specific properties to this device.
I guess Rob was fine with this, so let's keep it in this file.
Best regards,
Krzysztof
Re: [PATCH v3 5/5] dt-bindings: usb: atmel,at91sam9rl-udc: convert to DT schema
In reply to Charan PedumuruDocumentation/devicetree/bindings/usb/atmel,at91sam9rl-udc.yaml line 38
Quoted 9 lines · Charan Pedumuru
Documentation/devicetree/bindings/usb/atmel,at91sam9rl-udc.yaml new file +9
-0+ + reg: + maxItems: 2 + + interrupts: + maxItems: 1 + + clocks: + minItems: 2
Drop
Documentation/devicetree/bindings/usb/atmel,at91sam9rl-udc.yaml line 45
Quoted 7 lines
Documentation/devicetree/bindings/usb/atmel,at91sam9rl-udc.yaml new file +7
-0+ maxItems: 2 + + clock-names: + minItems: 2 + maxItems: 2 + items: + enum: [pclk, hclk]
No, list the items instead. Why is this flexible? Nothing in commit msg explains that.
Quoted 36 lines
Documentation/devicetree/bindings/usb/atmel,at91sam9rl-udc.yaml new file +30
-0+ + 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
-0
Documentation/devicetree/bindings/usb/atmel-usb.txt line 6
Quoted 6 lines
Documentation/devicetree/bindings/usb/atmel-usb.txt deleted +0
-6@@ -1,125 +0,0 @@ -Atmel SOC USB controllers - -OHCI - -Required properties: - - compatible: Should be "atmel,at91rm9200-ohci" for USB controllers
Why do you remove OHCI here? There is no conversion of this compatible. Don't combine multiple different changes in one commit.
Best regards,
Krzysztof
Re: [PATCH v3 1/5] arm: dts: at91: remove unused #address-cells/#size-cells from sam9x60 udc node
In reply to Charan PedumuruQuoted 5 lines · Charan Pedumuru
The UDC node does not define any child nodes, so the "#address-cells" and "#size-cells" properties are unnecessary. Remove these unused properties to simplify the devicetree node and keep it consistent with DT conventions.
Signed-off-by Charan Pedumuru <[email protected]>
Applied to at91-dt, thanks!
Re: [PATCH v3 2/5] dt-bindings: usb: generic-ohci: add AT91RM9200 OHCI binding support
In reply to Krzysztof KozlowskiQuoted 25 lines · Krzysztof Kozlowski
Quoted 24 lines · Charan Pedumuru
Add binding support for the Atmel AT91RM9200 OHCI USB host controller to the generic OHCI schema.
Signed-off-by Charan Pedumuru <[email protected]>--- .../devicetree/bindings/usb/generic-ohci.yaml | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+)Documentation/devicetree/bindings/usb/generic-ohci.yaml +1
-0@@ -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.
Quoted 4 lines
Documentation/devicetree/bindings/usb/generic-ohci.yaml properties: · line 141
Quoted 1 line
Documentation/devicetree/bindings/usb/generic-ohci.yaml +1
-0+ atmel,vbus-gpio:gpio is deprecated. All bindings use gpios. Also, pins do not use vendor prefixes.
It was already defined in the existing device tree and the same was defined in the text binding, I will remove these particular bindings from text file for each patch.
Quoted 8 lines
Documentation/devicetree/bindings/usb/generic-ohci.yaml properties: · line 144
Quoted 5 lines
Documentation/devicetree/bindings/usb/generic-ohci.yaml +3
-0+ description: GPIO used to control or sense the USB VBUS power. + minItems: 1 + maxItems: 3Why is this flexible? There is only one VBUS, no? Which pin is it exactly on this device?
VBUS has 3 pins and will write the exact pin in the description.
Quoted 8 lines
Documentation/devicetree/bindings/usb/generic-ohci.yaml properties: · line 149
Quoted 6 lines
Documentation/devicetree/bindings/usb/generic-ohci.yaml +5
-0+ + atmel,oc-gpio: + description: GPIO used to signal USB overcurrent condition. + minItems: 1 + maxItems: 3Same question here - how is the pin called in the schematics?
Okay.
Quoted 45 lines
Quoted 15 lines
Documentation/devicetree/bindings/usb/generic-ohci.yaml +7
-0+ required: - compatible - reg@@ -144,6 +155,28 @@ 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-namesThere is already if:then:else covering clocks, so this makes multiple clauses being applied to same device. That's not really readable. Unfortunately that's a bit of a mess from existing binding. This can be solved by moving this to separate schema, especially that you want to add some specific properties to this device.
Quoted 13 lines
Documentation/devicetree/bindings/usb/generic-ohci.yaml +6
-0+ + else: + properties: + atmel,vbus-gpio: false + atmel,oc-gpio: false + - if: not: properties:Signature · 2 lines
-- 2.53.0
Signature · 2 lines
Best Regards, Charan.
Re: [PATCH v3 2/5] dt-bindings: usb: generic-ohci: add AT91RM9200 OHCI binding support
In reply to Krzysztof KozlowskiQuoted 9 lines · Krzysztof Kozlowski
Quoted 5 lines · Krzysztof Kozlowski
Quoted 4 lines · Charan Pedumuru
Add binding support for the Atmel AT91RM9200 OHCI USB host controller to the generic OHCI schema.
Signed-off-by Charan Pedumuru <[email protected]>Also:
Quoted 7 lines
A nit, subject: drop second/last, redundant "binding support". The "dt-bindings" prefix is already stating that these are bindings. See also:
https://elixir.bootlin.com/linux/v6.17-rc3/source/Documentation/devicetree/bindings/submitting-patches.rst#L18And you cannot add support for bindings. The DT schema or some kernel
Makefilegave that support, not this file.
Okay, I will change that.
Quoted 74 lines
Quoted 65 lines
Quoted 19 lines
--- .../devicetree/bindings/usb/generic-ohci.yaml | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+)Documentation/devicetree/bindings/usb/generic-ohci.yaml +1
-0@@ -55,6 +55,7 @@ properties: - ti,ohci-omap3 - items: - enum: + - atmel,at91rm9200-ohci - cavium,octeon-6335-ohci - nintendo,hollywood-usb-ohci - nxp,ohci-nxpDocumentation/devicetree/bindings/usb/generic-ohci.yaml properties: · line 141
Quoted 4 lines
Documentation/devicetree/bindings/usb/generic-ohci.yaml +1
-0@@ -137,6 +138,16 @@ properties: The associated ISP1301 device. Necessary for the UDC controller for connecting to the USB physical layer. + atmel,vbus-gpio:gpio is deprecated. All bindings use gpios. Also, pins do not use vendor prefixes.
Documentation/devicetree/bindings/usb/generic-ohci.yaml properties: · line 144
Quoted 3 lines
Documentation/devicetree/bindings/usb/generic-ohci.yaml +3
-0+ description: GPIO used to control or sense the USB VBUS power. + minItems: 1 + maxItems: 3Why is this flexible? There is only one VBUS, no? Which pin is it exactly on this device?
Documentation/devicetree/bindings/usb/generic-ohci.yaml properties: · line 149
Quoted 5 lines
Documentation/devicetree/bindings/usb/generic-ohci.yaml +5
-0+ + atmel,oc-gpio: + description: GPIO used to signal USB overcurrent condition. + minItems: 1 + maxItems: 3Same question here - how is the pin called in the schematics?
Quoted 22 lines
Documentation/devicetree/bindings/usb/generic-ohci.yaml +15
-0+ required: - compatible - reg@@ -144,6 +155,28 @@ 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:Quoted 8 lines
Documentation/devicetree/bindings/usb/generic-ohci.yaml required: · line 173
Quoted 2 lines
Documentation/devicetree/bindings/usb/generic-ohci.yaml +2
-0+ - clocks + - clock-namesThere is already if:then:else covering clocks, so this makes multiple clauses being applied to same device. That's not really readable. Unfortunately that's a bit of a mess from existing binding. This can be solved by moving this to separate schema, especially that you want to add some specific properties to this device.
Quoted 1 line
I guess Rob was fine with this, so let's keep it in this file.
Yes, it should be defined here as the fallback compatible is already defined in this existing YAML.
Quoted 3 lines
Best regards,
Krzysztof
Signature · 2 lines
Best Regards, Charan.
Re: [PATCH v3 4/5] dt-bindings: usb: atmel,at91rm9200-udc: convert to DT schema
In reply to Krzysztof KozlowskiQuoted 49 lines · Krzysztof Kozlowski
Quoted 9 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.Reviewed-by Rob Herring (Arm) <[email protected]>Signed-off-by Charan Pedumuru <[email protected]>--- .../bindings/usb/atmel,at91rm9200-udc.yaml | 77 ++++++++++++++++++++++Where is the actual conversion? You are supposed to remove other file for this to be a "convert".
Quoted 35 lines
1 file changed, 77 insertions(+)Documentation/devicetree/bindings/usb/atmel,at91rm9200-udc.yaml new file +27
-0@@ -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
Quoted 8 lines
Documentation/devicetree/bindings/usb/atmel,at91rm9200-udc.yaml line 33
Quoted 6 lines
Documentation/devicetree/bindings/usb/atmel,at91rm9200-udc.yaml new file +6
-0+ + interrupts: + maxItems: 1 + + clocks: + minItems: 2Drop
Sure.
Quoted 24 lines
Quoted 24 lines
Documentation/devicetree/bindings/usb/atmel,at91rm9200-udc.yaml new file +23
-0+ 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
Quoted 8 lines
Documentation/devicetree/bindings/usb/atmel,at91rm9200-udc.yaml line 62
Quoted 6 lines
Documentation/devicetree/bindings/usb/atmel,at91rm9200-udc.yaml new file +6
-0+ - reg + - interrupts + - clocks + - clock-names + +unevaluatedProperties: falseadditionalProperties
Okay.
Quoted 4 lines
Best regards,
Krzysztof
Signature · 2 lines
Best Regards, Charan.
Re: [PATCH v3 5/5] dt-bindings: usb: atmel,at91sam9rl-udc: convert to DT schema
In reply to Krzysztof KozlowskiQuoted 12 lines · Krzysztof Kozlowski
Documentation/devicetree/bindings/usb/atmel,at91sam9rl-udc.yaml line 38
Quoted 9 lines · Charan Pedumuru
Documentation/devicetree/bindings/usb/atmel,at91sam9rl-udc.yaml new file +9
-0+ + reg: + maxItems: 2 + + interrupts: + maxItems: 1 + + clocks: + minItems: 2Drop
Sure.
Quoted 11 lines
Documentation/devicetree/bindings/usb/atmel,at91sam9rl-udc.yaml line 45
Quoted 8 lines
Documentation/devicetree/bindings/usb/atmel,at91sam9rl-udc.yaml new file +7
-0+ maxItems: 2 + + clock-names: + minItems: 2 + maxItems: 2 + items: + enum: [pclk, hclk]No, list the items instead. Why is this flexible? Nothing in commit msg explains that.
Some of the DTS files use those clock-names in different order, I will write this in the commit message.
Quoted 38 lines
Quoted 38 lines
Documentation/devicetree/bindings/usb/atmel,at91sam9rl-udc.yaml new file +30
-0+ + 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
-1@@ -1,125 +0,0 @@ -Atmel SOC USB controllers
Quoted 8 lines
Documentation/devicetree/bindings/usb/atmel-usb.txt line 6
Quoted 5 lines
Documentation/devicetree/bindings/usb/atmel-usb.txt deleted +0
-5- -OHCI - -Required properties: - - compatible: Should be "atmel,at91rm9200-ohci" for USB controllersWhy do you remove OHCI here? There is no conversion of this compatible. Don't combine multiple different changes in one commit.
I will remove each binding from the text file for each patch while converting them.
Quoted 5 lines
Best regards,
Krzysztof
Signature · 2 lines
Best Regards, Charan.