[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250821150255.236884-1-ninozhang001@gmail.com>
Date: Thu, 21 Aug 2025 23:02:55 +0800
From: Nino Zhang <ninozhang001@...il.com>
To: vkoul@...nel.org
Cc: robh@...nel.org,
krzk+dt@...nel.org,
conor+dt@...nel.org,
dmaengine@...r.kernel.org,
devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org,
Nino Zhang <ninozhang001@...il.com>
Subject: [PATCH] dt-bindings: dma: img-mdc-dma: convert to DT schema
Convert the img-mdc-dma binding from txt to YAML schema.
No functional changes except dropping the consumer node
(spi@...00f00) from the example, which belongs to the
consumer binding instead.
Tested with 'make dt_binding_check'.
Signed-off-by: Nino Zhang <ninozhang001@...il.com>
---
.../devicetree/bindings/dma/img-mdc-dma.txt | 57 -----------
.../devicetree/bindings/dma/img-mdc-dma.yaml | 98 +++++++++++++++++++
2 files changed, 98 insertions(+), 57 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/dma/img-mdc-dma.txt
create mode 100644 Documentation/devicetree/bindings/dma/img-mdc-dma.yaml
diff --git a/Documentation/devicetree/bindings/dma/img-mdc-dma.txt b/Documentation/devicetree/bindings/dma/img-mdc-dma.txt
deleted file mode 100644
index 28c1341db346..000000000000
--- a/Documentation/devicetree/bindings/dma/img-mdc-dma.txt
+++ /dev/null
@@ -1,57 +0,0 @@
-* IMG Multi-threaded DMA Controller (MDC)
-
-Required properties:
-- compatible: Must be "img,pistachio-mdc-dma".
-- reg: Must contain the base address and length of the MDC registers.
-- interrupts: Must contain all the per-channel DMA interrupts.
-- clocks: Must contain an entry for each entry in clock-names.
- See ../clock/clock-bindings.txt for details.
-- clock-names: Must include the following entries:
- - sys: MDC system interface clock.
-- img,cr-periph: Must contain a phandle to the peripheral control syscon
- node which contains the DMA request to channel mapping registers.
-- img,max-burst-multiplier: Must be the maximum supported burst size multiplier.
- The maximum burst size is this value multiplied by the hardware-reported bus
- width.
-- #dma-cells: Must be 3:
- - The first cell is the peripheral's DMA request line.
- - The second cell is a bitmap specifying to which channels the DMA request
- line may be mapped (i.e. bit N set indicates channel N is usable).
- - The third cell is the thread ID to be used by the channel.
-
-Optional properties:
-- dma-channels: Number of supported DMA channels, up to 32. If not specified
- the number reported by the hardware is used.
-
-Example:
-
-mdc: dma-controller@...43000 {
- compatible = "img,pistachio-mdc-dma";
- reg = <0x18143000 0x1000>;
- interrupts = <GIC_SHARED 27 IRQ_TYPE_LEVEL_HIGH>,
- <GIC_SHARED 28 IRQ_TYPE_LEVEL_HIGH>,
- <GIC_SHARED 29 IRQ_TYPE_LEVEL_HIGH>,
- <GIC_SHARED 30 IRQ_TYPE_LEVEL_HIGH>,
- <GIC_SHARED 31 IRQ_TYPE_LEVEL_HIGH>,
- <GIC_SHARED 32 IRQ_TYPE_LEVEL_HIGH>,
- <GIC_SHARED 33 IRQ_TYPE_LEVEL_HIGH>,
- <GIC_SHARED 34 IRQ_TYPE_LEVEL_HIGH>,
- <GIC_SHARED 35 IRQ_TYPE_LEVEL_HIGH>,
- <GIC_SHARED 36 IRQ_TYPE_LEVEL_HIGH>,
- <GIC_SHARED 37 IRQ_TYPE_LEVEL_HIGH>,
- <GIC_SHARED 38 IRQ_TYPE_LEVEL_HIGH>;
- clocks = <&system_clk>;
- clock-names = "sys";
-
- img,max-burst-multiplier = <16>;
- img,cr-periph = <&cr_periph>;
-
- #dma-cells = <3>;
-};
-
-spi@...00f00 {
- ...
- dmas = <&mdc 9 0xffffffff 0>, <&mdc 10 0xffffffff 0>;
- dma-names = "tx", "rx";
- ...
-};
diff --git a/Documentation/devicetree/bindings/dma/img-mdc-dma.yaml b/Documentation/devicetree/bindings/dma/img-mdc-dma.yaml
new file mode 100644
index 000000000000..b635125d7ae3
--- /dev/null
+++ b/Documentation/devicetree/bindings/dma/img-mdc-dma.yaml
@@ -0,0 +1,98 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/dma/img-mdc-dma.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: IMG Multi-threaded DMA Controller (MDC)
+
+maintainers:
+ - Vinod Koul <vkoul@...nel.org>
+
+allOf:
+ - $ref: /schemas/dma/dma-controller.yaml#
+
+properties:
+ compatible:
+ description: Must be "img,pistachio-mdc-dma".
+ const: img,pistachio-mdc-dma
+
+ reg:
+ description:
+ Must contain the base address and length of the MDC registers.
+ minItems: 1
+
+ interrupts:
+ description:
+ Must contain all the per-channel DMA interrupts.
+
+ clocks:
+ description: |
+ Must contain an entry for each entry in clock-names.
+ See clock/clock.yaml for details.
+
+ clock-names:
+ description: |
+ Must include the following entries:
+ - sys: MDC system interface clock.
+ minItems: 1
+ contains: { const: sys }
+
+ img,cr-periph:
+ $ref: /schemas/types.yaml#/definitions/phandle
+ description: |
+ Must contain a phandle to the peripheral control syscon node
+ which contains the DMA request to channel mapping registers.
+
+ img,max-burst-multiplier:
+ description: |
+ Must be the maximum supported burst size multiplier.
+ The maximum burst size is this value multiplied by the
+ hardware-reported bus width.
+ $ref: /schemas/types.yaml#/definitions/uint32
+
+ "#dma-cells":
+ description: |
+ Must be 3:
+ - The first cell is the peripheral's DMA request line.
+ - The second cell is a bitmap specifying to which channels the DMA request
+ line may be mapped (i.e. bit N set indicates channel N is usable).
+ - The third cell is the thread ID to be used by the channel.
+ const: 3
+
+ dma-channels:
+ description: |
+ Number of supported DMA channels, up to 32. If not specified
+ the number reported by the hardware is used.
+ $ref: /schemas/types.yaml#/definitions/uint32
+ maximum: 32
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - clocks
+ - clock-names
+ - "img,cr-periph"
+ - "img,max-burst-multiplier"
+ - "#dma-cells"
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/interrupt-controller/mips-gic.h>
+ #include <dt-bindings/interrupt-controller/irq.h>
+ mdc: dma-controller@...43000 {
+ compatible = "img,pistachio-mdc-dma";
+ reg = <0x18143000 0x1000>;
+ interrupts = <GIC_SHARED 27 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SHARED 28 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&system_clk>;
+ clock-names = "sys";
+
+ img,max-burst-multiplier = <16>;
+ img,cr-periph = <&cr_periph>;
+
+ #dma-cells = <3>;
+ };
--
2.43.0
Powered by blists - more mailing lists