diff mbox series

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

Message ID 20201218083726.16427-1-alice.guo@oss.nxp.com
State Superseded, archived
Headers show
Series [v8,1/4] dt-bindings: soc: imx8m: add DT Binding doc for soc unique ID | expand

Checks

Context Check Description
robh/checkpatch success
robh/dt-meta-schema success
robh/dtbs-check fail build log

Commit Message

Alice Guo (OSS) Dec. 18, 2020, 8:37 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 v8:
 - match soc node with regular expression
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. 18, 2020, 8:52 a.m. UTC | #1
On Fri, Dec 18, 2020 at 04:37:23PM +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 v8:
>  - match soc node with regular expression
> 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..f0b0fc7b3ac6
> --- /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
> +
> +patternProperties:
> +  "^soc@[0-9a-f]+$":

Thanks, now it works.

> +    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

Don't leave comments unresolved (or resolve them against review without
discussion). Rob asked for changing it. The same as with all schemas -
you need to describe the missing properties.

Best regards,
Krzysztof
Alice Guo (OSS) Dec. 18, 2020, 9:05 a.m. UTC | #2
> -----Original Message-----
> From: Krzysztof Kozlowski <krzk@kernel.org>
> Sent: 2020年12月18日 16:52
> 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 v8 1/4] dt-bindings: soc: imx8m: add DT Binding doc for soc
> unique ID
> 
> On Fri, Dec 18, 2020 at 04:37:23PM +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 v8:
> >  - match soc node with regular expression 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..f0b0fc7b3ac6
> > --- /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
> > +
> > +patternProperties:
> > +  "^soc@[0-9a-f]+$":
> 
> Thanks, now it works.
> 
> > +    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
> 
> Don't leave comments unresolved (or resolve them against review without
> discussion). Rob asked for changing it. The same as with all schemas - you need
> to describe the missing properties.
> 
> Best regards,
> Krzysztof

Hi,
Thank you for your advice. I replied to him and let him know I remained here unchanged. There will be errors according to his suggestion.

Best regards,
Alice
Krzysztof Kozlowski Dec. 18, 2020, 9:36 a.m. UTC | #3
On Fri, Dec 18, 2020 at 09:05:00AM +0000, Alice Guo (OSS) wrote:
 > > +    required:
> > > +      - compatible
> > > +      - nvmem-cells
> > > +      - nvmem-cell-names
> > > +
> > > +additionalProperties: true
> > 
> > Don't leave comments unresolved (or resolve them against review without
> > discussion). Rob asked for changing it. The same as with all schemas - you need
> > to describe the missing properties.
> > 
> > Best regards,
> > Krzysztof
> 
> Hi,
> Thank you for your advice. I replied to him and let him know I remained here unchanged. There will be errors according to his suggestion.

Then the solution is to correct the errors - describe missing properties
- instead of ignoring the suggestion and making a resubmit right away.

Best regards,
Krzysztof
Alice Guo (OSS) Dec. 18, 2020, 10:14 a.m. UTC | #4
> -----Original Message-----
> From: Krzysztof Kozlowski <krzk@kernel.org>
> Sent: 2020年12月18日 17:37
> 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 v8 1/4] dt-bindings: soc: imx8m: add DT Binding doc for soc
> unique ID
> 
> On Fri, Dec 18, 2020 at 09:05:00AM +0000, Alice Guo (OSS) wrote:
>  > > +    required:
> > > > +      - compatible
> > > > +      - nvmem-cells
> > > > +      - nvmem-cell-names
> > > > +
> > > > +additionalProperties: true
> > >
> > > Don't leave comments unresolved (or resolve them against review
> > > without discussion). Rob asked for changing it. The same as with all
> > > schemas - you need to describe the missing properties.
> > >
> > > Best regards,
> > > Krzysztof
> >
> > Hi,
> > Thank you for your advice. I replied to him and let him know I remained here
> unchanged. There will be errors according to his suggestion.
> 
> Then the solution is to correct the errors - describe missing properties
> - instead of ignoring the suggestion and making a resubmit right away.
> 
> Best regards,
> Krzysztof

Hi,
I am sorry I do not DT Binding doc very well.

I checked the usage of patternProperties and additionalProperties in https://json-schema.org/understanding-json-schema/reference/object.html.
I noticed a sentence on the website: " If additionalProperties is a boolean and set to false, no additional properties will be allowed.", so I think that
if additionalProperties is a boolean and set to true, additional properties will be allowed. Letting here unchanged is my solution to correct the errors.
I am not sure, I asked Rob for advice on the v6 by email, but he didn't reply to me, so I made a resubmit.

Thank you for your comment again.

Best regards,
Alice
Rob Herring Dec. 18, 2020, 1:59 p.m. UTC | #5
On Fri, Dec 18, 2020 at 4:14 AM Alice Guo (OSS) <alice.guo@oss.nxp.com> wrote:
>
>
>
> > -----Original Message-----
> > From: Krzysztof Kozlowski <krzk@kernel.org>
> > Sent: 2020年12月18日 17:37
> > 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 v8 1/4] dt-bindings: soc: imx8m: add DT Binding doc for soc
> > unique ID
> >
> > On Fri, Dec 18, 2020 at 09:05:00AM +0000, Alice Guo (OSS) wrote:
> >  > > +    required:
> > > > > +      - compatible
> > > > > +      - nvmem-cells
> > > > > +      - nvmem-cell-names
> > > > > +
> > > > > +additionalProperties: true
> > > >
> > > > Don't leave comments unresolved (or resolve them against review
> > > > without discussion). Rob asked for changing it. The same as with all
> > > > schemas - you need to describe the missing properties.
> > > >
> > > > Best regards,
> > > > Krzysztof
> > >
> > > Hi,
> > > Thank you for your advice. I replied to him and let him know I remained here
> > unchanged. There will be errors according to his suggestion.
> >
> > Then the solution is to correct the errors - describe missing properties
> > - instead of ignoring the suggestion and making a resubmit right away.
> >
> > Best regards,
> > Krzysztof
>
> Hi,
> I am sorry I do not DT Binding doc very well.
>
> I checked the usage of patternProperties and additionalProperties in https://json-schema.org/understanding-json-schema/reference/object.html.
> I noticed a sentence on the website: " If additionalProperties is a boolean and set to false, no additional properties will be allowed.", so I think that
> if additionalProperties is a boolean and set to true, additional properties will be allowed. Letting here unchanged is my solution to correct the errors.
> I am not sure, I asked Rob for advice on the v6 by email, but he didn't reply to me, so I made a resubmit.

You waited an hour and I was sleeping! Waiting means waiting a week.

You need to add '#address-cells' and '#size-cells'.

Rob
Krzysztof Kozlowski Dec. 19, 2020, 12:16 p.m. UTC | #6
On Fri, Dec 18, 2020 at 04:37:25PM +0800, Alice Guo (OSS) wrote:
> From: Alice Guo <alice.guo@nxp.com>
> 
> In order to be able to use NVMEM APIs to read soc unique ID, add the
> nvmem data cell and name for nvmem-cells to the "soc" node, and add a
> nvmem node which provides soc unique ID to efuse@30350000.
> 
> Signed-off-by: Alice Guo <alice.guo@nxp.com>
> ---
> Changes for v8:
>  - none
> Changes for v7:
>  - add Reviewed-by

What happened with my reviewed-by?

Best regards,
Krzysztof
Krzysztof Kozlowski Dec. 19, 2020, 12:18 p.m. UTC | #7
On Fri, Dec 18, 2020 at 04:37:26PM +0800, Alice Guo (OSS) wrote:
> From: Alice Guo <alice.guo@nxp.com>
> 
> Directly reading ocotp register depends on that bootloader enables ocotp
> clk, which is not always effective, so change to use nvmem API. Using
> nvmem API requires to support driver defer probe and thus change
> soc-imx8m.c to use platform driver.
> 
> The other reason is that directly reading ocotp register causes kexec
> kernel hang because the 1st kernel running will disable unused clks
> after kernel boots up, and then ocotp clk will be disabled even if
> bootloader enables it. When kexec kernel, ocotp clk needs to be enabled
> before reading ocotp registers, and nvmem API with platform driver
> supported can accomplish this.
> 
> Signed-off-by: Alice Guo <alice.guo@nxp.com>
> ---
> Changes for v8:
>  - none
> Changes for v7:
>  - solve the problem "drivers/soc/imx/soc-imx8m.c:174:34: warning:
>    unused variable"

There was a reviewed-by part of changelog. The tag was in your commit.
I am now confused, as changes for v8 say "none"... but shall I trust it?

Best regards,
Krzysztof
Alice Guo (OSS) Dec. 21, 2020, 2:36 a.m. UTC | #8
> -----Original Message-----
> From: Krzysztof Kozlowski <krzk@kernel.org>
> Sent: 2020年12月19日 20:18
> 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 v8 4/4] soc: imx8m: change to use platform driver
> 
> On Fri, Dec 18, 2020 at 04:37:26PM +0800, Alice Guo (OSS) wrote:
> > From: Alice Guo <alice.guo@nxp.com>
> >
> > Directly reading ocotp register depends on that bootloader enables
> > ocotp clk, which is not always effective, so change to use nvmem API.
> > Using nvmem API requires to support driver defer probe and thus change
> > soc-imx8m.c to use platform driver.
> >
> > The other reason is that directly reading ocotp register causes kexec
> > kernel hang because the 1st kernel running will disable unused clks
> > after kernel boots up, and then ocotp clk will be disabled even if
> > bootloader enables it. When kexec kernel, ocotp clk needs to be
> > enabled before reading ocotp registers, and nvmem API with platform
> > driver supported can accomplish this.
> >
> > Signed-off-by: Alice Guo <alice.guo@nxp.com>
> > ---
> > Changes for v8:
> >  - none
> > Changes for v7:
> >  - solve the problem "drivers/soc/imx/soc-imx8m.c:174:34: warning:
> >    unused variable"
> 
> There was a reviewed-by part of changelog. The tag was in your commit.
> I am now confused, as changes for v8 say "none"... but shall I trust it?
> 
> Best regards,
> Krzysztof

Hi,
I forgot to add reviewed-by.

Best regards,
Alice
Alice Guo (OSS) Dec. 21, 2020, 3:10 a.m. UTC | #9
> -----Original Message-----
> From: Krzysztof Kozlowski <krzk@kernel.org>
> Sent: 2020年12月19日 20:17
> 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 v8 3/4] arm64: dts: imx8m: add NVMEM provider and
> consumer to read soc unique ID
> 
> On Fri, Dec 18, 2020 at 04:37:25PM +0800, Alice Guo (OSS) wrote:
> > From: Alice Guo <alice.guo@nxp.com>
> >
> > In order to be able to use NVMEM APIs to read soc unique ID, add the
> > nvmem data cell and name for nvmem-cells to the "soc" node, and add a
> > nvmem node which provides soc unique ID to efuse@30350000.
> >
> > Signed-off-by: Alice Guo <alice.guo@nxp.com>
> > ---
> > Changes for v8:
> >  - none
> > Changes for v7:
> >  - add Reviewed-by
> 
> What happened with my reviewed-by?
> 
> Best regards,
> Krzysztof

Hi,
I forgot to add reviewed-by. ☹

Best regards,
Alice
Krzysztof Kozlowski Dec. 21, 2020, 7:56 a.m. UTC | #10
On Mon, Dec 21, 2020 at 03:10:52AM +0000, Alice Guo (OSS) wrote:
> 
> 
> > -----Original Message-----
> > From: Krzysztof Kozlowski <krzk@kernel.org>
> > Sent: 2020年12月19日 20:17
> > 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 v8 3/4] arm64: dts: imx8m: add NVMEM provider and
> > consumer to read soc unique ID
> > 
> > On Fri, Dec 18, 2020 at 04:37:25PM +0800, Alice Guo (OSS) wrote:
> > > From: Alice Guo <alice.guo@nxp.com>
> > >
> > > In order to be able to use NVMEM APIs to read soc unique ID, add the
> > > nvmem data cell and name for nvmem-cells to the "soc" node, and add a
> > > nvmem node which provides soc unique ID to efuse@30350000.
> > >
> > > Signed-off-by: Alice Guo <alice.guo@nxp.com>
> > > ---
> > > Changes for v8:
> > >  - none
> > > Changes for v7:
> > >  - add Reviewed-by
> > 
> > What happened with my reviewed-by?
> > 
> > Best regards,
> > Krzysztof
> 
> Hi,
> I forgot to add reviewed-by. ☹

It was there already, so you had to remove it for some reason... but you
kept the changelog.

Best regards,
Krzysztof
Alice Guo (OSS) Dec. 21, 2020, 9:20 a.m. UTC | #11
> -----Original Message-----
> From: Rob Herring <robh+dt@kernel.org>
> Sent: 2020年12月18日 22:00
> To: Alice Guo (OSS) <alice.guo@oss.nxp.com>
> Cc: Krzysztof Kozlowski <krzk@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 v8 1/4] dt-bindings: soc: imx8m: add DT Binding doc for soc
> unique ID
> 
> On Fri, Dec 18, 2020 at 4:14 AM Alice Guo (OSS) <alice.guo@oss.nxp.com>
> wrote:
> >
> >
> >
> > > -----Original Message-----
> > > From: Krzysztof Kozlowski <krzk@kernel.org>
> > > Sent: 2020年12月18日 17:37
> > > 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 v8 1/4] dt-bindings: soc: imx8m: add DT Binding
> > > doc for soc unique ID
> > >
> > > On Fri, Dec 18, 2020 at 09:05:00AM +0000, Alice Guo (OSS) wrote:
> > >  > > +    required:
> > > > > > +      - compatible
> > > > > > +      - nvmem-cells
> > > > > > +      - nvmem-cell-names
> > > > > > +
> > > > > > +additionalProperties: true
> > > > >
> > > > > Don't leave comments unresolved (or resolve them against review
> > > > > without discussion). Rob asked for changing it. The same as with
> > > > > all schemas - you need to describe the missing properties.
> > > > >
> > > > > Best regards,
> > > > > Krzysztof
> > > >
> > > > Hi,
> > > > Thank you for your advice. I replied to him and let him know I
> > > > remained here
> > > unchanged. There will be errors according to his suggestion.
> > >
> > > Then the solution is to correct the errors - describe missing
> > > properties
> > > - instead of ignoring the suggestion and making a resubmit right away.
> > >
> > > Best regards,
> > > Krzysztof
> >
> > Hi,
> > I am sorry I do not DT Binding doc very well.
> >
> > I checked the usage of patternProperties and additionalProperties in
> https://json-schema.org/understanding-json-schema/reference/object.html.
> > I noticed a sentence on the website: " If additionalProperties is a
> > boolean and set to false, no additional properties will be allowed.", so I think
> that if additionalProperties is a boolean and set to true, additional properties
> will be allowed. Letting here unchanged is my solution to correct the errors.
> > I am not sure, I asked Rob for advice on the v6 by email, but he didn't reply to
> me, so I made a resubmit.
> 
> You waited an hour and I was sleeping! Waiting means waiting a week.
> 
> You need to add '#address-cells' and '#size-cells'.
> 
> Rob
Hi, Rob

Can change to the following code?
When uses "additionalProperties: type: object", need to add model, compatible, interrupt-parent, #address-cells and #size-cells.
There will be error with adding interrupt-parent because "dt-bindings: remove 'interrupt-parent' from bindings".

# 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.

properties:
  $nodename:
    const: '/'

  compatible:
    contains:
      enum:
        - fsl,imx8mm
        - fsl,imx8mn
        - fsl,imx8mp
        - fsl,imx8mq
 
  "#address-cells":
    const: 2
  "#size-cells":
    const: 2

patternProperties:
  "^soc@[0-9a-f]+$":
    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
...

Best regards,
Alice
Rob Herring Dec. 21, 2020, 8:29 p.m. UTC | #12
On Mon, Dec 21, 2020 at 2:20 AM Alice Guo (OSS) <alice.guo@oss.nxp.com> wrote:
>
>
>
> > -----Original Message-----
> > From: Rob Herring <robh+dt@kernel.org>
> > Sent: 2020年12月18日 22:00
> > To: Alice Guo (OSS) <alice.guo@oss.nxp.com>
> > Cc: Krzysztof Kozlowski <krzk@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 v8 1/4] dt-bindings: soc: imx8m: add DT Binding doc for soc
> > unique ID
> >
> > On Fri, Dec 18, 2020 at 4:14 AM Alice Guo (OSS) <alice.guo@oss.nxp.com>
> > wrote:
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Krzysztof Kozlowski <krzk@kernel.org>
> > > > Sent: 2020年12月18日 17:37
> > > > 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 v8 1/4] dt-bindings: soc: imx8m: add DT Binding
> > > > doc for soc unique ID
> > > >
> > > > On Fri, Dec 18, 2020 at 09:05:00AM +0000, Alice Guo (OSS) wrote:
> > > >  > > +    required:
> > > > > > > +      - compatible
> > > > > > > +      - nvmem-cells
> > > > > > > +      - nvmem-cell-names
> > > > > > > +
> > > > > > > +additionalProperties: true
> > > > > >
> > > > > > Don't leave comments unresolved (or resolve them against review
> > > > > > without discussion). Rob asked for changing it. The same as with
> > > > > > all schemas - you need to describe the missing properties.
> > > > > >
> > > > > > Best regards,
> > > > > > Krzysztof
> > > > >
> > > > > Hi,
> > > > > Thank you for your advice. I replied to him and let him know I
> > > > > remained here
> > > > unchanged. There will be errors according to his suggestion.
> > > >
> > > > Then the solution is to correct the errors - describe missing
> > > > properties
> > > > - instead of ignoring the suggestion and making a resubmit right away.
> > > >
> > > > Best regards,
> > > > Krzysztof
> > >
> > > Hi,
> > > I am sorry I do not DT Binding doc very well.
> > >
> > > I checked the usage of patternProperties and additionalProperties in
> > https://json-schema.org/understanding-json-schema/reference/object.html.
> > > I noticed a sentence on the website: " If additionalProperties is a
> > > boolean and set to false, no additional properties will be allowed.", so I think
> > that if additionalProperties is a boolean and set to true, additional properties
> > will be allowed. Letting here unchanged is my solution to correct the errors.
> > > I am not sure, I asked Rob for advice on the v6 by email, but he didn't reply to
> > me, so I made a resubmit.
> >
> > You waited an hour and I was sleeping! Waiting means waiting a week.
> >
> > You need to add '#address-cells' and '#size-cells'.
> >
> > Rob
> Hi, Rob
>
> Can change to the following code?
> When uses "additionalProperties: type: object", need to add model, compatible, interrupt-parent, #address-cells and #size-cells.
> There will be error with adding interrupt-parent because "dt-bindings: remove 'interrupt-parent' from bindings".

You are at the wrong level. It's 'additionalProperties' for the soc
node, not the root. See below.

>
> # 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.
>
> properties:
>   $nodename:
>     const: '/'
>
>   compatible:
>     contains:
>       enum:
>         - fsl,imx8mm
>         - fsl,imx8mn
>         - fsl,imx8mp
>         - fsl,imx8mq
>
>   "#address-cells":
>     const: 2
>   "#size-cells":
>     const: 2
>
> patternProperties:
>   "^soc@[0-9a-f]+$":
>     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:
        type: object

> additionalProperties: true

And keep this as-is.

> ...
>
> Best regards,
> Alice
>
>
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..f0b0fc7b3ac6
--- /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
+
+patternProperties:
+  "^soc@[0-9a-f]+$":
+    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
+...