Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dt-bindings: dmaengine: Convert Allwinner A31 and A64 DMA to a schema

The 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.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://lore.kernel.org/r/20190720092607.31095-3-maxime.ripard@bootlin.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Maxime Ripard and committed by
Vinod Koul
edd14218 545a29c8

+150 -81
+88
Documentation/devicetree/bindings/dma/allwinner,sun50i-a64-dma.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/dma/allwinner,sun50i-a64-dma.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Allwinner A64 DMA Controller Device Tree Bindings 8 + 9 + maintainers: 10 + - Chen-Yu Tsai <wens@csie.org> 11 + - Maxime Ripard <maxime.ripard@bootlin.com> 12 + 13 + allOf: 14 + - $ref: "dma-controller.yaml#" 15 + 16 + properties: 17 + "#dma-cells": 18 + const: 1 19 + description: The cell is the request line number. 20 + 21 + compatible: 22 + enum: 23 + - allwinner,sun50i-a64-dma 24 + - allwinner,sun50i-h6-dma 25 + 26 + reg: 27 + maxItems: 1 28 + 29 + interrupts: 30 + maxItems: 1 31 + 32 + clocks: 33 + minItems: 1 34 + maxItems: 2 35 + 36 + clock-names: 37 + items: 38 + - const: bus 39 + - const: mbus 40 + 41 + resets: 42 + maxItems: 1 43 + 44 + required: 45 + - "#dma-cells" 46 + - compatible 47 + - reg 48 + - interrupts 49 + - clocks 50 + - resets 51 + - dma-channels 52 + 53 + if: 54 + properties: 55 + compatible: 56 + const: allwinner,sun50i-h6-dma 57 + 58 + then: 59 + properties: 60 + clocks: 61 + maxItems: 2 62 + 63 + required: 64 + - clock-names 65 + 66 + else: 67 + properties: 68 + clocks: 69 + maxItems: 1 70 + 71 + # FIXME: We should set it, but it would report all the generic 72 + # properties as additional properties. 73 + # additionalProperties: false 74 + 75 + examples: 76 + - | 77 + dma: dma-controller@1c02000 { 78 + compatible = "allwinner,sun50i-a64-dma"; 79 + reg = <0x01c02000 0x1000>; 80 + interrupts = <0 50 4>; 81 + clocks = <&ccu 30>; 82 + dma-channels = <8>; 83 + dma-requests = <27>; 84 + resets = <&ccu 7>; 85 + #dma-cells = <1>; 86 + }; 87 + 88 + ...
+62
Documentation/devicetree/bindings/dma/allwinner,sun6i-a31-dma.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/dma/allwinner,sun6i-a31-dma.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Allwinner A31 DMA Controller Device Tree Bindings 8 + 9 + maintainers: 10 + - Chen-Yu Tsai <wens@csie.org> 11 + - Maxime Ripard <maxime.ripard@bootlin.com> 12 + 13 + allOf: 14 + - $ref: "dma-controller.yaml#" 15 + 16 + properties: 17 + "#dma-cells": 18 + const: 1 19 + description: The cell is the request line number. 20 + 21 + compatible: 22 + oneOf: 23 + - const: allwinner,sun6i-a31-dma 24 + - const: allwinner,sun8i-a23-dma 25 + - const: allwinner,sun8i-a83t-dma 26 + - const: allwinner,sun8i-h3-dma 27 + - const: allwinner,sun8i-v3s-dma 28 + 29 + reg: 30 + maxItems: 1 31 + 32 + interrupts: 33 + maxItems: 1 34 + 35 + clocks: 36 + maxItems: 1 37 + 38 + resets: 39 + maxItems: 1 40 + 41 + required: 42 + - "#dma-cells" 43 + - compatible 44 + - reg 45 + - interrupts 46 + - clocks 47 + - resets 48 + 49 + additionalProperties: false 50 + 51 + examples: 52 + - | 53 + dma: dma-controller@1c02000 { 54 + compatible = "allwinner,sun6i-a31-dma"; 55 + reg = <0x01c02000 0x1000>; 56 + interrupts = <0 50 4>; 57 + clocks = <&ahb1_gates 6>; 58 + resets = <&ahb1_rst 6>; 59 + #dma-cells = <1>; 60 + }; 61 + 62 + ...
-81
Documentation/devicetree/bindings/dma/sun6i-dma.txt
··· 1 - Allwinner A31 DMA Controller 2 - 3 - This driver follows the generic DMA bindings defined in dma.txt. 4 - 5 - Required properties: 6 - 7 - - compatible: Must be one of 8 - "allwinner,sun6i-a31-dma" 9 - "allwinner,sun8i-a23-dma" 10 - "allwinner,sun8i-a83t-dma" 11 - "allwinner,sun8i-h3-dma" 12 - "allwinner,sun8i-v3s-dma" 13 - - reg: Should contain the registers base address and length 14 - - interrupts: Should contain a reference to the interrupt used by this device 15 - - clocks: Should contain a reference to the parent AHB clock 16 - - resets: Should contain a reference to the reset controller asserting 17 - this device in reset 18 - - #dma-cells : Should be 1, a single cell holding a line request number 19 - 20 - Example: 21 - dma: dma-controller@1c02000 { 22 - compatible = "allwinner,sun6i-a31-dma"; 23 - reg = <0x01c02000 0x1000>; 24 - interrupts = <0 50 4>; 25 - clocks = <&ahb1_gates 6>; 26 - resets = <&ahb1_rst 6>; 27 - #dma-cells = <1>; 28 - }; 29 - 30 - ------------------------------------------------------------------------------ 31 - For A64 and H6 DMA controller: 32 - 33 - Required properties: 34 - - compatible: Must be one of 35 - "allwinner,sun50i-a64-dma" 36 - "allwinner,sun50i-h6-dma" 37 - - dma-channels: Number of DMA channels supported by the controller. 38 - Refer to Documentation/devicetree/bindings/dma/dma.txt 39 - - clocks: In addition to parent AHB clock, it should also contain mbus 40 - clock (H6 only) 41 - - clock-names: Should contain "bus" and "mbus" (H6 only) 42 - - all properties above, i.e. reg, interrupts, clocks, resets and #dma-cells 43 - 44 - Optional properties: 45 - - dma-requests: Number of DMA request signals supported by the controller. 46 - Refer to Documentation/devicetree/bindings/dma/dma.txt 47 - 48 - Example: 49 - dma: dma-controller@1c02000 { 50 - compatible = "allwinner,sun50i-a64-dma"; 51 - reg = <0x01c02000 0x1000>; 52 - interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>; 53 - clocks = <&ccu CLK_BUS_DMA>; 54 - dma-channels = <8>; 55 - dma-requests = <27>; 56 - resets = <&ccu RST_BUS_DMA>; 57 - #dma-cells = <1>; 58 - }; 59 - ------------------------------------------------------------------------------ 60 - 61 - Clients: 62 - 63 - DMA clients connected to the A31 DMA controller must use the format 64 - described in the dma.txt file, using a two-cell specifier for each 65 - channel: a phandle plus one integer cells. 66 - The two cells in order are: 67 - 68 - 1. A phandle pointing to the DMA controller. 69 - 2. The port ID as specified in the datasheet 70 - 71 - Example: 72 - spi2: spi@1c6a000 { 73 - compatible = "allwinner,sun6i-a31-spi"; 74 - reg = <0x01c6a000 0x1000>; 75 - interrupts = <0 67 4>; 76 - clocks = <&ahb1_gates 22>, <&spi2_clk>; 77 - clock-names = "ahb", "mod"; 78 - dmas = <&dma 25>, <&dma 25>; 79 - dma-names = "rx", "tx"; 80 - resets = <&ahb1_rst 22>; 81 - };