dt-bindings: dma: Add YAML schemas for the generic DMA bindings
Subsystems (3)
PATCH v3 1/3 dt-bindings: dma: Add YAML schemas for the generic DMA bindings
The DMA controllers and consumers have a bunch of generic properties that are needed in a device tree. Add a YAML schemas for those.
---
Changes from v2:
- Added a select statement.
Changes from v1:
- Dropped the dma consumer schemas
- Fixed the node name of the examples
- Enhanced a bit the description for dma-requests in case of a router
- Split the bindings in two to handle the router and controller case separately
- Made #dma-cells required
--- .../devicetree/bindings/dma/dma-common.yaml | 45 +++++++ .../bindings/dma/dma-controller.yaml | 35 ++++++ .../devicetree/bindings/dma/dma-router.yaml | 50 ++++++++ Documentation/devicetree/bindings/dma/dma.txt | 114 +----------------- 4 files changed, 131 insertions(+), 113 deletions(-) create mode 100644 Documentation/devicetree/bindings/dma/dma-common.yaml create mode 100644 Documentation/devicetree/bindings/dma/dma-controller.yaml create mode 100644 Documentation/devicetree/bindings/dma/dma-router.yaml
Documentation/devicetree/bindings/dma/dma-common.yaml new file +45 -0
@@ -0,0 +1,45 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/dma/dma-common.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: DMA Engine Generic Binding + +maintainers: + - Vinod Koul <[email protected]> + +description: + Generic binding to provide a way for a driver using DMA Engine to + retrieve the DMA request or channel information that goes from a + hardware device to a DMA controller. + +select: false + +properties: + "#dma-cells": + minimum: 1 + # Should be enough + maximum: 255 + description: + Used to provide DMA controller specific information. + + dma-channel-masks: + $ref: /schemas/types.yaml#definitions/uint32 + description: + Bitmask of available DMA channels in ascending order that are + not reserved by firmware and are available to the + kernel. i.e. first channel corresponds to LSB. + + dma-channels: + $ref: /schemas/types.yaml#definitions/uint32 + description: + Number of DMA channels supported by the controller. + + dma-requests: + $ref: /schemas/types.yaml#definitions/uint32 + description: + Number of DMA request signals supported by the controller. + +required: + - "#dma-cells"
Documentation/devicetree/bindings/dma/dma-controller.yaml new file +35 -0
@@ -0,0 +1,35 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/dma/dma-controller.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: DMA Controller Generic Binding + +maintainers: + - Vinod Koul <[email protected]> + +allOf: + - $ref: "dma-common.yaml#" + +# Everything else is described in the common file +properties: + $nodename: + pattern: "^dma-controller(@.*)?$" + +examples: + - | + dma: dma-controller@48000000 { + compatible = "ti,omap-sdma"; + reg = <0x48000000 0x1000>; + interrupts = <0 12 0x4 + 0 13 0x4 + 0 14 0x4 + 0 15 0x4>; + #dma-cells = <1>; + dma-channels = <32>; + dma-requests = <127>; + dma-channel-mask = <0xfffe>; + }; + +...
Documentation/devicetree/bindings/dma/dma-router.yaml new file +50 -0
50 lines not on this page · raw message
Documentation/devicetree/bindings/dma/dma.txt +1 -113
114 lines not on this page · raw message
Signature · 1 line
2.21.0
PATCH v3 2/3 dt-bindings: dma: Convert Allwinner A10 DMA to a schema
The older Allwinner SoCs have a DMA controller supported in Linux, with a matching Device Tree binding.
Now that we have the DT validation in place, let's convert the device tree bindings for that controller over to a YAML schemas.
--- .../bindings/dma/allwinner,sun4i-a10-dma.yaml | 55 +++++++++++++++++++ .../devicetree/bindings/dma/sun4i-dma.txt | 45 --------------- 2 files changed, 55 insertions(+), 45 deletions(-) create mode 100644 Documentation/devicetree/bindings/dma/allwinner,sun4i-a10-dma.yaml delete mode 100644 Documentation/devicetree/bindings/dma/sun4i-dma.txt
Documentation/devicetree/bindings/dma/allwinner,sun4i-a10-dma.yaml new file +55 -0
@@ -0,0 +1,55 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/dma/allwinner,sun4i-a10-dma.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Allwinner A10 DMA Controller Device Tree Bindings + +maintainers: + - Chen-Yu Tsai <[email protected]> + - Maxime Ripard <[email protected]> + +allOf: + - $ref: "dma-controller.yaml#" + +properties: + "#dma-cells": + const: 2 + description: + The first cell is either 0 or 1, the former to use the normal + DMA, 1 for dedicated DMA. The second cell is the request line + number. + + compatible: + const: allwinner,sun4i-a10-dma + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + +required: + - "#dma-cells" + - compatible + - reg + - interrupts + - clocks + +additionalProperties: false + +examples: + - | + dma: dma-controller@1c02000 { + compatible = "allwinner,sun4i-a10-dma"; + reg = <0x01c02000 0x1000>; + interrupts = <27>; + clocks = <&ahb_gates 6>; + #dma-cells = <2>; + }; + +...
Documentation/devicetree/bindings/dma/sun4i-dma.txt deleted +0 -45
45 lines not on this page · raw message
Signature · 1 line
2.21.0
PATCH v3 3/3 dt-bindings: dma: Convert Allwinner A31 and A64 DMA to a schema
In reply to Maxime RipardThe newer Allwinner SoCs have a DMA controller supported in Linux, with a matching Device Tree binding.
Now that we have the DT validation in place, let's convert the device tree bindings for that controller over to a YAML schemas.
--- .../dma/allwinner,sun50i-a64-dma.yaml | 88 +++++++++++++++++++ .../bindings/dma/allwinner,sun6i-a31-dma.yaml | 62 +++++++++++++ .../devicetree/bindings/dma/sun6i-dma.txt | 81 ----------------- 3 files changed, 150 insertions(+), 81 deletions(-) create mode 100644 Documentation/devicetree/bindings/dma/allwinner,sun50i-a64-dma.yaml create mode 100644 Documentation/devicetree/bindings/dma/allwinner,sun6i-a31-dma.yaml delete mode 100644 Documentation/devicetree/bindings/dma/sun6i-dma.txt
Documentation/devicetree/bindings/dma/allwinner,sun50i-a64-dma.yaml new file +88 -0
@@ -0,0 +1,88 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/dma/allwinner,sun50i-a64-dma.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Allwinner A64 DMA Controller Device Tree Bindings + +maintainers: + - Chen-Yu Tsai <[email protected]> + - Maxime Ripard <[email protected]> + +allOf: + - $ref: "dma-controller.yaml#" + +properties: + "#dma-cells": + const: 1 + description: The cell is the request line number. + + compatible: + enum: + - allwinner,sun50i-a64-dma + - allwinner,sun50i-h6-dma + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + minItems: 1 + maxItems: 2 + + clock-names: + items: + - const: bus + - const: mbus + + resets: + maxItems: 1 + +required: + - "#dma-cells" + - compatible + - reg + - interrupts + - clocks + - resets + - dma-channels + +if: + properties: + compatible: + const: allwinner,sun50i-h6-dma + +then: + properties: + clocks: + maxItems: 2 + + required: + - clock-names + +else: + properties: + clocks: + maxItems: 1 + +# FIXME: We should set it, but it would report all the generic +# properties as additional properties. +# additionalProperties: false + +examples: + - | + dma: dma-controller@1c02000 { + compatible = "allwinner,sun50i-a64-dma"; + reg = <0x01c02000 0x1000>; + interrupts = <0 50 4>; + clocks = <&ccu 30>; + dma-channels = <8>; + dma-requests = <27>; + resets = <&ccu 7>; + #dma-cells = <1>; + }; + +...
Documentation/devicetree/bindings/dma/allwinner,sun6i-a31-dma.yaml new file +62 -0
62 lines not on this page · raw message
Documentation/devicetree/bindings/dma/sun6i-dma.txt deleted +0 -81
81 lines not on this page · raw message
Signature · 1 line
2.21.0
Quoted 18 lines · Maxime Ripard
The DMA controllers and consumers have a bunch of generic properties that are needed in a device tree. Add a YAML schemas for those.
Signed-off-by Maxime Ripard <[email protected]>---
Changes from v2:
- Added a select statement.Changes from v1:
- Dropped the dma consumer schemas
- Fixed the node name of the examples
- Enhanced a bit the description for dma-requests in case of a router
- Split the bindings in two to handle the router and controller case separately
- Made #dma-cells required
Quoted 9 lines
--- .../devicetree/bindings/dma/dma-common.yaml | 45 +++++++ .../bindings/dma/dma-controller.yaml | 35 ++++++ .../devicetree/bindings/dma/dma-router.yaml | 50 ++++++++ Documentation/devicetree/bindings/dma/dma.txt | 114 +----------------- 4 files changed, 131 insertions(+), 113 deletions(-) create mode 100644 Documentation/devicetree/bindings/dma/dma-common.yaml create mode 100644 Documentation/devicetree/bindings/dma/dma-controller.yaml create mode 100644 Documentation/devicetree/bindings/dma/dma-router.yaml
Vinod Koul
maintainerQuoted 2 lines · Maxime Ripard
The DMA controllers and consumers have a bunch of generic properties that are needed in a device tree. Add a YAML schemas for those.
Applied after changinge subsystem name to dmaengine in patch title
thanks
Signature · 1 line
~Vinod