Skip to contentSkip to conversation

dt-bindings: dma: convert atmel-xdma.txt to YAML

PATCH In review Durai Manickam KR 2 participants 2 messages Feb 15, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dt-bindings: dma: convert atmel-xdma.txt to YAML

Added a description, required properties and appropriate compatibles for all the SoCs that are supported by microchip for the XDMAC.

---
 .../devicetree/bindings/dma/atmel-xdma.txt         | 54 ---------------
 .../bindings/dma/microchip,at91-xdma.yaml          | 77 ++++++++++++++++++++++
 2 files changed, 77 insertions(+), 54 deletions(-)
Documentation/devicetree/bindings/dma/atmel-xdma.txt deleted +0 -54
deleted file mode 100644
index 76d649b3a25d..000000000000
@@ -1,54 +0,0 @@
-* Atmel Extensible Direct Memory Access Controller (XDMAC)
-
-* XDMA Controller
-Required properties:
-- compatible: Should be "atmel,sama5d4-dma", "microchip,sam9x60-dma" or
-  "microchip,sama7g5-dma" or
-  "microchip,sam9x7-dma", "atmel,sama5d4-dma".
-- reg: Should contain DMA registers location and length.
-- interrupts: Should contain DMA interrupt.
-- #dma-cells: Must be <1>, used to represent the number of integer cells in
-the dmas property of client devices.
-  - The 1st cell specifies the channel configuration register:
-    - bit 13: SIF, source interface identifier, used to get the memory
-    interface identifier,
-    - bit 14: DIF, destination interface identifier, used to get the peripheral
-    interface identifier,
-    - bit 30-24: PERID, peripheral identifier.
-
-Example:
-
-dma1: dma-controller@f0004000 {
-	compatible = "atmel,sama5d4-dma";
-	reg = <0xf0004000 0x200>;
-	interrupts = <50 4 0>;
-	#dma-cells = <1>;
-};
-
-
-* DMA clients
-DMA clients connected to the Atmel XDMA controller must use the format
-described in the dma.txt file, using a one-cell specifier for each channel.
-The two cells in order are:
-1. A phandle pointing to the DMA controller.
-2. Channel configuration register. Configurable fields are:
-    - bit 13: SIF, source interface identifier, used to get the memory
-    interface identifier,
-    - bit 14: DIF, destination interface identifier, used to get the peripheral
-    interface identifier,
-  - bit 30-24: PERID, peripheral identifier.
-
-Example:
-
-i2c2: i2c@f8024000 {
-	compatible = "atmel,at91sam9x5-i2c";
-	reg = <0xf8024000 0x4000>;
-	interrupts = <34 4 6>;
-	dmas = <&dma1
-		(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)
-		 | AT91_XDMAC_DT_PERID(6))>,
-	       <&dma1
-		(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)
-		| AT91_XDMAC_DT_PERID(7))>;
-	dma-names = "tx", "rx";
-};
Documentation/devicetree/bindings/dma/microchip,at91-xdma.yaml new file +77 -0

77 lines not on this page · raw message

---
base-commit: 8d3dea210042f54b952b481838c1e7dfc4ec751d
change-id: 20240215-xdma-36e8bdbf8141

Best regards,

Signature · 1 line
Durai Manickam KR <[email protected]>
#1 lore raw
Quoted 71 lines · Durai Manickam KR

Added a description, required properties and appropriate compatibles for all the SoCs that are supported by microchip for the XDMAC.

---
 .../devicetree/bindings/dma/atmel-xdma.txt         | 54 ---------------
 .../bindings/dma/microchip,at91-xdma.yaml          | 77 ++++++++++++++++++++++
 2 files changed, 77 insertions(+), 54 deletions(-)
Documentation/devicetree/bindings/dma/atmel-xdma.txt deleted +0 -49
deleted file mode 100644
index 76d649b3a25d..000000000000
@@ -1,54 +0,0 @@
-* Atmel Extensible Direct Memory Access Controller (XDMAC)
-
-* XDMA Controller
 
-- interrupts: Should contain DMA interrupt.
-- #dma-cells: Must be <1>, used to represent the number of integer cells in
-the dmas property of client devices.
-  - The 1st cell specifies the channel configuration register:
-    - bit 13: SIF, source interface identifier, used to get the memory
-    interface identifier,
-    - bit 14: DIF, destination interface identifier, used to get the peripheral
-    interface identifier,
-    - bit 30-24: PERID, peripheral identifier.
-
-Example:
-
-dma1: dma-controller@f0004000 {
-	compatible = "atmel,sama5d4-dma";
-	reg = <0xf0004000 0x200>;
-	interrupts = <50 4 0>;
-	#dma-cells = <1>;
-};
-
-
-* DMA clients
-DMA clients connected to the Atmel XDMA controller must use the format
-described in the dma.txt file, using a one-cell specifier for each channel.
-The two cells in order are:
-1. A phandle pointing to the DMA controller.
-2. Channel configuration register. Configurable fields are:
-    - bit 13: SIF, source interface identifier, used to get the memory
-    interface identifier,
-    - bit 14: DIF, destination interface identifier, used to get the peripheral
-    interface identifier,
-  - bit 30-24: PERID, peripheral identifier.
-
-Example:
-
-i2c2: i2c@f8024000 {
-	compatible = "atmel,at91sam9x5-i2c";
-	reg = <0xf8024000 0x4000>;
-	interrupts = <34 4 6>;
-	dmas = <&dma1
-		(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)
-		 | AT91_XDMAC_DT_PERID(6))>,
-	       <&dma1
-		(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)
-		| AT91_XDMAC_DT_PERID(7))>;
-	dma-names = "tx", "rx";
-};
Documentation/devicetree/bindings/dma/microchip,at91-xdma.yaml new file +0 -0
new file mode 100644
index 000000000000..0bd79c7b5e6f

Documentation/devicetree/bindings/dma/microchip,at91-xdma.yaml line 4

Quoted 4 lines
Documentation/devicetree/bindings/dma/microchip,at91-xdma.yaml new file +4 -0
@@ -0,0 +1,77 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/dma/microchip,at91-xdma.yaml#

Filename matching a compatible please.

Documentation/devicetree/bindings/dma/microchip,at91-xdma.yaml line 12

Quoted 8 lines
Documentation/devicetree/bindings/dma/microchip,at91-xdma.yaml new file +8 -0
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Atmel Extensible Direct Memory Access Controller (XDMAC)
+
+maintainers:
+  - Durai Manickam KR <[email protected]>
+
+description: |

The | is not needed, you've no formatting to preserve.

Documentation/devicetree/bindings/dma/microchip,at91-xdma.yaml line 24

Quoted 12 lines
Documentation/devicetree/bindings/dma/microchip,at91-xdma.yaml new file +12 -0
+  The Atmel Extensible Direct Memory Access Controller (XDMAC) performs peripheral
+  data transfer and memory move operations over one or two bus ports through the
+  unidirectional communication channel. Each channel is fully programmable and
+  provides both peripheral or memory-to-memory transfers.
+
+properties:
+  compatible:
+    oneOf:
+      - enum:
+          - atmel,sama5d4-dma
+          - microchip,sama7g5-dma
+          - microchip,sam9x7-dma

The text binding says:

Documentation/devicetree/bindings/dma/microchip,at91-xdma.yaml

Quoted 3 lines
Documentation/devicetree/bindings/dma/microchip,at91-xdma.yaml new file +0 -3
-- compatible: Should be "atmel,sama5d4-dma", "microchip,sam9x60-dma" or
-  "microchip,sama7g5-dma" or
-  "microchip,sam9x7-dma", "atmel,sama5d4-dma".

That's not what you have here at all.

Documentation/devicetree/bindings/dma/microchip,at91-xdma.yaml line 27

Quoted 3 lines
Documentation/devicetree/bindings/dma/microchip,at91-xdma.yaml new file +3 -0
+      - items:
+          - const: atmel,sama5d4-dma
+          - const: microchip,sam9x60-dma

This looks backwards.

Documentation/devicetree/bindings/dma/microchip,at91-xdma.yaml line 30

Quoted 3 lines
Documentation/devicetree/bindings/dma/microchip,at91-xdma.yaml new file +3 -0
+  reg:
+    description: Should contain DMA registers location and length.
+    maxItems: 1

Same comments here about descriptions for well known properties as the other DMA controller.

Quoted 10 lines
Documentation/devicetree/bindings/dma/microchip,at91-xdma.yaml new file +10 -0
+
+  interrupts:
+    description: Should contain the DMA interrupts associated to the DMA channels.
+    maxItems: 1
+
+  "#dma-cells":
+    description: |
+      Must be <1>, used to represent the number of integer cells in the dmas
+      property of client device.
+      -The 1st cell specifies the channel configuration register:

Documentation/devicetree/bindings/dma/microchip,at91-xdma.yaml line 50

Quoted 10 lines
Documentation/devicetree/bindings/dma/microchip,at91-xdma.yaml new file +10 -0
+      -bit 13: SIF, source interface identifier, used to get the memory
+               interface identifier,
+      -bit 14: DIF, destination interface identifier, used to get the peripheral
+               interface identifier,
+      -bit 30-24: PERID, peripheral identifier.
+    const: 1
+
+  clocks:
+    description: Should contain a clock specifier for each entry in clock-names.
+    maxItems: 1

And here about adding properties. Please explain in your commit message where the new properties came from.

Quoted 8 lines
Documentation/devicetree/bindings/dma/microchip,at91-xdma.yaml new file +8 -0
+
+  clock-names:
+    description: Should contain the clock of the DMA controller.
+    const: dma_clk
+
+required:
+  - compatible
+  - reg

Documentation/devicetree/bindings/dma/microchip,at91-xdma.yaml line 68

Quoted 10 lines
Documentation/devicetree/bindings/dma/microchip,at91-xdma.yaml new file +10 -0
+  - interrupts
+  - "#dma-cells"
+  - clocks
+  - clock-names
+
+additionalProperties: false
+
+examples:
+  - |
+    dma0: dma-controller@f0004000 {

And same here about the label :)

Cheers,
Conor.

Quoted 18 lines
Documentation/devicetree/bindings/dma/microchip,at91-xdma.yaml new file +9 -1
+            compatible = "atmel,sama5d4-dma";
+            reg = <0xffffec00 0x200>;
+            interrupts = <50 4 0>;
+            #dma-cells = <1>;
+            clocks = <&pmc 2 20>;
+            clock-names = "dma_clk";
+    };
+
+...
 
---

base-commit: 8d3dea210042f54b952b481838c1e7dfc4ec751d
change-id: 20240215-xdma-36e8bdbf8141

Best regards,

Signature · 1 line
Durai Manickam KR <[email protected]>