[v2,1/2] dt-bindings: dmaengine: Add UniPhier external DMA controller bindings
diff mbox series

Message ID 1580362048-28455-2-git-send-email-hayashi.kunihiko@socionext.com
State Superseded
Headers show
Series
  • dmaengine: Add UniPhier XDMAC driver
Related show

Commit Message

Kunihiko Hayashi Jan. 30, 2020, 5:27 a.m. UTC
Add devicetree binding documentation for external DMA controller
implemented on Socionext UniPhier SoCs.

Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
 .../bindings/dma/socionext,uniphier-xdmac.yaml     | 57 ++++++++++++++++++++++
 1 file changed, 57 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/dma/socionext,uniphier-xdmac.yaml

Comments

Rob Herring Feb. 6, 2020, 5:54 p.m. UTC | #1
On Thu, Jan 30, 2020 at 02:27:27PM +0900, Kunihiko Hayashi wrote:
> Add devicetree binding documentation for external DMA controller
> implemented on Socionext UniPhier SoCs.
> 
> Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
> ---
>  .../bindings/dma/socionext,uniphier-xdmac.yaml     | 57 ++++++++++++++++++++++
>  1 file changed, 57 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/dma/socionext,uniphier-xdmac.yaml
> 
> diff --git a/Documentation/devicetree/bindings/dma/socionext,uniphier-xdmac.yaml b/Documentation/devicetree/bindings/dma/socionext,uniphier-xdmac.yaml
> new file mode 100644
> index 00000000..32abf18
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/dma/socionext,uniphier-xdmac.yaml
> @@ -0,0 +1,57 @@
> +# SPDX-License-Identifier: GPL-2.0

Dual license new bindings:

(GPL-2.0-only OR BSD-2-Clause)

> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/dma/socionext,uniphier-xdmac.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Socionext UniPhier external DMA controller
> +
> +description: |
> +  This describes the devicetree bindings for an external DMA engine to perform
> +  memory-to-memory or peripheral-to-memory data transfer capable of supporting
> +  16 channels, implemented in Socionext UniPhier SoCs.
> +
> +maintainers:
> +  - Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
> +
> +allOf:
> +  - $ref: "dma-controller.yaml#"
> +
> +properties:
> +  compatible:
> +    items:
> +      - const: socionext,uniphier-xdmac

You can drop 'items' for a single item.

> +
> +  reg:
> +    minItems: 1
> +    maxItems: 2

You need to say what each entry is:

items:
  - description: ...
  - description: ...

> +
> +  interrupts:
> +    maxItems: 1
> +
> +  "#dma-cells":
> +    const: 2
> +    description: |
> +      DMA request from clients consists of 2 cells:
> +        1. Channel index
> +        2. Transfer request factor number, If no transfer factor, use 0.
> +           The number is SoC-specific, and this should be specified with
> +           relation to the device to use the DMA controller.
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - "#dma-cells"

Add:

additionalProperties: false

> +
> +examples:
> +  - |
> +    xdmac: dma-controller@5fc10000 {
> +        compatible = "socionext,uniphier-xdmac";
> +        reg = <0x5fc10000 0x1000>, <0x5fc20000 0x800>;
> +        interrupts = <0 188 4>;
> +        #dma-cells = <2>;
> +        dma-channels = <16>;

Not documented. You need at least 'dma-channels: true' to indicate 
you're using this. But you should be able to have some constraints such 
as 'maximum: 16'.

Rob
Kunihiko Hayashi Feb. 7, 2020, 1:15 a.m. UTC | #2
Hi Rob,

Thank you for reviewing.
Your comments are helpful as I'm not familiar with the new bindings yet.

On Thu, 6 Feb 2020 17:54:58 +0000 <robh@kernel.org> wrote:

> On Thu, Jan 30, 2020 at 02:27:27PM +0900, Kunihiko Hayashi wrote:
> > Add devicetree binding documentation for external DMA controller
> > implemented on Socionext UniPhier SoCs.
> > 
> > Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
> > ---
> >  .../bindings/dma/socionext,uniphier-xdmac.yaml     | 57 ++++++++++++++++++++++
> >  1 file changed, 57 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/dma/socionext,uniphier-xdmac.yaml
> > 
> > diff --git a/Documentation/devicetree/bindings/dma/socionext,uniphier-xdmac.yaml b/Documentation/devicetree/bindings/dma/socionext,uniphier-xdmac.yaml
> > new file mode 100644
> > index 00000000..32abf18
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/dma/socionext,uniphier-xdmac.yaml
> > @@ -0,0 +1,57 @@
> > +# SPDX-License-Identifier: GPL-2.0
> 
> Dual license new bindings:
> 
> (GPL-2.0-only OR BSD-2-Clause)

I'll replace with it.

> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/dma/socionext,uniphier-xdmac.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Socionext UniPhier external DMA controller
> > +
> > +description: |
> > +  This describes the devicetree bindings for an external DMA engine to perform
> > +  memory-to-memory or peripheral-to-memory data transfer capable of supporting
> > +  16 channels, implemented in Socionext UniPhier SoCs.
> > +
> > +maintainers:
> > +  - Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
> > +
> > +allOf:
> > +  - $ref: "dma-controller.yaml#"
> > +
> > +properties:
> > +  compatible:
> > +    items:
> > +      - const: socionext,uniphier-xdmac
> 
> You can drop 'items' for a single item.

I see.
I found some documents didn't have expression for a compatible string.

> > +
> > +  reg:
> > +    minItems: 1
> > +    maxItems: 2
> 
> You need to say what each entry is:
> 
> items:
>   - description: ...
>   - description: ...

Surely there must be descriotions here.

> > +
> > +  interrupts:
> > +    maxItems: 1
> > +
> > +  "#dma-cells":
> > +    const: 2
> > +    description: |
> > +      DMA request from clients consists of 2 cells:
> > +        1. Channel index
> > +        2. Transfer request factor number, If no transfer factor, use 0.
> > +           The number is SoC-specific, and this should be specified with
> > +           relation to the device to use the DMA controller.
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +  - interrupts
> > +  - "#dma-cells"
> 
> Add:
> 
> additionalProperties: false

I'll add it.

> > +
> > +examples:
> > +  - |
> > +    xdmac: dma-controller@5fc10000 {
> > +        compatible = "socionext,uniphier-xdmac";
> > +        reg = <0x5fc10000 0x1000>, <0x5fc20000 0x800>;
> > +        interrupts = <0 188 4>;
> > +        #dma-cells = <2>;
> > +        dma-channels = <16>;
> 
> Not documented. You need at least 'dma-channels: true' to indicate 
> you're using this. But you should be able to have some constraints such 
> as 'maximum: 16'.

I forgot to document 'dma-channels'. I'll add it.

Thank you,

---
Best Regards,
Kunihiko Hayashi

Patch
diff mbox series

diff --git a/Documentation/devicetree/bindings/dma/socionext,uniphier-xdmac.yaml b/Documentation/devicetree/bindings/dma/socionext,uniphier-xdmac.yaml
new file mode 100644
index 00000000..32abf18
--- /dev/null
+++ b/Documentation/devicetree/bindings/dma/socionext,uniphier-xdmac.yaml
@@ -0,0 +1,57 @@ 
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/dma/socionext,uniphier-xdmac.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Socionext UniPhier external DMA controller
+
+description: |
+  This describes the devicetree bindings for an external DMA engine to perform
+  memory-to-memory or peripheral-to-memory data transfer capable of supporting
+  16 channels, implemented in Socionext UniPhier SoCs.
+
+maintainers:
+  - Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
+
+allOf:
+  - $ref: "dma-controller.yaml#"
+
+properties:
+  compatible:
+    items:
+      - const: socionext,uniphier-xdmac
+
+  reg:
+    minItems: 1
+    maxItems: 2
+
+  interrupts:
+    maxItems: 1
+
+  "#dma-cells":
+    const: 2
+    description: |
+      DMA request from clients consists of 2 cells:
+        1. Channel index
+        2. Transfer request factor number, If no transfer factor, use 0.
+           The number is SoC-specific, and this should be specified with
+           relation to the device to use the DMA controller.
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - "#dma-cells"
+
+examples:
+  - |
+    xdmac: dma-controller@5fc10000 {
+        compatible = "socionext,uniphier-xdmac";
+        reg = <0x5fc10000 0x1000>, <0x5fc20000 0x800>;
+        interrupts = <0 188 4>;
+        #dma-cells = <2>;
+        dma-channels = <16>;
+    };
+
+...