diff mbox series

[v4,2/3] dt-bindings: Add dma-channels for pdma device node

Message ID 5db314b798cd9cfcb5cb61bc56515220b7d50315.1642383007.git.zong.li@sifive.com (mailing list archive)
State New, archived
Headers show
Series Determine the number of DMA channels by 'dma-channels' property | expand

Commit Message

Zong Li Jan. 17, 2022, 1:35 a.m. UTC
Add dma-channels property, then we can determine how many channels there
by device tree, rather than statically defines it in PDMA driver

Signed-off-by: Zong Li <zong.li@sifive.com>
---
 .../devicetree/bindings/dma/sifive,fu540-c000-pdma.yaml    | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Palmer Dabbelt Jan. 20, 2022, 6:51 p.m. UTC | #1
On Sun, 16 Jan 2022 17:35:27 PST (-0800), zong.li@sifive.com wrote:
> Add dma-channels property, then we can determine how many channels there
> by device tree, rather than statically defines it in PDMA driver

Maybe "statically defining it" is better here?

>
> Signed-off-by: Zong Li <zong.li@sifive.com>
> ---
>  .../devicetree/bindings/dma/sifive,fu540-c000-pdma.yaml    | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/dma/sifive,fu540-c000-pdma.yaml b/Documentation/devicetree/bindings/dma/sifive,fu540-c000-pdma.yaml
> index d32a71b975fe..3dbb8caefc17 100644
> --- a/Documentation/devicetree/bindings/dma/sifive,fu540-c000-pdma.yaml
> +++ b/Documentation/devicetree/bindings/dma/sifive,fu540-c000-pdma.yaml
> @@ -34,6 +34,12 @@ properties:
>      minItems: 1
>      maxItems: 8
>
> +  dma-channels:
> +    description: For backwards-compatible, the default value is 4

Maybe "backwards-compatibility" is better here?

> +    minimum: 1
> +    maximum: 4
> +    default: 4
> +
>    '#dma-cells':
>      const: 1
>
> @@ -50,6 +56,7 @@ examples:
>      dma@3000000 {
>        compatible = "sifive,fu540-c000-pdma";

IMO we should have a "sifive,pdma-1.0.0" (or whatever the versioning 
scheme ended up being) here, in addition to the SOC-specific DT entry.  
It's kind of odd to start extending the SOC-specific DT entry, as the 
whole idea there is to let us have an out in case we find future 
compatibility issues.

>        reg = <0x3000000 0x8000>;
> +      dma-channels = <4>;
>        interrupts = <23 24 25 26 27 28 29 30>;
>        #dma-cells = <1>;
>      };
Zong Li Jan. 21, 2022, 1:57 a.m. UTC | #2
On Fri, Jan 21, 2022 at 2:51 AM Palmer Dabbelt <palmer@dabbelt.com> wrote:
>
> On Sun, 16 Jan 2022 17:35:27 PST (-0800), zong.li@sifive.com wrote:
> > Add dma-channels property, then we can determine how many channels there
> > by device tree, rather than statically defines it in PDMA driver
>
> Maybe "statically defining it" is better here?
>

Thanks for the correction, I would modify it in the next version.

> >
> > Signed-off-by: Zong Li <zong.li@sifive.com>
> > ---
> >  .../devicetree/bindings/dma/sifive,fu540-c000-pdma.yaml    | 7 +++++++
> >  1 file changed, 7 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/dma/sifive,fu540-c000-pdma.yaml b/Documentation/devicetree/bindings/dma/sifive,fu540-c000-pdma.yaml
> > index d32a71b975fe..3dbb8caefc17 100644
> > --- a/Documentation/devicetree/bindings/dma/sifive,fu540-c000-pdma.yaml
> > +++ b/Documentation/devicetree/bindings/dma/sifive,fu540-c000-pdma.yaml
> > @@ -34,6 +34,12 @@ properties:
> >      minItems: 1
> >      maxItems: 8
> >
> > +  dma-channels:
> > +    description: For backwards-compatible, the default value is 4
>
> Maybe "backwards-compatibility" is better here?

Thanks, let me change it in the next version together.

>
> > +    minimum: 1
> > +    maximum: 4
> > +    default: 4
> > +
> >    '#dma-cells':
> >      const: 1
> >
> > @@ -50,6 +56,7 @@ examples:
> >      dma@3000000 {
> >        compatible = "sifive,fu540-c000-pdma";
>
> IMO we should have a "sifive,pdma-1.0.0" (or whatever the versioning
> scheme ended up being) here, in addition to the SOC-specific DT entry.
> It's kind of odd to start extending the SOC-specific DT entry, as the
> whole idea there is to let us have an out in case we find future
> compatibility issues.

yes, I notice that we usually have a entry with the version in other
device nodes, such as "sifive,xxx0", I guess we should have a
"sifive,pdma0" there, thanks for your advice, let me add it and use it
in match table of pdma driver in the next version.

>
> >        reg = <0x3000000 0x8000>;
> > +      dma-channels = <4>;
> >        interrupts = <23 24 25 26 27 28 29 30>;
> >        #dma-cells = <1>;
> >      };
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/dma/sifive,fu540-c000-pdma.yaml b/Documentation/devicetree/bindings/dma/sifive,fu540-c000-pdma.yaml
index d32a71b975fe..3dbb8caefc17 100644
--- a/Documentation/devicetree/bindings/dma/sifive,fu540-c000-pdma.yaml
+++ b/Documentation/devicetree/bindings/dma/sifive,fu540-c000-pdma.yaml
@@ -34,6 +34,12 @@  properties:
     minItems: 1
     maxItems: 8
 
+  dma-channels:
+    description: For backwards-compatible, the default value is 4
+    minimum: 1
+    maximum: 4
+    default: 4
+
   '#dma-cells':
     const: 1
 
@@ -50,6 +56,7 @@  examples:
     dma@3000000 {
       compatible = "sifive,fu540-c000-pdma";
       reg = <0x3000000 0x8000>;
+      dma-channels = <4>;
       interrupts = <23 24 25 26 27 28 29 30>;
       #dma-cells = <1>;
     };