[PATCH v4 1/3] dt-bindings: dma: Add Amlogic A9 SoC DMA

Xianwei Zhao via B4 Relay posted 3 patches 1 month, 1 week ago
There is a newer version of this series
[PATCH v4 1/3] dt-bindings: dma: Add Amlogic A9 SoC DMA
Posted by Xianwei Zhao via B4 Relay 1 month, 1 week ago
From: Xianwei Zhao <xianwei.zhao@amlogic.com>

Add documentation describing the Amlogic A9 SoC DMA. And add
the properties specific values defines into a new include file.

Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
---
 .../devicetree/bindings/dma/amlogic,a9-dma.yaml    | 65 ++++++++++++++++++++++
 include/dt-bindings/dma/amlogic-dma.h              |  8 +++
 2 files changed, 73 insertions(+)

diff --git a/Documentation/devicetree/bindings/dma/amlogic,a9-dma.yaml b/Documentation/devicetree/bindings/dma/amlogic,a9-dma.yaml
new file mode 100644
index 000000000000..efd7b2602c33
--- /dev/null
+++ b/Documentation/devicetree/bindings/dma/amlogic,a9-dma.yaml
@@ -0,0 +1,65 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/dma/amlogic,a9-dma.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Amlogic general DMA controller
+
+description:
+  This is a general-purpose peripheral DMA controller. It currently supports
+  major peripherals including I2C, I3C, PIO, and CAN-BUS. Transmit and receive
+  for the same peripheral use two separate channels, controlled by different
+  register sets. I2C and I3C transfer data in 1-byte units, while PIO and
+  CAN-BUS transfer data in 4-byte units. From the controller’s perspective,
+  there is no significant difference.
+
+maintainers:
+  - Xianwei Zhao <xianwei.zhao@amlogic.com>
+
+properties:
+  compatible:
+    const: amlogic,a9-dma
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    const: sys
+
+  '#dma-cells':
+    const: 2
+
+  dma-channels:
+    maximum: 64
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - '#dma-cells'
+  - dma-channels
+
+allOf:
+  - $ref: dma-controller.yaml#
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    dma-controller@fe400000{
+        compatible = "amlogic,a9-dma";
+        reg = <0xfe400000 0x4000>;
+        interrupts = <GIC_SPI 35 IRQ_TYPE_EDGE_RISING>;
+        clocks = <&clkc 45>;
+        #dma-cells = <2>;
+        dma-channels = <28>;
+    };
diff --git a/include/dt-bindings/dma/amlogic-dma.h b/include/dt-bindings/dma/amlogic-dma.h
new file mode 100644
index 000000000000..025ecc42e395
--- /dev/null
+++ b/include/dt-bindings/dma/amlogic-dma.h
@@ -0,0 +1,8 @@
+/* SPDX-License-Identifier: (GPL-2.0 OR MIT) */
+
+#ifndef __DT_BINDINGS_DMA_AMLOGIC_DMA_H__
+#define __DT_BINDINGS_DMA_AMLOGIC_DMA_H__
+
+#define AML_DMA_TYPE_TX		0
+#define AML_DMA_TYPE_RX		1
+#endif /* __DT_BINDINGS_DMA_AMLOGIC_DMA_H__ */

-- 
2.52.0


Re: [PATCH v4 1/3] dt-bindings: dma: Add Amlogic A9 SoC DMA
Posted by Krzysztof Kozlowski 1 month, 1 week ago
On Fri, Feb 27, 2026 at 07:20:53AM +0000, Xianwei Zhao wrote:
> Add documentation describing the Amlogic A9 SoC DMA. And add
> the properties specific values defines into a new include file.
> 
> Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
> ---
>  .../devicetree/bindings/dma/amlogic,a9-dma.yaml    | 65 ++++++++++++++++++++++
>  include/dt-bindings/dma/amlogic-dma.h              |  8 +++
>  2 files changed, 73 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/dma/amlogic,a9-dma.yaml b/Documentation/devicetree/bindings/dma/amlogic,a9-dma.yaml
> new file mode 100644
> index 000000000000..efd7b2602c33
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/dma/amlogic,a9-dma.yaml
> @@ -0,0 +1,65 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/dma/amlogic,a9-dma.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Amlogic general DMA controller
> +
> +description:
> +  This is a general-purpose peripheral DMA controller. It currently supports
> +  major peripherals including I2C, I3C, PIO, and CAN-BUS. Transmit and receive
> +  for the same peripheral use two separate channels, controlled by different
> +  register sets. I2C and I3C transfer data in 1-byte units, while PIO and
> +  CAN-BUS transfer data in 4-byte units. From the controller’s perspective,
> +  there is no significant difference.
> +
> +maintainers:
> +  - Xianwei Zhao <xianwei.zhao@amlogic.com>
> +
> +properties:
> +  compatible:
> +    const: amlogic,a9-dma
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  clocks:
> +    maxItems: 1
> +
> +  clock-names:
> +    const: sys
> +
> +  '#dma-cells':
> +    const: 2
> +
> +  dma-channels:
> +    maximum: 64
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - clocks
> +  - '#dma-cells'
> +  - dma-channels
> +
> +allOf:
> +  - $ref: dma-controller.yaml#
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/arm-gic.h>
> +    dma-controller@fe400000{
> +        compatible = "amlogic,a9-dma";
> +        reg = <0xfe400000 0x4000>;
> +        interrupts = <GIC_SPI 35 IRQ_TYPE_EDGE_RISING>;
> +        clocks = <&clkc 45>;
> +        #dma-cells = <2>;
> +        dma-channels = <28>;
> +    };
> diff --git a/include/dt-bindings/dma/amlogic-dma.h b/include/dt-bindings/dma/amlogic-dma.h

Filename must be the same as binding file.

> new file mode 100644
> index 000000000000..025ecc42e395
> --- /dev/null
> +++ b/include/dt-bindings/dma/amlogic-dma.h
> @@ -0,0 +1,8 @@
> +/* SPDX-License-Identifier: (GPL-2.0 OR MIT) */
> +
> +#ifndef __DT_BINDINGS_DMA_AMLOGIC_DMA_H__
> +#define __DT_BINDINGS_DMA_AMLOGIC_DMA_H__
> +
> +#define AML_DMA_TYPE_TX		0
> +#define AML_DMA_TYPE_RX		1

You sure you need AML prefix? Your clock constants do not have AML
prefixes. What other constants do you expect here?

Best regards,
Krzysztof
Re: [PATCH v4 1/3] dt-bindings: dma: Add Amlogic A9 SoC DMA
Posted by Xianwei Zhao 1 month, 1 week ago
Hi Krzysztof,
    Thanks for your reply.

On 2026/2/27 17:18, Krzysztof Kozlowski wrote:
> On Fri, Feb 27, 2026 at 07:20:53AM +0000, Xianwei Zhao wrote:
>> Add documentation describing the Amlogic A9 SoC DMA. And add
>> the properties specific values defines into a new include file.
>>
>> Signed-off-by: Xianwei Zhao<xianwei.zhao@amlogic.com>
>> ---
>>   .../devicetree/bindings/dma/amlogic,a9-dma.yaml    | 65 ++++++++++++++++++++++
>>   include/dt-bindings/dma/amlogic-dma.h              |  8 +++
>>   2 files changed, 73 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/dma/amlogic,a9-dma.yaml b/Documentation/devicetree/bindings/dma/amlogic,a9-dma.yaml
>> new file mode 100644
>> index 000000000000..efd7b2602c33
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/dma/amlogic,a9-dma.yaml
>> @@ -0,0 +1,65 @@
>> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
>> +%YAML 1.2
>> +---
>> +$id:http://devicetree.org/schemas/dma/amlogic,a9-dma.yaml#
>> +$schema:http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Amlogic general DMA controller
>> +
>> +description:
>> +  This is a general-purpose peripheral DMA controller. It currently supports
>> +  major peripherals including I2C, I3C, PIO, and CAN-BUS. Transmit and receive
>> +  for the same peripheral use two separate channels, controlled by different
>> +  register sets. I2C and I3C transfer data in 1-byte units, while PIO and
>> +  CAN-BUS transfer data in 4-byte units. From the controller’s perspective,
>> +  there is no significant difference.
>> +
>> +maintainers:
>> +  - Xianwei Zhao<xianwei.zhao@amlogic.com>
>> +
>> +properties:
>> +  compatible:
>> +    const: amlogic,a9-dma
>> +
>> +  reg:
>> +    maxItems: 1
>> +
>> +  interrupts:
>> +    maxItems: 1
>> +
>> +  clocks:
>> +    maxItems: 1
>> +
>> +  clock-names:
>> +    const: sys
>> +
>> +  '#dma-cells':
>> +    const: 2
>> +
>> +  dma-channels:
>> +    maximum: 64
>> +
>> +required:
>> +  - compatible
>> +  - reg
>> +  - interrupts
>> +  - clocks
>> +  - '#dma-cells'
>> +  - dma-channels
>> +
>> +allOf:
>> +  - $ref: dma-controller.yaml#
>> +
>> +unevaluatedProperties: false
>> +
>> +examples:
>> +  - |
>> +    #include <dt-bindings/interrupt-controller/arm-gic.h>
>> +    dma-controller@fe400000{
>> +        compatible = "amlogic,a9-dma";
>> +        reg = <0xfe400000 0x4000>;
>> +        interrupts = <GIC_SPI 35 IRQ_TYPE_EDGE_RISING>;
>> +        clocks = <&clkc 45>;
>> +        #dma-cells = <2>;
>> +        dma-channels = <28>;
>> +    };
>> diff --git a/include/dt-bindings/dma/amlogic-dma.h b/include/dt-bindings/dma/amlogic-dma.h
> Filename must be the same as binding file.
>

Will do.

>> new file mode 100644
>> index 000000000000..025ecc42e395
>> --- /dev/null
>> +++ b/include/dt-bindings/dma/amlogic-dma.h
>> @@ -0,0 +1,8 @@
>> +/* SPDX-License-Identifier: (GPL-2.0 OR MIT) */
>> +
>> +#ifndef __DT_BINDINGS_DMA_AMLOGIC_DMA_H__
>> +#define __DT_BINDINGS_DMA_AMLOGIC_DMA_H__
>> +
>> +#define AML_DMA_TYPE_TX              0
>> +#define AML_DMA_TYPE_RX              1
> You sure you need AML prefix? Your clock constants do not have AML
> prefixes. What other constants do you expect here?
> 

I will delete AML prefix in next version.

> Best regards,
> Krzysztof
Re: [PATCH v4 1/3] dt-bindings: dma: Add Amlogic A9 SoC DMA
Posted by Krzysztof Kozlowski 1 month, 1 week ago
On 27/02/2026 10:43, Xianwei Zhao wrote:
>>> new file mode 100644
>>> index 000000000000..025ecc42e395
>>> --- /dev/null
>>> +++ b/include/dt-bindings/dma/amlogic-dma.h
>>> @@ -0,0 +1,8 @@
>>> +/* SPDX-License-Identifier: (GPL-2.0 OR MIT) */
>>> +
>>> +#ifndef __DT_BINDINGS_DMA_AMLOGIC_DMA_H__
>>> +#define __DT_BINDINGS_DMA_AMLOGIC_DMA_H__
>>> +
>>> +#define AML_DMA_TYPE_TX              0
>>> +#define AML_DMA_TYPE_RX              1
>> You sure you need AML prefix? Your clock constants do not have AML
>> prefixes. What other constants do you expect here?
>>
> 
> I will delete AML prefix in next version.

I assume this is an argument to "dma" phandle (cells), so maybe should
be "DMA_TX/RX"?

Best regards,
Krzysztof
Re: [PATCH v4 1/3] dt-bindings: dma: Add Amlogic A9 SoC DMA
Posted by Xianwei Zhao 1 month, 1 week ago

On 2026/2/27 17:44, Krzysztof Kozlowski wrote:
> On 27/02/2026 10:43, Xianwei Zhao wrote:
>>>> new file mode 100644
>>>> index 000000000000..025ecc42e395
>>>> --- /dev/null
>>>> +++ b/include/dt-bindings/dma/amlogic-dma.h
>>>> @@ -0,0 +1,8 @@
>>>> +/* SPDX-License-Identifier: (GPL-2.0 OR MIT) */
>>>> +
>>>> +#ifndef __DT_BINDINGS_DMA_AMLOGIC_DMA_H__
>>>> +#define __DT_BINDINGS_DMA_AMLOGIC_DMA_H__
>>>> +
>>>> +#define AML_DMA_TYPE_TX              0
>>>> +#define AML_DMA_TYPE_RX              1
>>> You sure you need AML prefix? Your clock constants do not have AML
>>> prefixes. What other constants do you expect here?
>>>
>> I will delete AML prefix in next version.
> I assume this is an argument to "dma" phandle (cells), so maybe should
> be "DMA_TX/RX"?
> 

Thank you for your suggestion. I'll use it.

> Best regards,
> Krzysztof