Skip to contentSkip to conversation

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

PATCH Superseded Charan Pedumuru 2 participants 3 messages Jan 27, 2025 – Jan 28, 2025

Subsystems (4)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

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

From: Durai Manickam KR <[email protected]>

Add a description, required properties, appropriate compatibles and missing properties like clocks and clock-names which are not defined in the text binding for all the SoCs that are supported by microchip. Update the text binding name atmel-dma.txt to atmel,at91sam9g45-dma.yaml for the files which reference to atmel-dma.txt. Drop Tudor name from maintainers.

---
Changes in v3:
- Renamed the text binding name atmel-dma.txt to atmel,at91sam9g45-dma.yaml for the files which reference to atmel-dma.txt.
- Removed oneOf and add a blank line in properties.
- Dropped Tudor name from maintainers.
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- Renamed the yaml file to a compatible.
- Removed | and description for common properties.
- Modified the commit message.
- Dropped the label for the node in examples.
- Link to v1: https://lore.kernel.org/all/[email protected]

---
 .../bindings/dma/atmel,at91sam9g45-dma.yaml        | 66 ++++++++++++++++++++++
 .../devicetree/bindings/dma/atmel-dma.txt          | 42 --------------
 .../devicetree/bindings/misc/atmel-ssc.txt         |  2 +-
 MAINTAINERS                                        |  2 +-
 4 files changed, 68 insertions(+), 44 deletions(-)
Documentation/devicetree/bindings/dma/atmel,at91sam9g45-dma.yaml new file +66 -0
new file mode 100644
index 000000000000..d6d16869b7db
@@ -0,0 +1,66 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/dma/atmel,at91sam9g45-dma.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Atmel Direct Memory Access Controller (DMA)
+
+maintainers:
+  - Ludovic Desroches <[email protected]>
+
+description:
+  The Atmel Direct Memory Access Controller (DMAC) transfers data from a source
+  peripheral to a destination peripheral over one or more AMBA buses. One channel
+  is required for each source/destination pair. In the most basic configuration,
+  the DMAC has one master interface and one channel. The master interface reads
+  the data from a source and writes it to a destination. Two AMBA transfers are
+  required for each DMAC data transfer. This is also known as a dual-access transfer.
+  The DMAC is programmed via the APB interface.
+
+properties:
+  compatible:
+    enum:
+      - atmel,at91sam9g45-dma
+      - atmel,at91sam9rl-dma
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  "#dma-cells":
+    description:
+      Must be <2>, used to represent the number of integer cells in the dmas
+      property of client devices.
+    const: 2
+
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    const: dma_clk
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - "#dma-cells"
+  - clocks
+  - clock-names
+
+additionalProperties: false
+
+examples:
+  - |
+    dma-controller@ffffec00 {
+        compatible = "atmel,at91sam9g45-dma";
+        reg = <0xffffec00 0x200>;
+        interrupts = <21>;
+        #dma-cells = <2>;
+        clocks = <&pmc 2 20>;
+        clock-names = "dma_clk";
+    };
+
+...
Documentation/devicetree/bindings/dma/atmel-dma.txt deleted +0 -42

42 lines not on this page · raw message

Documentation/devicetree/bindings/misc/atmel-ssc.txt +1 -1
index f9fb412642fe..b159dc2298b6 100644
@@ -14,7 +14,7 @@ Required properties:
 Required properties for devices compatible with "atmel,at91sam9g45-ssc":
 - dmas: DMA specifier, consisting of a phandle to DMA controller node,
   the memory interface and SSC DMA channel ID (for tx and rx).
-  See Documentation/devicetree/bindings/dma/atmel-dma.txt for details.
+  See Documentation/devicetree/bindings/dma/atmel,at91sam9g45-dma.yaml for details.
 - dma-names: Must be "tx", "rx".
 
 Optional properties:
MAINTAINERS +1 -1
index 962eab2ce359..f1f4e3956f45 100644
@@ -15348,7 +15348,7 @@ M:	Ludovic Desroches <[email protected]>
 L:	[email protected] (moderated for non-subscribers)
 L:	[email protected]
 S:	Supported
-F:	Documentation/devicetree/bindings/dma/atmel-dma.txt
+F:	Documentation/devicetree/bindings/dma/atmel,at91sam9g45-dma.yaml
 F:	drivers/dma/at_hdmac.c
 F:	drivers/dma/at_xdmac.c
 F:	include/dt-bindings/dma/at91.h

---
base-commit: 232f121837ad8b1c21cc80f2c8842a4090c5a2a0
change-id: 20250127-test-80e5c48cf747

Best regards,

Signature · 1 line
Charan Pedumuru <[email protected]>
maintainer
#1 lore raw
Quoted 65 lines · Charan Pedumuru

From: Durai Manickam KR <[email protected]>

Add a description, required properties, appropriate compatibles and missing properties like clocks and clock-names which are not defined in the text binding for all the SoCs that are supported by microchip. Update the text binding name atmel-dma.txt to atmel,at91sam9g45-dma.yaml for the files which reference to atmel-dma.txt. Drop Tudor name from maintainers.

---
Changes in v3:
- Renamed the text binding name atmel-dma.txt to atmel,at91sam9g45-dma.yaml for the files which reference to atmel-dma.txt.
- Removed oneOf and add a blank line in properties.
- Dropped Tudor name from maintainers.
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- Renamed the yaml file to a compatible.
- Removed | and description for common properties.
- Modified the commit message.
- Dropped the label for the node in examples.
- Link to v1: https://lore.kernel.org/all/[email protected]

---
 .../bindings/dma/atmel,at91sam9g45-dma.yaml        | 66 ++++++++++++++++++++++
 .../devicetree/bindings/dma/atmel-dma.txt          | 42 --------------
 .../devicetree/bindings/misc/atmel-ssc.txt         |  2 +-
 MAINTAINERS                                        |  2 +-
 4 files changed, 68 insertions(+), 44 deletions(-)
Documentation/devicetree/bindings/dma/atmel,at91sam9g45-dma.yaml new file +26 -0
new file mode 100644
index 000000000000..d6d16869b7db
@@ -0,0 +1,66 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/dma/atmel,at91sam9g45-dma.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Atmel Direct Memory Access Controller (DMA)
+
+maintainers:
+  - Ludovic Desroches <[email protected]>
+
+description:
+  The Atmel Direct Memory Access Controller (DMAC) transfers data from a source
+  peripheral to a destination peripheral over one or more AMBA buses. One channel
+  is required for each source/destination pair. In the most basic configuration,
+  the DMAC has one master interface and one channel. The master interface reads
+  the data from a source and writes it to a destination. Two AMBA transfers are
+  required for each DMAC data transfer. This is also known as a dual-access transfer.
+  The DMAC is programmed via the APB interface.
+
+properties:
+  compatible:
+    enum:
+      - atmel,at91sam9g45-dma
+      - atmel,at91sam9rl-dma
+

Documentation/devicetree/bindings/dma/atmel,at91sam9g45-dma.yaml line 36

Quoted 10 lines
Documentation/devicetree/bindings/dma/atmel,at91sam9g45-dma.yaml new file +10 -0
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  "#dma-cells":
+    description:
+      Must be <2>, used to represent the number of integer cells in the dmas
+      property of client devices.

You failed to address Conor's comment on this. The above is useless because the schema says it is 2 and the description is for any #dma-cells.

What's missing is answering "what do the 2 cells contain exactly?" That was captured in this text:

Documentation/devicetree/bindings/dma/atmel,at91sam9g45-dma.yaml

Quoted 10 lines
Documentation/devicetree/bindings/dma/atmel,at91sam9g45-dma.yaml new file +0 -10
-The three cells in order are:
-
-1. A phandle pointing to the DMA controller.
-2. The memory interface (16 most significant bits), the peripheral interface
-(16 less significant bits).
-3. Parameters for the at91 DMA configuration register which are device
-dependent:
-  - bit 7-0: peripheral identifier for the hardware handshaking interface. The
-  identifier can be different for tx and rx.
-  - bit 11-8: FIFO configuration. 0 for half FIFO, 1 for ALAP, 2 for ASAP.

Adapt this for the description. (Note it is phandle plus 2 cells, not 3 cells, so you *can* omit the phandle part.)

Rob

#2 lore raw
Quoted 81 lines · Rob Herring

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Quoted 65 lines · Charan Pedumuru

From: Durai Manickam KR <[email protected]>

Add a description, required properties, appropriate compatibles and missing properties like clocks and clock-names which are not defined in the text binding for all the SoCs that are supported by microchip. Update the text binding name atmel-dma.txt to atmel,at91sam9g45-dma.yaml for the files which reference to atmel-dma.txt. Drop Tudor name from maintainers.

---
Changes in v3:
- Renamed the text binding name atmel-dma.txt to atmel,at91sam9g45-dma.yaml for the files which reference to atmel-dma.txt.
- Removed oneOf and add a blank line in properties.
- Dropped Tudor name from maintainers.
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- Renamed the yaml file to a compatible.
- Removed | and description for common properties.
- Modified the commit message.
- Dropped the label for the node in examples.
- Link to v1: https://lore.kernel.org/all/[email protected]

---
  .../bindings/dma/atmel,at91sam9g45-dma.yaml        | 66 ++++++++++++++++++++++
  .../devicetree/bindings/dma/atmel-dma.txt          | 42 --------------
  .../devicetree/bindings/misc/atmel-ssc.txt         |  2 +-
  MAINTAINERS                                        |  2 +-
  4 files changed, 68 insertions(+), 44 deletions(-)
Documentation/devicetree/bindings/dma/atmel,at91sam9g45-dma.yaml new file +26 -0
new file mode 100644
index 000000000000..d6d16869b7db
@@ -0,0 +1,66 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/dma/atmel,at91sam9g45-dma.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Atmel Direct Memory Access Controller (DMA)
+
+maintainers:
+  - Ludovic Desroches <[email protected]>
+
+description:
+  The Atmel Direct Memory Access Controller (DMAC) transfers data from a source
+  peripheral to a destination peripheral over one or more AMBA buses. One channel
+  is required for each source/destination pair. In the most basic configuration,
+  the DMAC has one master interface and one channel. The master interface reads
+  the data from a source and writes it to a destination. Two AMBA transfers are
+  required for each DMAC data transfer. This is also known as a dual-access transfer.
+  The DMAC is programmed via the APB interface.
+
+properties:
+  compatible:
+    enum:
+      - atmel,at91sam9g45-dma
+      - atmel,at91sam9rl-dma
+

Documentation/devicetree/bindings/dma/atmel,at91sam9g45-dma.yaml line 36

Quoted 10 lines
Documentation/devicetree/bindings/dma/atmel,at91sam9g45-dma.yaml new file +10 -0
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  "#dma-cells":
+    description:
+      Must be <2>, used to represent the number of integer cells in the dmas
+      property of client devices.

You failed to address Conor's comment on this. The above is useless because the schema says it is 2 and the description is for any #dma-cells.

Quoted 2 lines

What's missing is answering "what do the 2 cells contain exactly?" That was captured in this text:

Sure, thanks for pointing it out, I will rewrite the description following the below format excluding the phandle part.

Quoted 15 lines

Documentation/devicetree/bindings/dma/atmel,at91sam9g45-dma.yaml

Quoted 11 lines
Documentation/devicetree/bindings/dma/atmel,at91sam9g45-dma.yaml new file +0 -10
-The three cells in order are:
-
-1. A phandle pointing to the DMA controller.
-2. The memory interface (16 most significant bits), the peripheral interface
-(16 less significant bits).
-3. Parameters for the at91 DMA configuration register which are device
-dependent:
-  - bit 7-0: peripheral identifier for the hardware handshaking interface. The
-  identifier can be different for tx and rx.
-  - bit 11-8: FIFO configuration. 0 for half FIFO, 1 for ALAP, 2 for ASAP.

Adapt this for the description. (Note it is phandle plus 2 cells, not 3 cells, so you *can* omit the phandle part.)

Rob

Signature · 2 lines
Best Regards,
Charan.