Skip to contentSkip to conversation

dt-bindings: dma: Convert hisilicon,k3-dma-1.0 to DT schema

PATCH Superseded Rob Herring (Arm) 2 participants 2 messages Sep 25

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Rob Herring (Arm)

author maintainer
#0 lore raw

PATCH 1/1 dt-bindings: dma: Convert hisilicon,k3-dma-1.0 to DT schema

Convert the hisilicon,k3-dma-1.0 binding to DT schema format.

Add dma-channel-mask, dma-no-cci, dma-type and interrupt-names properties which were not documented.

The "hisilicon,hisi-pcm-asp-dma-1.0" doesn't have clocks, so make it optional.

Assisted-by LLM
---
 .../bindings/dma/hisilicon,k3-dma-1.0.yaml    | 87 +++++++++++++++++++
 .../devicetree/bindings/dma/k3dma.txt         | 47 ----------
 2 files changed, 87 insertions(+), 47 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/dma/hisilicon,k3-dma-1.0.yaml
 delete mode 100644 Documentation/devicetree/bindings/dma/k3dma.txt
Documentation/devicetree/bindings/dma/hisilicon,k3-dma-1.0.yaml new file +87 -0
new file mode 100644
index 000000000000..7a7aab5f4c66
@@ -0,0 +1,87 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/dma/hisilicon,k3-dma-1.0.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Hisilicon K3 DMA controller
+
+maintainers:
+  - Wei Xu <[email protected]>
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - hisilicon,k3-dma-1.0
+          - hisilicon,hisi-pcm-asp-dma-1.0
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  '#dma-cells':
+    const: 1
+
+  dma-channels:
+    description: Number of physical DMA channels supported.
+    maximum: 32
+
+  dma-requests:
+    description: Number of virtual DMA request lines supported.
+    maximum: 32
+
+  dma-channel-mask:
+    description: Bitmask of usable DMA channels.
+
+  dma-no-cci:
+    type: boolean
+    description: DMA is not coherent with the CCI.
+
+  dma-type:
+    $ref: /schemas/types.yaml#/definitions/string
+    description: SoC-specific DMA type name.
+    enum:
+      - hi3660_dma
+      - hi6220_dma
+
+  interrupt-names:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - '#dma-cells'
+  - dma-channels
+  - dma-requests
+
+allOf:
+  - $ref: dma-controller.yaml#
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: hisilicon,k3-dma-1.0
+    then:
+      required:
+        - clocks
+
+additionalProperties: false
+
+examples:
+  - |
+    dma@fcd02000 {
+        compatible = "hisilicon,k3-dma-1.0";
+        reg = <0xfcd02000 0x1000>;
+        #dma-cells = <1>;
+        dma-channels = <16>;
+        dma-requests = <27>;
+        interrupts = <0 12 4>;
+        clocks = <&pclk>;
+    };
Documentation/devicetree/bindings/dma/k3dma.txt deleted +0 -47

47 lines not on this page · raw message

Signature · 1 line
2.53.0
#1 lore raw
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] dt-bindings: invalid node name in example failing dma-controller.yaml schema --

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] dt-bindings: invalid node name in example failing dma-controller.yaml schema --

commit e8e749663f823d5245b7a4660ed5a57fe7046856
Author: Rob Herring (Arm) <[email protected]>

dt-bindings: dma: Convert hisilicon,k3-dma-1.0 to DT schema

Convert the hisilicon,k3-dma-1.0 binding to DT schema format. Add undocumented properties and make clocks optional for the hisilicon,hisi-pcm-asp-dma-1.0 hardware.

Quoted 5 lines
Documentation/devicetree/bindings/dma/hisilicon,k3-dma-1.0.yaml new file +0 -0
new file mode 100644
index 0000000000000..7a7aab5f4c66c

[ ... ]

Documentation/devicetree/bindings/dma/hisilicon,k3-dma-1.0.yaml line 79

Quoted 5 lines
Documentation/devicetree/bindings/dma/hisilicon,k3-dma-1.0.yaml new file +5 -0
+additionalProperties: false
+
+examples:
+  - |
+    dma@fcd02000 {

[Severity: Low]
The dma-controller.yaml schema referenced in the allOf block enforces that the node name matches the regex pattern ^dma-controller(@.*)?$.

Since this example node is named dma@fcd02000, will it fail validation during make dt_binding_check? Could this be updated to dma-controller@fcd02000 to satisfy the schema requirements?

Quoted 8 lines
Documentation/devicetree/bindings/dma/hisilicon,k3-dma-1.0.yaml new file +8 -0
+        compatible = "hisilicon,k3-dma-1.0";
+        reg = <0xfcd02000 0x1000>;
+        #dma-cells = <1>;
+        dma-channels = <16>;
+        dma-requests = <27>;
+        interrupts = <0 12 4>;
+        clocks = <&pclk>;
+    };
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1