diff mbox series

[1/5] dt-bindings: mtd: gpmi-nand: Add 'fsl,imx8qxp-gpmi-nand' compatible string

Message ID 20240517-gpmi_nand-v1-1-73bb8d2cd441@nxp.com
State New
Headers show
Series mtd: nand: gpmi-nand: add imx8qxp gpmi nand support | expand

Commit Message

Frank Li May 17, 2024, 6:09 p.m. UTC
Add 'fsl,imx8qxp-gpmi-nand' compatible string and clock-names restriction.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
 .../devicetree/bindings/mtd/gpmi-nand.yaml         | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

Comments

Miquel Raynal May 17, 2024, 6:36 p.m. UTC | #1
Hi Frank,

Frank.Li@nxp.com wrote on Fri, 17 May 2024 14:09:48 -0400:

> Add 'fsl,imx8qxp-gpmi-nand' compatible string and clock-names restriction.
> 
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---
>  .../devicetree/bindings/mtd/gpmi-nand.yaml         | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/mtd/gpmi-nand.yaml b/Documentation/devicetree/bindings/mtd/gpmi-nand.yaml
> index 021c0da0b072f..f9eb1868ca1f4 100644
> --- a/Documentation/devicetree/bindings/mtd/gpmi-nand.yaml
> +++ b/Documentation/devicetree/bindings/mtd/gpmi-nand.yaml
> @@ -24,6 +24,7 @@ properties:
>            - fsl,imx6q-gpmi-nand
>            - fsl,imx6sx-gpmi-nand
>            - fsl,imx7d-gpmi-nand
> +          - fsl,imx8qxp-gpmi-nand
>        - items:
>            - enum:
>                - fsl,imx8mm-gpmi-nand
> @@ -151,6 +152,27 @@ allOf:
>              - const: gpmi_io
>              - const: gpmi_bch_apb
>  
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - fsl,imx8qxp-gpmi-nand
> +    then:
> +      properties:
> +        clocks:
> +          items:
> +            - description: SoC gpmi io clock
> +            - description: SoC gpmi apb clock

I believe these two clocks are mandatory?

> +            - description: SoC gpmi bch clock
> +            - description: SoC gpmi bch apb clock
> +        clock-names:
> +          items:
> +            - const: gpmi_io
> +            - const: gpmi_apb
> +            - const: gpmi_bch
> +            - const: gpmi_bch_apb
> +
>  examples:
>    - |
>      nand-controller@8000c000 {
> 


Thanks,
Miquèl
Frank Li May 17, 2024, 7:15 p.m. UTC | #2
On Fri, May 17, 2024 at 08:36:21PM +0200, Miquel Raynal wrote:
> Hi Frank,
> 
> Frank.Li@nxp.com wrote on Fri, 17 May 2024 14:09:48 -0400:
> 
> > Add 'fsl,imx8qxp-gpmi-nand' compatible string and clock-names restriction.
> > 
> > Signed-off-by: Frank Li <Frank.Li@nxp.com>
> > ---
> >  .../devicetree/bindings/mtd/gpmi-nand.yaml         | 22 ++++++++++++++++++++++
> >  1 file changed, 22 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/mtd/gpmi-nand.yaml b/Documentation/devicetree/bindings/mtd/gpmi-nand.yaml
> > index 021c0da0b072f..f9eb1868ca1f4 100644
> > --- a/Documentation/devicetree/bindings/mtd/gpmi-nand.yaml
> > +++ b/Documentation/devicetree/bindings/mtd/gpmi-nand.yaml
> > @@ -24,6 +24,7 @@ properties:
> >            - fsl,imx6q-gpmi-nand
> >            - fsl,imx6sx-gpmi-nand
> >            - fsl,imx7d-gpmi-nand
> > +          - fsl,imx8qxp-gpmi-nand
> >        - items:
> >            - enum:
> >                - fsl,imx8mm-gpmi-nand
> > @@ -151,6 +152,27 @@ allOf:
> >              - const: gpmi_io
> >              - const: gpmi_bch_apb
> >  
> > +  - if:
> > +      properties:
> > +        compatible:
> > +          contains:
> > +            enum:
> > +              - fsl,imx8qxp-gpmi-nand
> > +    then:
> > +      properties:
> > +        clocks:
> > +          items:
> > +            - description: SoC gpmi io clock
> > +            - description: SoC gpmi apb clock
> 
> I believe these two clocks are mandatory?

minItems default is equal to items numbers, here is 4. So all 4 clock are
mandatory.

Anything wrong here?

Frank

> 
> > +            - description: SoC gpmi bch clock
> > +            - description: SoC gpmi bch apb clock
> > +        clock-names:
> > +          items:
> > +            - const: gpmi_io
> > +            - const: gpmi_apb
> > +            - const: gpmi_bch
> > +            - const: gpmi_bch_apb
> > +
> >  examples:
> >    - |
> >      nand-controller@8000c000 {
> > 
> 
> 
> Thanks,
> Miquèl
Miquel Raynal May 17, 2024, 7:50 p.m. UTC | #3
Hi Frank,

Frank.li@nxp.com wrote on Fri, 17 May 2024 15:15:42 -0400:

> On Fri, May 17, 2024 at 08:36:21PM +0200, Miquel Raynal wrote:
> > Hi Frank,
> > 
> > Frank.Li@nxp.com wrote on Fri, 17 May 2024 14:09:48 -0400:
> >   
> > > Add 'fsl,imx8qxp-gpmi-nand' compatible string and clock-names restriction.
> > > 
> > > Signed-off-by: Frank Li <Frank.Li@nxp.com>
> > > ---
> > >  .../devicetree/bindings/mtd/gpmi-nand.yaml         | 22 ++++++++++++++++++++++
> > >  1 file changed, 22 insertions(+)
> > > 
> > > diff --git a/Documentation/devicetree/bindings/mtd/gpmi-nand.yaml b/Documentation/devicetree/bindings/mtd/gpmi-nand.yaml
> > > index 021c0da0b072f..f9eb1868ca1f4 100644
> > > --- a/Documentation/devicetree/bindings/mtd/gpmi-nand.yaml
> > > +++ b/Documentation/devicetree/bindings/mtd/gpmi-nand.yaml
> > > @@ -24,6 +24,7 @@ properties:
> > >            - fsl,imx6q-gpmi-nand
> > >            - fsl,imx6sx-gpmi-nand
> > >            - fsl,imx7d-gpmi-nand
> > > +          - fsl,imx8qxp-gpmi-nand
> > >        - items:
> > >            - enum:
> > >                - fsl,imx8mm-gpmi-nand
> > > @@ -151,6 +152,27 @@ allOf:
> > >              - const: gpmi_io
> > >              - const: gpmi_bch_apb
> > >  
> > > +  - if:
> > > +      properties:
> > > +        compatible:
> > > +          contains:
> > > +            enum:
> > > +              - fsl,imx8qxp-gpmi-nand
> > > +    then:
> > > +      properties:
> > > +        clocks:
> > > +          items:
> > > +            - description: SoC gpmi io clock
> > > +            - description: SoC gpmi apb clock  
> > 
> > I believe these two clocks are mandatory?  
> 
> minItems default is equal to items numbers, here is 4. So all 4 clock are
> mandatory.
> 
> Anything wrong here?

I'd say that the two "bch" clocks are only used if you decide to
configure the on-host hardware ECC engine and thus are not needed with
software corrections, but I'm fine keeping the fourth described in all
cases if that's simpler.

Also,here the diff just shows that "if we provide a clocks property
with this compatible, then we need to provide 4 members", I believe the
"required" property is already filled somewhere with the
clocks/clock-names properties?

Thanks,
Miquèl
Frank Li May 17, 2024, 9:09 p.m. UTC | #4
On Fri, May 17, 2024 at 09:50:55PM +0200, Miquel Raynal wrote:
> Hi Frank,
> 
> Frank.li@nxp.com wrote on Fri, 17 May 2024 15:15:42 -0400:
> 
> > On Fri, May 17, 2024 at 08:36:21PM +0200, Miquel Raynal wrote:
> > > Hi Frank,
> > > 
> > > Frank.Li@nxp.com wrote on Fri, 17 May 2024 14:09:48 -0400:
> > >   
> > > > Add 'fsl,imx8qxp-gpmi-nand' compatible string and clock-names restriction.
> > > > 
> > > > Signed-off-by: Frank Li <Frank.Li@nxp.com>
> > > > ---
> > > >  .../devicetree/bindings/mtd/gpmi-nand.yaml         | 22 ++++++++++++++++++++++
> > > >  1 file changed, 22 insertions(+)
> > > > 
> > > > diff --git a/Documentation/devicetree/bindings/mtd/gpmi-nand.yaml b/Documentation/devicetree/bindings/mtd/gpmi-nand.yaml
> > > > index 021c0da0b072f..f9eb1868ca1f4 100644
> > > > --- a/Documentation/devicetree/bindings/mtd/gpmi-nand.yaml
> > > > +++ b/Documentation/devicetree/bindings/mtd/gpmi-nand.yaml
> > > > @@ -24,6 +24,7 @@ properties:
> > > >            - fsl,imx6q-gpmi-nand
> > > >            - fsl,imx6sx-gpmi-nand
> > > >            - fsl,imx7d-gpmi-nand
> > > > +          - fsl,imx8qxp-gpmi-nand
> > > >        - items:
> > > >            - enum:
> > > >                - fsl,imx8mm-gpmi-nand
> > > > @@ -151,6 +152,27 @@ allOf:
> > > >              - const: gpmi_io
> > > >              - const: gpmi_bch_apb
> > > >  
> > > > +  - if:
> > > > +      properties:
> > > > +        compatible:
> > > > +          contains:
> > > > +            enum:
> > > > +              - fsl,imx8qxp-gpmi-nand
> > > > +    then:
> > > > +      properties:
> > > > +        clocks:
> > > > +          items:
> > > > +            - description: SoC gpmi io clock
> > > > +            - description: SoC gpmi apb clock  
> > > 
> > > I believe these two clocks are mandatory?  
> > 
> > minItems default is equal to items numbers, here is 4. So all 4 clock are
> > mandatory.
> > 
> > Anything wrong here?
> 
> I'd say that the two "bch" clocks are only used if you decide to
> configure the on-host hardware ECC engine and thus are not needed with
> software corrections, but I'm fine keeping the fourth described in all
> cases if that's simpler.
> 
> Also,here the diff just shows that "if we provide a clocks property
> with this compatible, then we need to provide 4 members", I believe the
> "required" property is already filled somewhere with the
> clocks/clock-names properties?

yes, before allOf

required:
...                                                                 
  - clocks                                                                 
  - clock-names                                                            
...

> 
> Thanks,
> Miquèl
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/mtd/gpmi-nand.yaml b/Documentation/devicetree/bindings/mtd/gpmi-nand.yaml
index 021c0da0b072f..f9eb1868ca1f4 100644
--- a/Documentation/devicetree/bindings/mtd/gpmi-nand.yaml
+++ b/Documentation/devicetree/bindings/mtd/gpmi-nand.yaml
@@ -24,6 +24,7 @@  properties:
           - fsl,imx6q-gpmi-nand
           - fsl,imx6sx-gpmi-nand
           - fsl,imx7d-gpmi-nand
+          - fsl,imx8qxp-gpmi-nand
       - items:
           - enum:
               - fsl,imx8mm-gpmi-nand
@@ -151,6 +152,27 @@  allOf:
             - const: gpmi_io
             - const: gpmi_bch_apb
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - fsl,imx8qxp-gpmi-nand
+    then:
+      properties:
+        clocks:
+          items:
+            - description: SoC gpmi io clock
+            - description: SoC gpmi apb clock
+            - description: SoC gpmi bch clock
+            - description: SoC gpmi bch apb clock
+        clock-names:
+          items:
+            - const: gpmi_io
+            - const: gpmi_apb
+            - const: gpmi_bch
+            - const: gpmi_bch_apb
+
 examples:
   - |
     nand-controller@8000c000 {