dt-bindings: serial: Move omap-serial.txt to YAML schema
Subsystems (2)
PATCH v2 1/1 dt-bindings: serial: Move omap-serial.txt to YAML schema
Convert serial-omap.txt to YAML schema for better checks and documentation.
---
v2:
*Drop reg-io-width and reg-shift as they are constant and documented in
txt bindings (also not used by driver).
*Drop unused label in example.
*Rename file to 8250_omap.yaml to be more generic as IP is present in varies families of TI SoCs.
*Add description for interrupt entries
.../devicetree/bindings/serial/8250_omap.yaml | 118 ++++++++++++++++++ .../bindings/serial/omap_serial.txt | 40 ------ 2 files changed, 118 insertions(+), 40 deletions(-) create mode 100644 Documentation/devicetree/bindings/serial/8250_omap.yaml delete mode 100644 Documentation/devicetree/bindings/serial/omap_serial.txt
Documentation/devicetree/bindings/serial/8250_omap.yaml new file +118 -0
@@ -0,0 +1,118 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/serial/8250_omap.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Bindings for 8250 compliant UARTs on TI's OMAP2+ and K3 SoCs + +maintainers: + - Vignesh Raghavendra <[email protected]> + +allOf: + - $ref: /schemas/serial/serial.yaml# + - $ref: /schemas/serial/rs485.yaml# + +properties: + compatible: + oneOf: + - enum: + - ti,am3352-uart + - ti,am4372-uart + - ti,am654-uart + - ti,dra742-uart + - ti,omap2-uart + - ti,omap3-uart + - ti,omap4-uart + - items: + - enum: + - ti,am64-uart + - ti,j721e-uart + - const: ti,am654-uart + + ti,hwmods: + description: + Must be "uart<n>", n being the instance number (1-based) + This property is applicable only on legacy platforms mainly omap2/3 + and ti81xx and should not be used on other platforms. + $ref: /schemas/types.yaml#/definitions/string + deprecated: true + + dmas: + minItems: 1 + maxItems: 2 + + dma-names: + items: + - const: tx + - const: rx + + reg: + maxItems: 1 + + interrupts: + minItems: 1 + maxItems: 2 + description: + First entry is module IRQ required for normal IO operation. + Second entry is optional and corresponds to system wakeup IRQ + where supported. + + clocks: + maxItems: 1 + + clock-names: + const: fclk + + rts-gpios: true + cts-gpios: true + dtr-gpios: true + dsr-gpios: true + rng-gpios: true + dcd-gpios: true + rs485-rts-delay: true + rs485-rts-active-low: true + rs485-rx-during-tx: true + rs485-rts-active-high: true + linux,rs485-enabled-at-boot-time: true + rts-gpio: true + power-domains: true + clock-frequency: true + current-speed: true + +required: + - compatible + - reg + - interrupts + +additionalProperties: false + +if: + properties: + compatible: + oneOf: + - const: ti,omap2-uart + - const: ti,omap3-uart + - const: ti,omap4-uart + +then: + properties: + ti,hwmods: + items: + - pattern: "^uart([1-9])$" + +else: + properties: + ti,hwmods: false + +examples: + - | + serial@49042000 { + compatible = "ti,omap3-uart"; + reg = <0x49042000 0x400>; + interrupts = <80>; + dmas = <&sdma 81 &sdma 82>; + dma-names = "tx", "rx"; + ti,hwmods = "uart4"; + clock-frequency = <48000000>; + };
Documentation/devicetree/bindings/serial/omap_serial.txt deleted +0 -40
@@ -1,40 +0,0 @@ -OMAP UART controller - -Required properties: -- compatible : should be "ti,am64-uart", "ti,am654-uart" for AM64 controllers -- compatible : should be "ti,j721e-uart", "ti,am654-uart" for J721E controllers -- compatible : should be "ti,am654-uart" for AM654 controllers -- compatible : should be "ti,omap2-uart" for OMAP2 controllers -- compatible : should be "ti,omap3-uart" for OMAP3 controllers -- compatible : should be "ti,omap4-uart" for OMAP4 controllers -- compatible : should be "ti,am4372-uart" for AM437x controllers -- compatible : should be "ti,am3352-uart" for AM335x controllers -- compatible : should be "ti,dra742-uart" for DRA7x controllers -- reg : address and length of the register space -- interrupts or interrupts-extended : Should contain the uart interrupt - specifier or both the interrupt - controller phandle and interrupt - specifier. -- ti,hwmods : Must be "uart<n>", n being the instance number (1-based) - -Optional properties: -- clock-frequency : frequency of the clock input to the UART -- dmas : DMA specifier, consisting of a phandle to the DMA controller - node and a DMA channel number. -- dma-names : "rx" for receive channel, "tx" for transmit channel. -- rs485-rts-delay, rs485-rx-during-tx, linux,rs485-enabled-at-boot-time: see rs485.txt -- rs485-rts-active-high: drive RTS high when sending (default is low). -- clocks: phandle to the functional clock as per - Documentation/devicetree/bindings/clock/clock-bindings.txt - -Example: - - uart4: serial@49042000 { - compatible = "ti,omap3-uart"; - reg = <0x49042000 0x400>; - interrupts = <80>; - dmas = <&sdma 81 &sdma 82>; - dma-names = "tx", "rx"; - ti,hwmods = "uart4"; - clock-frequency = <48000000>; - };
Signature · 1 line
2.32.0
Quoted 1 line · Vignesh Raghavendra
Convert serial-omap.txt to YAML schema for better checks and documentation.
Looks good to me thanks:
Quoted 75 lines · Vignesh Raghavendra
Convert serial-omap.txt to YAML schema for better checks and documentation.
Signed-off-by Vignesh Raghavendra <[email protected]>---
v2:
*Drop reg-io-width and reg-shift as they are constant and documented in
txt bindings (also not used by driver).
*Drop unused label in example.
*Rename file to8250_omap.yamlto be more generic as IP is present in varies families of TI SoCs.
*Add description for interrupt entries.../devicetree/bindings/serial/8250_omap.yaml | 118 ++++++++++++++++++ .../bindings/serial/omap_serial.txt | 40 ------ 2 files changed, 118 insertions(+), 40 deletions(-) create mode 100644 Documentation/devicetree/bindings/serial/8250_omap.yaml delete mode 100644 Documentation/devicetree/bindings/serial/omap_serial.txtDocumentation/devicetree/bindings/serial/8250_omap.yaml new file +49
-0@@ -0,0 +1,118 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/serial/8250_omap.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Bindings for 8250 compliant UARTs on TI's OMAP2+ and K3 SoCs + +maintainers: + - Vignesh Raghavendra <[email protected]> + +allOf: + - $ref: /schemas/serial/serial.yaml# + - $ref: /schemas/serial/rs485.yaml# + +properties: + compatible: + oneOf: + - enum: + - ti,am3352-uart + - ti,am4372-uart + - ti,am654-uart + - ti,dra742-uart + - ti,omap2-uart + - ti,omap3-uart + - ti,omap4-uart + - items: + - enum: + - ti,am64-uart + - ti,j721e-uart + - const: ti,am654-uart + + ti,hwmods: + description: + Must be "uart<n>", n being the instance number (1-based) + This property is applicable only on legacy platforms mainly omap2/3 + and ti81xx and should not be used on other platforms. + $ref: /schemas/types.yaml#/definitions/string + deprecated: true + + dmas: + minItems: 1 + maxItems: 2 + + dma-names: + items: + - const: tx + - const: rx +
Documentation/devicetree/bindings/serial/8250_omap.yaml line 59
Quoted 10 lines
Documentation/devicetree/bindings/serial/8250_omap.yaml new file +10
-0+ reg: + maxItems: 1 + + interrupts: + minItems: 1 + maxItems: 2 + description: + First entry is module IRQ required for normal IO operation. + Second entry is optional and corresponds to system wakeup IRQ + where supported.
interrupts:
minItems: 1
items:
- description: module IRQ required for normal IO operation
- description: system wakeup IRQ
Quoted 19 lines
Documentation/devicetree/bindings/serial/8250_omap.yaml new file +19
-0+ + clocks: + maxItems: 1 + + clock-names: + const: fclk + + rts-gpios: true + cts-gpios: true + dtr-gpios: true + dsr-gpios: true + rng-gpios: true + dcd-gpios: true + rs485-rts-delay: true + rs485-rts-active-low: true + rs485-rx-during-tx: true + rs485-rts-active-high: true + linux,rs485-enabled-at-boot-time: true + rts-gpio: true
Documentation/devicetree/bindings/serial/8250_omap.yaml line 88
Quoted 10 lines
Documentation/devicetree/bindings/serial/8250_omap.yaml new file +10
-0+ power-domains: true + clock-frequency: true + current-speed: true + +required: + - compatible + - reg + - interrupts + +additionalProperties: false
Do you want to support serial attached devices? If so, you need:
unevaluatedProperties: false
You can also drop listing all the inherited properties from the included schemas.
Quoted 79 lines
Documentation/devicetree/bindings/serial/8250_omap.yaml new file +30
-0+ +if: + properties: + compatible: + oneOf: + - const: ti,omap2-uart + - const: ti,omap3-uart + - const: ti,omap4-uart + +then: + properties: + ti,hwmods: + items: + - pattern: "^uart([1-9])$" + +else: + properties: + ti,hwmods: false + +examples: + - | + serial@49042000 { + compatible = "ti,omap3-uart"; + reg = <0x49042000 0x400>; + interrupts = <80>; + dmas = <&sdma 81 &sdma 82>; + dma-names = "tx", "rx"; + ti,hwmods = "uart4"; + clock-frequency = <48000000>; + };Documentation/devicetree/bindings/serial/omap_serial.txt deleted +0
-41@@ -1,40 +0,0 @@ -OMAP UART controller - -Required properties: -- compatible : should be "ti,am64-uart", "ti,am654-uart" for AM64 controllers -- compatible : should be "ti,j721e-uart", "ti,am654-uart" for J721E controllers -- compatible : should be "ti,am654-uart" for AM654 controllers -- compatible : should be "ti,omap2-uart" for OMAP2 controllers -- compatible : should be "ti,omap3-uart" for OMAP3 controllers -- compatible : should be "ti,omap4-uart" for OMAP4 controllers -- compatible : should be "ti,am4372-uart" for AM437x controllers -- compatible : should be "ti,am3352-uart" for AM335x controllers -- compatible : should be "ti,dra742-uart" for DRA7x controllers -- reg : address and length of the register space -- interrupts or interrupts-extended : Should contain the uart interrupt - specifier or both the interrupt - controller phandle and interrupt - specifier. -- ti,hwmods : Must be "uart<n>", n being the instance number (1-based) - -Optional properties: -- clock-frequency : frequency of the clock input to the UART -- dmas : DMA specifier, consisting of a phandle to the DMA controller - node and a DMA channel number. -- dma-names : "rx" for receive channel, "tx" for transmit channel. -- rs485-rts-delay, rs485-rx-during-tx, linux,rs485-enabled-at-boot-time: see rs485.txt -- rs485-rts-active-high: drive RTS high when sending (default is low). -- clocks: phandle to the functional clock as per - Documentation/devicetree/bindings/clock/clock-bindings.txt - -Example: - - uart4: serial@49042000 { - compatible = "ti,omap3-uart"; - reg = <0x49042000 0x400>; - interrupts = <80>; - dmas = <&sdma 81 &sdma 82>; - dma-names = "tx", "rx"; - ti,hwmods = "uart4"; - clock-frequency = <48000000>; - }; --2.32.0
Quoted 84 lines · Rob Herring
Quoted 83 lines · Vignesh Raghavendra
Convert serial-omap.txt to YAML schema for better checks and documentation.
Signed-off-by Vignesh Raghavendra <[email protected]>---
v2:
*Drop reg-io-width and reg-shift as they are constant and documented in
txt bindings (also not used by driver).
*Drop unused label in example.
*Rename file to8250_omap.yamlto be more generic as IP is present in varies families of TI SoCs.
*Add description for interrupt entries.../devicetree/bindings/serial/8250_omap.yaml | 118 ++++++++++++++++++ .../bindings/serial/omap_serial.txt | 40 ------ 2 files changed, 118 insertions(+), 40 deletions(-) create mode 100644 Documentation/devicetree/bindings/serial/8250_omap.yaml delete mode 100644 Documentation/devicetree/bindings/serial/omap_serial.txtDocumentation/devicetree/bindings/serial/8250_omap.yaml new file +57
-0@@ -0,0 +1,118 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/serial/8250_omap.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Bindings for 8250 compliant UARTs on TI's OMAP2+ and K3 SoCs + +maintainers: + - Vignesh Raghavendra <[email protected]> + +allOf: + - $ref: /schemas/serial/serial.yaml# + - $ref: /schemas/serial/rs485.yaml# + +properties: + compatible: + oneOf: + - enum: + - ti,am3352-uart + - ti,am4372-uart + - ti,am654-uart + - ti,dra742-uart + - ti,omap2-uart + - ti,omap3-uart + - ti,omap4-uart + - items: + - enum: + - ti,am64-uart + - ti,j721e-uart + - const: ti,am654-uart + + ti,hwmods: + description: + Must be "uart<n>", n being the instance number (1-based) + This property is applicable only on legacy platforms mainly omap2/3 + and ti81xx and should not be used on other platforms. + $ref: /schemas/types.yaml#/definitions/string + deprecated: true + + dmas: + minItems: 1 + maxItems: 2 + + dma-names: + items: + - const: tx + - const: rx + + reg: + maxItems: 1 + + interrupts: + minItems: 1 + maxItems: 2 + description: + First entry is module IRQ required for normal IO operation.
Quoted 9 lines
Documentation/devicetree/bindings/serial/8250_omap.yaml line 59
Quoted 2 lines
Documentation/devicetree/bindings/serial/8250_omap.yaml new file +2
-0+ Second entry is optional and corresponds to system wakeup IRQ + where supported.interrupts:
minItems: 1
items:
- description: module IRQ required for normal IO operation
- description: system wakeup IRQ
OK, will send a follow up fix as the patch is already queued.
Quoted 32 lines
Quoted 19 lines
Documentation/devicetree/bindings/serial/8250_omap.yaml new file +19
-0+ + clocks: + maxItems: 1 + + clock-names: + const: fclk + + rts-gpios: true + cts-gpios: true + dtr-gpios: true + dsr-gpios: true + rng-gpios: true + dcd-gpios: true + rs485-rts-delay: true + rs485-rts-active-low: true + rs485-rx-during-tx: true + rs485-rts-active-high: true + linux,rs485-enabled-at-boot-time: true + rts-gpio: trueDocumentation/devicetree/bindings/serial/8250_omap.yaml line 88
Quoted 10 lines
Documentation/devicetree/bindings/serial/8250_omap.yaml new file +10
-0+ power-domains: true + clock-frequency: true + current-speed: true + +required: + - compatible + - reg + - interrupts + +additionalProperties: falseDo you want to support serial attached devices? If so, you need:
Quoted 2 lines
unevaluatedProperties: false
Yes, support for serial client devices is desired, but I see that with "unevaluatedProperties: false" there are no warnings if DT has a property not documented in the schema? Did I miss something?
Quoted 2 lines
You can also drop listing all the inherited properties from the included schemas.
Yes, this can be done with "unevaluatedProperties: false".
Regards
Vignesh
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 132 lines · Vignesh Raghavendra
Quoted 84 lines · Rob Herring
Quoted 83 lines · Vignesh Raghavendra
Convert serial-omap.txt to YAML schema for better checks and documentation.
Signed-off-by Vignesh Raghavendra <[email protected]>---
v2:
*Drop reg-io-width and reg-shift as they are constant and documented in
txt bindings (also not used by driver).
*Drop unused label in example.
*Rename file to8250_omap.yamlto be more generic as IP is present in varies families of TI SoCs.
*Add description for interrupt entries.../devicetree/bindings/serial/8250_omap.yaml | 118 ++++++++++++++++++ .../bindings/serial/omap_serial.txt | 40 ------ 2 files changed, 118 insertions(+), 40 deletions(-) create mode 100644 Documentation/devicetree/bindings/serial/8250_omap.yaml delete mode 100644 Documentation/devicetree/bindings/serial/omap_serial.txtDocumentation/devicetree/bindings/serial/8250_omap.yaml new file +57
-0@@ -0,0 +1,118 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/serial/8250_omap.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Bindings for 8250 compliant UARTs on TI's OMAP2+ and K3 SoCs + +maintainers: + - Vignesh Raghavendra <[email protected]> + +allOf: + - $ref: /schemas/serial/serial.yaml# + - $ref: /schemas/serial/rs485.yaml# + +properties: + compatible: + oneOf: + - enum: + - ti,am3352-uart + - ti,am4372-uart + - ti,am654-uart + - ti,dra742-uart + - ti,omap2-uart + - ti,omap3-uart + - ti,omap4-uart + - items: + - enum: + - ti,am64-uart + - ti,j721e-uart + - const: ti,am654-uart + + ti,hwmods: + description: + Must be "uart<n>", n being the instance number (1-based) + This property is applicable only on legacy platforms mainly omap2/3 + and ti81xx and should not be used on other platforms. + $ref: /schemas/types.yaml#/definitions/string + deprecated: true + + dmas: + minItems: 1 + maxItems: 2 + + dma-names: + items: + - const: tx + - const: rx + + reg: + maxItems: 1 + + interrupts: + minItems: 1 + maxItems: 2 + description: + First entry is module IRQ required for normal IO operation.Quoted 9 lines
Documentation/devicetree/bindings/serial/8250_omap.yaml line 59
Quoted 2 lines
Documentation/devicetree/bindings/serial/8250_omap.yaml new file +2
-0+ Second entry is optional and corresponds to system wakeup IRQ + where supported.interrupts:
minItems: 1
items:
- description: module IRQ required for normal IO operation
- description: system wakeup IRQOK, will send a follow up fix as the patch is already queued.
Quoted 32 lines
Quoted 19 lines
Documentation/devicetree/bindings/serial/8250_omap.yaml new file +19
-0+ + clocks: + maxItems: 1 + + clock-names: + const: fclk + + rts-gpios: true + cts-gpios: true + dtr-gpios: true + dsr-gpios: true + rng-gpios: true + dcd-gpios: true + rs485-rts-delay: true + rs485-rts-active-low: true + rs485-rx-during-tx: true + rs485-rts-active-high: true + linux,rs485-enabled-at-boot-time: true + rts-gpio: trueDocumentation/devicetree/bindings/serial/8250_omap.yaml line 88
Quoted 10 lines
Documentation/devicetree/bindings/serial/8250_omap.yaml new file +10
-0+ power-domains: true + clock-frequency: true + current-speed: true + +required: + - compatible + - reg + - interrupts + +additionalProperties: falseDo you want to support serial attached devices? If so, you need:
Quoted 6 lines
Quoted 2 lines
unevaluatedProperties: false
Yes, support for serial client devices is desired, but I see that with "unevaluatedProperties: false" there are no warnings if DT has a property not documented in the schema? Did I miss something?
Support for unevaluatedProperties is not yet implemented in the underlying jsonschema package. So we get the default behavior for unknown keywords which is a nop.
Rob