diff mbox series

[v7,1/4] dt-bindings: soc: imx8m: add DT Binding doc for soc unique ID

Message ID 20201215083551.6067-1-alice.guo@oss.nxp.com (mailing list archive)
State New, archived
Headers show
Series [v7,1/4] dt-bindings: soc: imx8m: add DT Binding doc for soc unique ID | expand

Commit Message

Alice Guo (OSS) Dec. 15, 2020, 8:35 a.m. UTC
From: Alice Guo <alice.guo@nxp.com>

Add DT Binding doc for the Unique ID of i.MX 8M series.

Signed-off-by: Alice Guo <alice.guo@nxp.com>
---

Changes for v7:
 - change to a separate schema file
Changes for v6:
 - none
Changes for v5:
 - correct the error of using allOf
Changes for v4:
 - use allOf to limit new version DTS files for i.MX8M to include
   "fsl,imx8m*-soc", nvmem-cells and nvmem-cells-names
Changes for v3:
 - put it into Documentation/devicetree/bindings/arm/fsl.yaml
 - modify the description of nvmem-cells
 - use "make ARCH=arm64 dtbs_check" to make sure it is right
Changes for v2:
 - remove the subject prefix "LF-2571-1"

 .../bindings/soc/imx/imx8m-soc.yaml           | 54 +++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/soc/imx/imx8m-soc.yaml

--
2.17.1

Comments

Krzysztof Kozlowski Dec. 15, 2020, 9:01 a.m. UTC | #1
On Tue, Dec 15, 2020 at 04:35:48PM +0800, Alice Guo (OSS) wrote:
> From: Alice Guo <alice.guo@nxp.com>
> 
> Add DT Binding doc for the Unique ID of i.MX 8M series.
> 
> Signed-off-by: Alice Guo <alice.guo@nxp.com>
> ---
> 
> Changes for v7:
>  - change to a separate schema file
> Changes for v6:
>  - none
> Changes for v5:
>  - correct the error of using allOf
> Changes for v4:
>  - use allOf to limit new version DTS files for i.MX8M to include
>    "fsl,imx8m*-soc", nvmem-cells and nvmem-cells-names
> Changes for v3:
>  - put it into Documentation/devicetree/bindings/arm/fsl.yaml
>  - modify the description of nvmem-cells
>  - use "make ARCH=arm64 dtbs_check" to make sure it is right
> Changes for v2:
>  - remove the subject prefix "LF-2571-1"
> 
>  .../bindings/soc/imx/imx8m-soc.yaml           | 54 +++++++++++++++++++
>  1 file changed, 54 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/soc/imx/imx8m-soc.yaml
> 
> diff --git a/Documentation/devicetree/bindings/soc/imx/imx8m-soc.yaml b/Documentation/devicetree/bindings/soc/imx/imx8m-soc.yaml
> new file mode 100644
> index 000000000000..a2f7dc0c9b35
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/soc/imx/imx8m-soc.yaml
> @@ -0,0 +1,54 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/soc/imx/imx8m-soc.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: NXP i.MX8M Series SoC
> +
> +maintainers:
> +  - Alice Guo <alice.guo@nxp.com>
> +
> +description: |
> +  NXP i.MX8M series SoCs contain fuse entries from which SoC Unique ID can be
> +  obtained.
> +
> +select:

Why do you need a select for this (not as usual way - part of
"properties:")?

Best regards,
Krzysztof


> +  properties:
> +    compatible:
> +      contains:
> +        enum:
> +          - fsl,imx8mm
> +          - fsl,imx8mn
> +          - fsl,imx8mp
> +          - fsl,imx8mq
> +  required:
> +    - compatible
> +
> +properties:
> +  soc:
> +    type: object
> +    properties:
Krzysztof Kozlowski Dec. 15, 2020, 9:11 a.m. UTC | #2
On Tue, Dec 15, 2020 at 04:35:48PM +0800, Alice Guo (OSS) wrote:
> From: Alice Guo <alice.guo@nxp.com>
> 
> Add DT Binding doc for the Unique ID of i.MX 8M series.
> 
> Signed-off-by: Alice Guo <alice.guo@nxp.com>
> ---
> 
> Changes for v7:
>  - change to a separate schema file
> Changes for v6:
>  - none
> Changes for v5:
>  - correct the error of using allOf
> Changes for v4:
>  - use allOf to limit new version DTS files for i.MX8M to include
>    "fsl,imx8m*-soc", nvmem-cells and nvmem-cells-names
> Changes for v3:
>  - put it into Documentation/devicetree/bindings/arm/fsl.yaml
>  - modify the description of nvmem-cells
>  - use "make ARCH=arm64 dtbs_check" to make sure it is right
> Changes for v2:
>  - remove the subject prefix "LF-2571-1"
> 
>  .../bindings/soc/imx/imx8m-soc.yaml           | 54 +++++++++++++++++++
>  1 file changed, 54 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/soc/imx/imx8m-soc.yaml
> 
> diff --git a/Documentation/devicetree/bindings/soc/imx/imx8m-soc.yaml b/Documentation/devicetree/bindings/soc/imx/imx8m-soc.yaml
> new file mode 100644
> index 000000000000..a2f7dc0c9b35
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/soc/imx/imx8m-soc.yaml
> @@ -0,0 +1,54 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/soc/imx/imx8m-soc.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: NXP i.MX8M Series SoC
> +
> +maintainers:
> +  - Alice Guo <alice.guo@nxp.com>
> +
> +description: |
> +  NXP i.MX8M series SoCs contain fuse entries from which SoC Unique ID can be
> +  obtained.
> +
> +select:

Mhm, there are other compatibles here so indeed, select is needed.

> +  properties:
> +    compatible:
> +      contains:
> +        enum:
> +          - fsl,imx8mm
> +          - fsl,imx8mn
> +          - fsl,imx8mp
> +          - fsl,imx8mq
> +  required:
> +    - compatible

This does not work - does not match anything. It seems you missed proper
"required" for the matched node.

Provide also an example.

Best regards,
Krzysztof


> +
> +properties:
> +  soc:
> +    type: object
> +    properties:
> +      compatible:
> +        items:
> +          - enum:
> +              - fsl,imx8mm-soc
> +              - fsl,imx8mn-soc
> +              - fsl,imx8mp-soc
> +              - fsl,imx8mq-soc
> +          - const: simple-bus
> +
> +      nvmem-cells:
> +        maxItems: 1
> +        description: Phandle to the SOC Unique ID provided by a nvmem node
> +
> +      nvmem-cells-names:
> +        const: soc_unique_id
> +
> +    required:
> +      - compatible
> +      - nvmem-cells
> +      - nvmem-cell-names
> +
> +additionalProperties: true
> +...
> --
> 2.17.1
>
Rob Herring (Arm) Dec. 15, 2020, 8:32 p.m. UTC | #3
On Tue, Dec 15, 2020 at 04:35:48PM +0800, Alice Guo (OSS) wrote:
> From: Alice Guo <alice.guo@nxp.com>
> 
> Add DT Binding doc for the Unique ID of i.MX 8M series.
> 
> Signed-off-by: Alice Guo <alice.guo@nxp.com>
> ---
> 
> Changes for v7:
>  - change to a separate schema file
> Changes for v6:
>  - none
> Changes for v5:
>  - correct the error of using allOf
> Changes for v4:
>  - use allOf to limit new version DTS files for i.MX8M to include
>    "fsl,imx8m*-soc", nvmem-cells and nvmem-cells-names
> Changes for v3:
>  - put it into Documentation/devicetree/bindings/arm/fsl.yaml
>  - modify the description of nvmem-cells
>  - use "make ARCH=arm64 dtbs_check" to make sure it is right
> Changes for v2:
>  - remove the subject prefix "LF-2571-1"
> 
>  .../bindings/soc/imx/imx8m-soc.yaml           | 54 +++++++++++++++++++
>  1 file changed, 54 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/soc/imx/imx8m-soc.yaml
> 
> diff --git a/Documentation/devicetree/bindings/soc/imx/imx8m-soc.yaml b/Documentation/devicetree/bindings/soc/imx/imx8m-soc.yaml
> new file mode 100644
> index 000000000000..a2f7dc0c9b35
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/soc/imx/imx8m-soc.yaml
> @@ -0,0 +1,54 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/soc/imx/imx8m-soc.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: NXP i.MX8M Series SoC
> +
> +maintainers:
> +  - Alice Guo <alice.guo@nxp.com>
> +
> +description: |
> +  NXP i.MX8M series SoCs contain fuse entries from which SoC Unique ID can be
> +  obtained.
> +
> +select:
> +  properties:
> +    compatible:
> +      contains:
> +        enum:
> +          - fsl,imx8mm
> +          - fsl,imx8mn
> +          - fsl,imx8mp
> +          - fsl,imx8mq
> +  required:
> +    - compatible
> +
> +properties:
> +  soc:
> +    type: object
> +    properties:
> +      compatible:
> +        items:
> +          - enum:
> +              - fsl,imx8mm-soc
> +              - fsl,imx8mn-soc
> +              - fsl,imx8mp-soc
> +              - fsl,imx8mq-soc
> +          - const: simple-bus
> +
> +      nvmem-cells:
> +        maxItems: 1
> +        description: Phandle to the SOC Unique ID provided by a nvmem node
> +
> +      nvmem-cells-names:
> +        const: soc_unique_id
> +
> +    required:
> +      - compatible
> +      - nvmem-cells
> +      - nvmem-cell-names

Anything else should be a node, so:

       additionalProperties:
         type: object

> +
> +additionalProperties: true
> +...
> --
> 2.17.1
>
Alice Guo (OSS) Dec. 16, 2020, 9:55 a.m. UTC | #4
> -----Original Message-----
> From: Krzysztof Kozlowski <krzk@kernel.org>
> Sent: 2020年12月15日 17:11
> To: Alice Guo (OSS) <alice.guo@oss.nxp.com>
> Cc: robh+dt@kernel.org; shawnguo@kernel.org; s.hauer@pengutronix.de;
> kernel@pengutronix.de; festevam@gmail.com; devicetree@vger.kernel.org;
> linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org; dl-linux-imx
> <linux-imx@nxp.com>
> Subject: Re: [PATCH v7 1/4] dt-bindings: soc: imx8m: add DT Binding doc for soc
> unique ID
> 
> On Tue, Dec 15, 2020 at 04:35:48PM +0800, Alice Guo (OSS) wrote:
> > From: Alice Guo <alice.guo@nxp.com>
> >
> > Add DT Binding doc for the Unique ID of i.MX 8M series.
> >
> > Signed-off-by: Alice Guo <alice.guo@nxp.com>
> > ---
> >
> > Changes for v7:
> >  - change to a separate schema file
> > Changes for v6:
> >  - none
> > Changes for v5:
> >  - correct the error of using allOf
> > Changes for v4:
> >  - use allOf to limit new version DTS files for i.MX8M to include
> >    "fsl,imx8m*-soc", nvmem-cells and nvmem-cells-names Changes for v3:
> >  - put it into Documentation/devicetree/bindings/arm/fsl.yaml
> >  - modify the description of nvmem-cells
> >  - use "make ARCH=arm64 dtbs_check" to make sure it is right Changes
> > for v2:
> >  - remove the subject prefix "LF-2571-1"
> >
> >  .../bindings/soc/imx/imx8m-soc.yaml           | 54
> +++++++++++++++++++
> >  1 file changed, 54 insertions(+)
> >  create mode 100644
> > Documentation/devicetree/bindings/soc/imx/imx8m-soc.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/soc/imx/imx8m-soc.yaml
> > b/Documentation/devicetree/bindings/soc/imx/imx8m-soc.yaml
> > new file mode 100644
> > index 000000000000..a2f7dc0c9b35
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/soc/imx/imx8m-soc.yaml
> > @@ -0,0 +1,54 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) %YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/soc/imx/imx8m-soc.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: NXP i.MX8M Series SoC
> > +
> > +maintainers:
> > +  - Alice Guo <alice.guo@nxp.com>
> > +
> > +description: |
> > +  NXP i.MX8M series SoCs contain fuse entries from which SoC Unique
> > +ID can be
> > +  obtained.
> > +
> > +select:
> 
> Mhm, there are other compatibles here so indeed, select is needed.
> 
> > +  properties:
> > +    compatible:
> > +      contains:
> > +        enum:
> > +          - fsl,imx8mm
> > +          - fsl,imx8mn
> > +          - fsl,imx8mp
> > +          - fsl,imx8mq
> > +  required:
> > +    - compatible
> 
> This does not work - does not match anything. It seems you missed proper
> "required" for the matched node.
> 
> Provide also an example.
> 
> Best regards,
> Krzysztof
> 

Hi, Krzysztof
Thank you for your advice. My opinion is different from yours.

I did the fowllowing test:
--- a/Documentation/devicetree/bindings/soc/imx/imx8m-soc.yaml
+++ b/Documentation/devicetree/bindings/soc/imx/imx8m-soc.yaml
@@ -22,6 +22,7 @@ select:
           - fsl,imx8mn
           - fsl,imx8mp
           - fsl,imx8mq
+          - fsl,lx2160a
   required:
     - compatible

➜  linux-next git:(master) ✗ make ARCH=arm64 dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/soc/imx/imx8m-soc.yaml
...
/home/nxf55104/virtualization/upstream/linux-next/arch/arm64/boot/dts/freescale/fsl-lx2160a-clearfog-cx.dt.yaml: /: soc:compatible:0: 'simple-bus' is not one of ['fsl,imx8mm-soc', 'fsl,imx8mn-soc', 'fsl,imx8mp-soc', 'fsl,imx8mq-soc']
        From schema: /home/nxf55104/virtualization/upstream/linux-next/Documentation/devicetree/bindings/soc/imx/imx8m-soc.yaml
...

So, I think it works and can match stuff. I do not understand what proper " required" I missed. Please give me some tips. Thank you.

Best regards,
Alice

> 
> > +
> > +properties:
> > +  soc:
> > +    type: object
> > +    properties:
> > +      compatible:
> > +        items:
> > +          - enum:
> > +              - fsl,imx8mm-soc
> > +              - fsl,imx8mn-soc
> > +              - fsl,imx8mp-soc
> > +              - fsl,imx8mq-soc
> > +          - const: simple-bus
> > +
> > +      nvmem-cells:
> > +        maxItems: 1
> > +        description: Phandle to the SOC Unique ID provided by a nvmem
> > + node
> > +
> > +      nvmem-cells-names:
> > +        const: soc_unique_id
> > +
> > +    required:
> > +      - compatible
> > +      - nvmem-cells
> > +      - nvmem-cell-names
> > +
> > +additionalProperties: true
> > +...
> > --
> > 2.17.1
> >
Krzysztof Kozlowski Dec. 16, 2020, 12:47 p.m. UTC | #5
On Wed, Dec 16, 2020 at 09:55:34AM +0000, Alice Guo (OSS) wrote:
> 
> 
> > -----Original Message-----
> > From: Krzysztof Kozlowski <krzk@kernel.org>
> > Sent: 2020年12月15日 17:11
> > To: Alice Guo (OSS) <alice.guo@oss.nxp.com>
> > Cc: robh+dt@kernel.org; shawnguo@kernel.org; s.hauer@pengutronix.de;
> > kernel@pengutronix.de; festevam@gmail.com; devicetree@vger.kernel.org;
> > linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org; dl-linux-imx
> > <linux-imx@nxp.com>
> > Subject: Re: [PATCH v7 1/4] dt-bindings: soc: imx8m: add DT Binding doc for soc
> > unique ID
> > 
> > On Tue, Dec 15, 2020 at 04:35:48PM +0800, Alice Guo (OSS) wrote:
> > > From: Alice Guo <alice.guo@nxp.com>
> > >
> > > Add DT Binding doc for the Unique ID of i.MX 8M series.
> > >
> > > Signed-off-by: Alice Guo <alice.guo@nxp.com>
> > > ---
> > >
> > > Changes for v7:
> > >  - change to a separate schema file
> > > Changes for v6:
> > >  - none
> > > Changes for v5:
> > >  - correct the error of using allOf
> > > Changes for v4:
> > >  - use allOf to limit new version DTS files for i.MX8M to include
> > >    "fsl,imx8m*-soc", nvmem-cells and nvmem-cells-names Changes for v3:
> > >  - put it into Documentation/devicetree/bindings/arm/fsl.yaml
> > >  - modify the description of nvmem-cells
> > >  - use "make ARCH=arm64 dtbs_check" to make sure it is right Changes
> > > for v2:
> > >  - remove the subject prefix "LF-2571-1"
> > >
> > >  .../bindings/soc/imx/imx8m-soc.yaml           | 54
> > +++++++++++++++++++
> > >  1 file changed, 54 insertions(+)
> > >  create mode 100644
> > > Documentation/devicetree/bindings/soc/imx/imx8m-soc.yaml
> > >
> > > diff --git a/Documentation/devicetree/bindings/soc/imx/imx8m-soc.yaml
> > > b/Documentation/devicetree/bindings/soc/imx/imx8m-soc.yaml
> > > new file mode 100644
> > > index 000000000000..a2f7dc0c9b35
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/soc/imx/imx8m-soc.yaml
> > > @@ -0,0 +1,54 @@
> > > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) %YAML 1.2
> > > +---
> > > +$id: http://devicetree.org/schemas/soc/imx/imx8m-soc.yaml#
> > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > +
> > > +title: NXP i.MX8M Series SoC
> > > +
> > > +maintainers:
> > > +  - Alice Guo <alice.guo@nxp.com>
> > > +
> > > +description: |
> > > +  NXP i.MX8M series SoCs contain fuse entries from which SoC Unique
> > > +ID can be
> > > +  obtained.
> > > +
> > > +select:
> > 
> > Mhm, there are other compatibles here so indeed, select is needed.
> > 
> > > +  properties:
> > > +    compatible:
> > > +      contains:
> > > +        enum:
> > > +          - fsl,imx8mm
> > > +          - fsl,imx8mn
> > > +          - fsl,imx8mp
> > > +          - fsl,imx8mq
> > > +  required:
> > > +    - compatible
> > 
> > This does not work - does not match anything. It seems you missed proper
> > "required" for the matched node.
> > 
> > Provide also an example.
> > 
> > Best regards,
> > Krzysztof
> > 
> 
> Hi, Krzysztof
> Thank you for your advice. My opinion is different from yours.
> 
> I did the fowllowing test:
> --- a/Documentation/devicetree/bindings/soc/imx/imx8m-soc.yaml
> +++ b/Documentation/devicetree/bindings/soc/imx/imx8m-soc.yaml
> @@ -22,6 +22,7 @@ select:
>            - fsl,imx8mn
>            - fsl,imx8mp
>            - fsl,imx8mq
> +          - fsl,lx2160a
>    required:
>      - compatible
> 
> ➜  linux-next git:(master) ✗ make ARCH=arm64 dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/soc/imx/imx8m-soc.yaml
> ...
> /home/nxf55104/virtualization/upstream/linux-next/arch/arm64/boot/dts/freescale/fsl-lx2160a-clearfog-cx.dt.yaml: /: soc:compatible:0: 'simple-bus' is not one of ['fsl,imx8mm-soc', 'fsl,imx8mn-soc', 'fsl,imx8mp-soc', 'fsl,imx8mq-soc']
>         From schema: /home/nxf55104/virtualization/upstream/linux-next/Documentation/devicetree/bindings/soc/imx/imx8m-soc.yaml
> ...
> 
> So, I think it works and can match stuff. I do not understand what proper " required" I missed. Please give me some tips. Thank you.

I applied the bindings (only) and run dtbs_check - everything passed
fine but it shouldn't. The DTS do not have soc compatibles.

Best regards,
Krzysztof
Alice Guo (OSS) Dec. 18, 2020, 7:45 a.m. UTC | #6
> -----Original Message-----
> From: Rob Herring <robh@kernel.org>
> Sent: 2020年12月16日 4:33
> To: Alice Guo (OSS) <alice.guo@oss.nxp.com>
> Cc: shawnguo@kernel.org; s.hauer@pengutronix.de; kernel@pengutronix.de;
> festevam@gmail.com; krzk@kernel.org; devicetree@vger.kernel.org;
> linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org; dl-linux-imx
> <linux-imx@nxp.com>
> Subject: Re: [PATCH v7 1/4] dt-bindings: soc: imx8m: add DT Binding doc for soc
> unique ID
> 
> On Tue, Dec 15, 2020 at 04:35:48PM +0800, Alice Guo (OSS) wrote:
> > From: Alice Guo <alice.guo@nxp.com>
> >
> > Add DT Binding doc for the Unique ID of i.MX 8M series.
> >
> > Signed-off-by: Alice Guo <alice.guo@nxp.com>
> > ---
> >
> > Changes for v7:
> >  - change to a separate schema file
> > Changes for v6:
> >  - none
> > Changes for v5:
> >  - correct the error of using allOf
> > Changes for v4:
> >  - use allOf to limit new version DTS files for i.MX8M to include
> >    "fsl,imx8m*-soc", nvmem-cells and nvmem-cells-names Changes for v3:
> >  - put it into Documentation/devicetree/bindings/arm/fsl.yaml
> >  - modify the description of nvmem-cells
> >  - use "make ARCH=arm64 dtbs_check" to make sure it is right Changes
> > for v2:
> >  - remove the subject prefix "LF-2571-1"
> >
> >  .../bindings/soc/imx/imx8m-soc.yaml           | 54
> +++++++++++++++++++
> >  1 file changed, 54 insertions(+)
> >  create mode 100644
> > Documentation/devicetree/bindings/soc/imx/imx8m-soc.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/soc/imx/imx8m-soc.yaml
> > b/Documentation/devicetree/bindings/soc/imx/imx8m-soc.yaml
> > new file mode 100644
> > index 000000000000..a2f7dc0c9b35
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/soc/imx/imx8m-soc.yaml
> > @@ -0,0 +1,54 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) %YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/soc/imx/imx8m-soc.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: NXP i.MX8M Series SoC
> > +
> > +maintainers:
> > +  - Alice Guo <alice.guo@nxp.com>
> > +
> > +description: |
> > +  NXP i.MX8M series SoCs contain fuse entries from which SoC Unique
> > +ID can be
> > +  obtained.
> > +
> > +select:
> > +  properties:
> > +    compatible:
> > +      contains:
> > +        enum:
> > +          - fsl,imx8mm
> > +          - fsl,imx8mn
> > +          - fsl,imx8mp
> > +          - fsl,imx8mq
> > +  required:
> > +    - compatible
> > +
> > +properties:
> > +  soc:
> > +    type: object
> > +    properties:
> > +      compatible:
> > +        items:
> > +          - enum:
> > +              - fsl,imx8mm-soc
> > +              - fsl,imx8mn-soc
> > +              - fsl,imx8mp-soc
> > +              - fsl,imx8mq-soc
> > +          - const: simple-bus
> > +
> > +      nvmem-cells:
> > +        maxItems: 1
> > +        description: Phandle to the SOC Unique ID provided by a nvmem
> > + node
> > +
> > +      nvmem-cells-names:
> > +        const: soc_unique_id
> > +
> > +    required:
> > +      - compatible
> > +      - nvmem-cells
> > +      - nvmem-cell-names
> 
> Anything else should be a node, so:
> 
>        additionalProperties:
>          type: object

Hi, Rob
Thank you for your advice. When I add "additionalProperties: type: object",
use make ARCH=arm64 dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/soc/imx/imx8m-soc.yaml, and then:
linux-next/arch/arm64/boot/dts/freescale/imx8mm-beacon-kit.dt.yaml: /: #size-cells: [[2]] is not of type 'object'
        From schema: /home/nxf55104/virtualization/upstream/linux-next/Documentation/devicetree/bindings/soc/imx/imx8m-soc.yaml
...
so I think I should remain it unchanged in v8.
Alice

> > +
> > +additionalProperties: true
> > +...
> > --
> > 2.17.1
> >
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/soc/imx/imx8m-soc.yaml b/Documentation/devicetree/bindings/soc/imx/imx8m-soc.yaml
new file mode 100644
index 000000000000..a2f7dc0c9b35
--- /dev/null
+++ b/Documentation/devicetree/bindings/soc/imx/imx8m-soc.yaml
@@ -0,0 +1,54 @@ 
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/soc/imx/imx8m-soc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP i.MX8M Series SoC
+
+maintainers:
+  - Alice Guo <alice.guo@nxp.com>
+
+description: |
+  NXP i.MX8M series SoCs contain fuse entries from which SoC Unique ID can be
+  obtained.
+
+select:
+  properties:
+    compatible:
+      contains:
+        enum:
+          - fsl,imx8mm
+          - fsl,imx8mn
+          - fsl,imx8mp
+          - fsl,imx8mq
+  required:
+    - compatible
+
+properties:
+  soc:
+    type: object
+    properties:
+      compatible:
+        items:
+          - enum:
+              - fsl,imx8mm-soc
+              - fsl,imx8mn-soc
+              - fsl,imx8mp-soc
+              - fsl,imx8mq-soc
+          - const: simple-bus
+
+      nvmem-cells:
+        maxItems: 1
+        description: Phandle to the SOC Unique ID provided by a nvmem node
+
+      nvmem-cells-names:
+        const: soc_unique_id
+
+    required:
+      - compatible
+      - nvmem-cells
+      - nvmem-cell-names
+
+additionalProperties: true
+...