mbox series

[0/7] dt-bindings: imx8mp: fix dt schema check errors

Message ID 20210715082536.1882077-1-aisheng.dong@nxp.com
Headers show
Series dt-bindings: imx8mp: fix dt schema check errors | expand

Message

Aisheng Dong July 15, 2021, 8:25 a.m. UTC
This patch series aims to fix a lot of dt schema check errors on
imx8mp evk board found by make dt_binding_check and dtbs_check.

There're still a few check errors remain (e.g. crypto/dma/fec) which
needs convert to json schema first and fixed by separate patches.

Dong Aisheng (7):
  dt-bindings: can: flexcan: fix imx8mp compatbile
  dt-bindings: spi: flexspi: convert to json schema
  dt-bindings: net: dsa: sja1105: fix wrong indentation
  dt-bindings: phy: imx8mq-usb-phy: convert to json schema
  dt-bindings: soc: imx: add missing anatop binding
  dt-bindings: soc: imx: add missing iomuxc gpr binding
  arm64: dts: imx8mp: fix fspi dt schema check error

 .../bindings/net/can/fsl,flexcan.yaml         |  2 +-
 .../bindings/net/dsa/nxp,sja1105.yaml         |  4 +-
 .../bindings/phy/fsl,imx8mq-usb-phy.txt       | 20 -----
 .../bindings/phy/fsl,imx8mq-usb-phy.yaml      | 53 +++++++++++
 .../bindings/soc/imx/fsl,anatop.yaml          | 68 +++++++++++++++
 .../devicetree/bindings/soc/imx/fsl,gpr.yaml  | 69 +++++++++++++++
 .../devicetree/bindings/spi/spi-nxp-fspi.txt  | 44 ----------
 .../devicetree/bindings/spi/spi-nxp-fspi.yaml | 87 +++++++++++++++++++
 arch/arm64/boot/dts/freescale/imx8mp.dtsi     |  2 +-
 9 files changed, 281 insertions(+), 68 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/phy/fsl,imx8mq-usb-phy.txt
 create mode 100644 Documentation/devicetree/bindings/phy/fsl,imx8mq-usb-phy.yaml
 create mode 100644 Documentation/devicetree/bindings/soc/imx/fsl,anatop.yaml
 create mode 100644 Documentation/devicetree/bindings/soc/imx/fsl,gpr.yaml
 delete mode 100644 Documentation/devicetree/bindings/spi/spi-nxp-fspi.txt
 create mode 100644 Documentation/devicetree/bindings/spi/spi-nxp-fspi.yaml

Comments

Vladimir Oltean July 15, 2021, 10:04 a.m. UTC | #1
Hi Aisheng,

On Thu, Jul 15, 2021 at 04:25:32PM +0800, Dong Aisheng wrote:
> This patch fixes the following error:
> Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml:70:17: [warning] wrong indentation: expected 18 but found 16 (indentation)
> 
> Cc: Andrew Lunn <andrew@lunn.ch>
> Cc: Vivien Didelot <vivien.didelot@gmail.com>
> Cc: Florian Fainelli <f.fainelli@gmail.com>
> Cc: Vladimir Oltean <olteanv@gmail.com>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: netdev@vger.kernel.org
> Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
> ---

Thank you for preparing and sending the patch.
It looks like Rob already applied another version of this change
yesterday:
https://lore.kernel.org/netdev/20210622113327.3613595-1-thierry.reding@gmail.com/
I wasn't copied on that patch, I noticed it rather by coincidence.
Dong Aisheng July 15, 2021, 10:43 a.m. UTC | #2
On Thu, Jul 15, 2021 at 6:05 PM Vladimir Oltean <olteanv@gmail.com> wrote:
>
> Hi Aisheng,
>
> On Thu, Jul 15, 2021 at 04:25:32PM +0800, Dong Aisheng wrote:
> > This patch fixes the following error:
> > Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml:70:17: [warning] wrong indentation: expected 18 but found 16 (indentation)
> >
> > Cc: Andrew Lunn <andrew@lunn.ch>
> > Cc: Vivien Didelot <vivien.didelot@gmail.com>
> > Cc: Florian Fainelli <f.fainelli@gmail.com>
> > Cc: Vladimir Oltean <olteanv@gmail.com>
> > Cc: "David S. Miller" <davem@davemloft.net>
> > Cc: Rob Herring <robh+dt@kernel.org>
> > Cc: netdev@vger.kernel.org
> > Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
> > ---
>
> Thank you for preparing and sending the patch.
> It looks like Rob already applied another version of this change
> yesterday:
> https://lore.kernel.org/netdev/20210622113327.3613595-1-thierry.reding@gmail.com/
> I wasn't copied on that patch, I noticed it rather by coincidence.

Got it, then this one can be dropped.

Regards
Aisheng
Joakim Zhang July 15, 2021, 11 a.m. UTC | #3
Hi Aisheng, Marc,

> -----Original Message-----

> From: Dong Aisheng <dongas86@gmail.com>

> Sent: 2021年7月15日 18:46

> To: Marc Kleine-Budde <mkl@pengutronix.de>

> Cc: Aisheng Dong <aisheng.dong@nxp.com>; devicetree

> <devicetree@vger.kernel.org>; moderated list:ARM/FREESCALE IMX / MXC

> ARM ARCHITECTURE <linux-arm-kernel@lists.infradead.org>; dl-linux-imx

> <linux-imx@nxp.com>; Sascha Hauer <kernel@pengutronix.de>; Rob Herring

> <robh+dt@kernel.org>; Shawn Guo <shawnguo@kernel.org>; Joakim Zhang

> <qiangqing.zhang@nxp.com>; linux-can@vger.kernel.org;

> netdev@vger.kernel.org

> Subject: Re: [PATCH 1/7] dt-bindings: can: flexcan: fix imx8mp compatbile

> 

> Hi Marc,

> 

> On Thu, Jul 15, 2021 at 5:12 PM Marc Kleine-Budde <mkl@pengutronix.de>

> wrote:

> >

> > On 15.07.2021 16:25:30, Dong Aisheng wrote:

> > > This patch fixes the following errors during make dtbs_check:

> > > arch/arm64/boot/dts/freescale/imx8mp-evk.dt.yaml: can@308c0000:

> compatible: 'oneOf' conditional failed, one must be fixed:

> > >       ['fsl,imx8mp-flexcan', 'fsl,imx6q-flexcan'] is too long

> >

> > IIRC the fsl,imx6q-flexcan binding doesn't work on the imx8mp. Maybe

> > better change the dtsi?

> 

> I checked with Joakim that the flexcan on MX8MP is derived from MX6Q with

> extra ECC added. Maybe we should still keep it from HW point of view?


Sorry, Aisheng, I double check the history, and get the below results:

8MP reuses 8QXP(8QM), except ECC_EN (ipv_flexcan3_syn_006/D_IP_FlexCAN3_SYN_057 which corresponds to version d_ip_flexcan3_syn.03.00.17.01)

I prefer to change the dtsi as Mac suggested if possible, shall I send a fix patch?
 
Best Regards,
Joakim Zhang
> Regards

> Aisheng

> 

> >

> > regards,

> > Marc

> >

> > --

> > Pengutronix e.K.                 | Marc Kleine-Budde           |

> > Embedded Linux                   |

> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.p

> engutronix.de%2F&amp;data=04%7C01%7Cqiangqing.zhang%40nxp.com%7Ce

> df7b681c04c48c0695e08d9477e03b0%7C686ea1d3bc2b4c6fa92cd99c5c30163

> 5%7C0%7C0%7C637619428815826860%7CUnknown%7CTWFpbGZsb3d8eyJWI

> joiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1

> 000&amp;sdata=Sd01Qk9H%2F8pBD0FAFQdQnQU9qp%2Br2ItGKdljK%2BWTiG

> Q%3D&amp;reserved=0  |

> > Vertretung West/Dortmund         | Phone: +49-231-2826-924     |

> > Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |
Dong Aisheng July 15, 2021, 11:36 a.m. UTC | #4
On Thu, Jul 15, 2021 at 7:07 PM Marc Kleine-Budde <mkl@pengutronix.de> wrote:
>
> On 15.07.2021 11:00:07, Joakim Zhang wrote:
> > > I checked with Joakim that the flexcan on MX8MP is derived from MX6Q with
> > > extra ECC added. Maybe we should still keep it from HW point of view?
> >
> > Sorry, Aisheng, I double check the history, and get the below results:
> >
> > 8MP reuses 8QXP(8QM), except ECC_EN
> > (ipv_flexcan3_syn_006/D_IP_FlexCAN3_SYN_057 which corresponds to
> > version d_ip_flexcan3_syn.03.00.17.01)
>
> Also see commit message of:
>
> https://lore.kernel.org/linux-can/20200929211557.14153-2-qiangqing.zhang@nxp.com/
>
> > I prefer to change the dtsi as Mac suggested if possible, shall I send
> > a fix patch?
>
> Make it so!

Then should it be "fsl,imx8mp-flexcan", "fsl,imx8qxp-flexcan" rather than only
drop "fsl,imx6q-flexcan"?

Regards
Aisheng

>
> regards,
> Marc
>
> --
> Pengutronix e.K.                 | Marc Kleine-Budde           |
> Embedded Linux                   | https://www.pengutronix.de  |
> Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
> Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |
Marc Kleine-Budde July 15, 2021, 12:07 p.m. UTC | #5
On 15.07.2021 19:36:06, Dong Aisheng wrote:
> Then should it be "fsl,imx8mp-flexcan", "fsl,imx8qxp-flexcan" rather than only
> drop "fsl,imx6q-flexcan"?

The driver has compatibles for the 8qm, not for the 8qxp:

|	{ .compatible = "fsl,imx8qm-flexcan", .data = &fsl_imx8qm_devtype_data, },
|	{ .compatible = "fsl,imx8mp-flexcan", .data = &fsl_imx8mp_devtype_data, },

Marc
Joakim Zhang July 16, 2021, 2:04 a.m. UTC | #6
Hi Mac, Aisheng,

> -----Original Message-----

> From: Marc Kleine-Budde <mkl@pengutronix.de>

> Sent: 2021年7月15日 20:07

> To: Dong Aisheng <dongas86@gmail.com>

> Cc: Joakim Zhang <qiangqing.zhang@nxp.com>; Aisheng Dong

> <aisheng.dong@nxp.com>; devicetree <devicetree@vger.kernel.org>;

> moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE

> <linux-arm-kernel@lists.infradead.org>; dl-linux-imx <linux-imx@nxp.com>;

> Sascha Hauer <kernel@pengutronix.de>; Rob Herring <robh+dt@kernel.org>;

> Shawn Guo <shawnguo@kernel.org>; linux-can@vger.kernel.org;

> netdev@vger.kernel.org

> Subject: Re: [PATCH 1/7] dt-bindings: can: flexcan: fix imx8mp compatbile

> 

> On 15.07.2021 19:36:06, Dong Aisheng wrote:

> > Then should it be "fsl,imx8mp-flexcan", "fsl,imx8qxp-flexcan" rather

> > than only drop "fsl,imx6q-flexcan"?

> 

> The driver has compatibles for the 8qm, not for the 8qxp:

> 

> |	{ .compatible = "fsl,imx8qm-flexcan", .data =

> &fsl_imx8qm_devtype_data, },

> |	{ .compatible = "fsl,imx8mp-flexcan", .data =

> |&fsl_imx8mp_devtype_data, },


AFAIK, we first design the i.MX8QM FlexCAN and later i.MX8QXP reuses IP from i.MX8QM, so there is no difference for them.

IMHO, IP design is always backwards compatible, then we need list each as fallback compatible string? I think it's unnecessary.

Best Regards,
Joakim Zhang
> Marc

> 

> --

> Pengutronix e.K.                 | Marc Kleine-Budde           |

> Embedded Linux                   | https://www.pengutronix.de  |

> Vertretung West/Dortmund         | Phone: +49-231-2826-924     |

> Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |
Marc Kleine-Budde July 16, 2021, 9:06 a.m. UTC | #7
On 16.07.2021 02:04:56, Joakim Zhang wrote:
> > On 15.07.2021 19:36:06, Dong Aisheng wrote:

> > > Then should it be "fsl,imx8mp-flexcan", "fsl,imx8qxp-flexcan" rather

> > > than only drop "fsl,imx6q-flexcan"?

> > 

> > The driver has compatibles for the 8qm, not for the 8qxp:

> > 

> > |	{ .compatible = "fsl,imx8qm-flexcan", .data =

> > &fsl_imx8qm_devtype_data, },

> > |	{ .compatible = "fsl,imx8mp-flexcan", .data =

> > |&fsl_imx8mp_devtype_data, },

> 

> AFAIK, we first design the i.MX8QM FlexCAN and later i.MX8QXP reuses

> IP from i.MX8QM, so there is no difference for them.

> 

> IMHO, IP design is always backwards compatible,


Hopefully the IP blocks of the i.MX8Q* are compatible, but the other
flexcan IP core are not.

> then we need list each as fallback compatible string? I think it's

> unnecessary.


In the DTs we usually use the name of the SoC we're just describing as
the first compatible, and add a second compatible with the oldest SoC
having this IP core or an IP core that is compatible (so that the driver
works).

As the imx8mp needs the DISABLE_MECR quirk it's not compatible with the
imx6.

regards,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |
Rob Herring July 22, 2021, 2:49 a.m. UTC | #8
On Thu, Jul 15, 2021 at 04:25:34PM +0800, Dong Aisheng wrote:
> Anatop is a system combo module which supports various analog functions

> like PLL, Regulators, LDOs, Sensors and etc.

> This binding doc is generated based on the exist usage in dts

> in order to fix dt schema check failures.

> 

> Cc: Rob Herring <robh+dt@kernel.org>

> Cc: Shawn Guo <shawnguo@kernel.org>

> Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>

> ---

>  .../bindings/soc/imx/fsl,anatop.yaml          | 68 +++++++++++++++++++

>  1 file changed, 68 insertions(+)

>  create mode 100644 Documentation/devicetree/bindings/soc/imx/fsl,anatop.yaml

> 

> diff --git a/Documentation/devicetree/bindings/soc/imx/fsl,anatop.yaml b/Documentation/devicetree/bindings/soc/imx/fsl,anatop.yaml

> new file mode 100644

> index 000000000000..f379d960f527

> --- /dev/null

> +++ b/Documentation/devicetree/bindings/soc/imx/fsl,anatop.yaml

> @@ -0,0 +1,68 @@

> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)

> +%YAML 1.2

> +---

> +$id: http://devicetree.org/schemas/soc/imx/fsl,anatop.yaml#

> +$schema: http://devicetree.org/meta-schemas/core.yaml#

> +

> +title: Freescale Anatop binding

> +

> +maintainers:

> +  - Dong Aisheng <aisheng.dong@nxp.com>

> +

> +properties:

> +  compatible:

> +    oneOf:

> +      - items:

> +          - const: fsl,imx6q-anatop

> +          - const: syscon

> +          - const: simple-mfd

> +      - items:

> +          - enum:

> +              - fsl,imx6sl-anatop

> +              - fsl,imx6sll-anatop

> +              - fsl,imx6sx-anatop

> +              - fsl,imx6ul-anatop

> +              - fsl,imx7d-anatop

> +          - const: fsl,imx6q-anatop

> +          - const: syscon

> +          - const: simple-mfd

> +      - items:

> +          - enum:

> +              - fsl,imx8mq-anatop

> +              - fsl,imx8mm-anatop

> +              - fsl,vf610-anatop

> +          - const: syscon

> +      - items:

> +          - enum:

> +              - fsl,imx8mn-anatop

> +              - fsl,imx8mp-anatop

> +          - const: fsl,imx8mm-anatop

> +          - const: syscon

> +

> +  reg:

> +    maxItems: 1

> +

> +  interrupts:

> +    items:

> +      - description: Temperature Sensor

> +      - description: PMU interrupt 1

> +      - description: PMU interrupt 2

> +    minItems: 1

> +    maxItems: 3


Don't need maxItems.

> +

> +required:

> +  - compatible

> +  - reg

> +

> +additionalProperties: true


This should be the case only for common schemas used by other schemas.

> +

> +examples:

> +  - |

> +    #include <dt-bindings/interrupt-controller/irq.h>

> +    anatop: anatop@20c8000 {


Drop unused labels.

> +        compatible = "fsl,imx6q-anatop", "syscon", "simple-mfd";

> +        reg = <0x020c8000 0x1000>;

> +        interrupts = <0 49 IRQ_TYPE_LEVEL_HIGH>,

> +                     <0 54 IRQ_TYPE_LEVEL_HIGH>,

> +                     <0 127 IRQ_TYPE_LEVEL_HIGH>;

> +        };

> -- 

> 2.25.1

> 

>
Dong Aisheng Aug. 2, 2021, 11:36 a.m. UTC | #9
Hi Rob,

On Thu, Jul 22, 2021 at 10:49 AM Rob Herring <robh@kernel.org> wrote:
>

> On Thu, Jul 15, 2021 at 04:25:34PM +0800, Dong Aisheng wrote:

> > Anatop is a system combo module which supports various analog functions

> > like PLL, Regulators, LDOs, Sensors and etc.

> > This binding doc is generated based on the exist usage in dts

> > in order to fix dt schema check failures.

> >

> > Cc: Rob Herring <robh+dt@kernel.org>

> > Cc: Shawn Guo <shawnguo@kernel.org>

> > Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>

> > ---

> >  .../bindings/soc/imx/fsl,anatop.yaml          | 68 +++++++++++++++++++

> >  1 file changed, 68 insertions(+)

> >  create mode 100644 Documentation/devicetree/bindings/soc/imx/fsl,anatop.yaml

> >

> > diff --git a/Documentation/devicetree/bindings/soc/imx/fsl,anatop.yaml b/Documentation/devicetree/bindings/soc/imx/fsl,anatop.yaml

> > new file mode 100644

> > index 000000000000..f379d960f527

> > --- /dev/null

> > +++ b/Documentation/devicetree/bindings/soc/imx/fsl,anatop.yaml

> > @@ -0,0 +1,68 @@

> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)

> > +%YAML 1.2

> > +---

> > +$id: http://devicetree.org/schemas/soc/imx/fsl,anatop.yaml#

> > +$schema: http://devicetree.org/meta-schemas/core.yaml#

> > +

> > +title: Freescale Anatop binding

> > +

> > +maintainers:

> > +  - Dong Aisheng <aisheng.dong@nxp.com>

> > +

> > +properties:

> > +  compatible:

> > +    oneOf:

> > +      - items:

> > +          - const: fsl,imx6q-anatop

> > +          - const: syscon

> > +          - const: simple-mfd

> > +      - items:

> > +          - enum:

> > +              - fsl,imx6sl-anatop

> > +              - fsl,imx6sll-anatop

> > +              - fsl,imx6sx-anatop

> > +              - fsl,imx6ul-anatop

> > +              - fsl,imx7d-anatop

> > +          - const: fsl,imx6q-anatop

> > +          - const: syscon

> > +          - const: simple-mfd

> > +      - items:

> > +          - enum:

> > +              - fsl,imx8mq-anatop

> > +              - fsl,imx8mm-anatop

> > +              - fsl,vf610-anatop

> > +          - const: syscon

> > +      - items:

> > +          - enum:

> > +              - fsl,imx8mn-anatop

> > +              - fsl,imx8mp-anatop

> > +          - const: fsl,imx8mm-anatop

> > +          - const: syscon

> > +

> > +  reg:

> > +    maxItems: 1

> > +

> > +  interrupts:

> > +    items:

> > +      - description: Temperature Sensor

> > +      - description: PMU interrupt 1

> > +      - description: PMU interrupt 2

> > +    minItems: 1

> > +    maxItems: 3

>

> Don't need maxItems.

>


Got it

> > +

> > +required:

> > +  - compatible

> > +  - reg

> > +

> > +additionalProperties: true

>

> This should be the case only for common schemas used by other schemas.

>


Like iomuxc-gpr in patch 6, the problem is that for those nodes with
simple-mfd backwards compatibility,
there could be possibly some random subnodes since there're generic
combo registers.
That's why i use additionalProperties true to cover it.
Do you think it's ok?

e.g.
anatop: anatop@20c8000 {
        compatible = "fsl,imx6q-anatop", "syscon", "simple-mfd";
        reg = <0x020c8000 0x1000>;
        interrupts = <0 49 IRQ_TYPE_LEVEL_HIGH>,
                     <0 54 IRQ_TYPE_LEVEL_HIGH>,
                     <0 127 IRQ_TYPE_LEVEL_HIGH>;

        reg_vdd1p1: regulator-1p1 {
                compatible = "fsl,anatop-regulator";
                regulator-name = "vdd1p1";
                regulator-min-microvolt = <1000000>;
                regulator-max-microvolt = <1200000>;
                ...
        };

        tempmon: tempmon {
                compatible = "fsl,imx6q-tempmon";
                interrupt-parent = <&gpc>;
                interrupts = <0 49 IRQ_TYPE_LEVEL_HIGH>;
                fsl,tempmon = <&anatop>;
                nvmem-cells = <&tempmon_calib>, <&tempmon_temp_grade>;
                nvmem-cell-names = "calib", "temp_grade";
                clocks = <&clks IMX6QDL_CLK_PLL3_USB_OTG>;
                #thermal-sensor-cells = <0>;
        };
};

gpr: iomuxc-gpr@20e0000 {
        compatible = "fsl,imx6q-iomuxc-gpr", "syscon", "simple-mfd";
        reg = <0x20e0000 0x38>;

        mux: mux-controller {
                compatible = "mmio-mux";
                #mux-control-cells = <1>;
        };
};

> > +

> > +examples:

> > +  - |

> > +    #include <dt-bindings/interrupt-controller/irq.h>

> > +    anatop: anatop@20c8000 {

>


Got it

Regards
Aisheng

> Drop unused labels.

>

> > +        compatible = "fsl,imx6q-anatop", "syscon", "simple-mfd";

> > +        reg = <0x020c8000 0x1000>;

> > +        interrupts = <0 49 IRQ_TYPE_LEVEL_HIGH>,

> > +                     <0 54 IRQ_TYPE_LEVEL_HIGH>,

> > +                     <0 127 IRQ_TYPE_LEVEL_HIGH>;

> > +        };

> > --

> > 2.25.1

> >

> >
Rob Herring Aug. 2, 2021, 3:01 p.m. UTC | #10
On Mon, Aug 2, 2021 at 5:38 AM Dong Aisheng <dongas86@gmail.com> wrote:
>

> Hi Rob,

>

> On Thu, Jul 22, 2021 at 10:49 AM Rob Herring <robh@kernel.org> wrote:

> >

> > On Thu, Jul 15, 2021 at 04:25:34PM +0800, Dong Aisheng wrote:

> > > Anatop is a system combo module which supports various analog functions

> > > like PLL, Regulators, LDOs, Sensors and etc.

> > > This binding doc is generated based on the exist usage in dts

> > > in order to fix dt schema check failures.

> > >

> > > Cc: Rob Herring <robh+dt@kernel.org>

> > > Cc: Shawn Guo <shawnguo@kernel.org>

> > > Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>

> > > ---

> > >  .../bindings/soc/imx/fsl,anatop.yaml          | 68 +++++++++++++++++++

> > >  1 file changed, 68 insertions(+)

> > >  create mode 100644 Documentation/devicetree/bindings/soc/imx/fsl,anatop.yaml

> > >

> > > diff --git a/Documentation/devicetree/bindings/soc/imx/fsl,anatop.yaml b/Documentation/devicetree/bindings/soc/imx/fsl,anatop.yaml

> > > new file mode 100644

> > > index 000000000000..f379d960f527

> > > --- /dev/null

> > > +++ b/Documentation/devicetree/bindings/soc/imx/fsl,anatop.yaml

> > > @@ -0,0 +1,68 @@

> > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)

> > > +%YAML 1.2

> > > +---

> > > +$id: http://devicetree.org/schemas/soc/imx/fsl,anatop.yaml#

> > > +$schema: http://devicetree.org/meta-schemas/core.yaml#

> > > +

> > > +title: Freescale Anatop binding

> > > +

> > > +maintainers:

> > > +  - Dong Aisheng <aisheng.dong@nxp.com>

> > > +

> > > +properties:

> > > +  compatible:

> > > +    oneOf:

> > > +      - items:

> > > +          - const: fsl,imx6q-anatop

> > > +          - const: syscon

> > > +          - const: simple-mfd

> > > +      - items:

> > > +          - enum:

> > > +              - fsl,imx6sl-anatop

> > > +              - fsl,imx6sll-anatop

> > > +              - fsl,imx6sx-anatop

> > > +              - fsl,imx6ul-anatop

> > > +              - fsl,imx7d-anatop

> > > +          - const: fsl,imx6q-anatop

> > > +          - const: syscon

> > > +          - const: simple-mfd

> > > +      - items:

> > > +          - enum:

> > > +              - fsl,imx8mq-anatop

> > > +              - fsl,imx8mm-anatop

> > > +              - fsl,vf610-anatop

> > > +          - const: syscon

> > > +      - items:

> > > +          - enum:

> > > +              - fsl,imx8mn-anatop

> > > +              - fsl,imx8mp-anatop

> > > +          - const: fsl,imx8mm-anatop

> > > +          - const: syscon

> > > +

> > > +  reg:

> > > +    maxItems: 1

> > > +

> > > +  interrupts:

> > > +    items:

> > > +      - description: Temperature Sensor

> > > +      - description: PMU interrupt 1

> > > +      - description: PMU interrupt 2

> > > +    minItems: 1

> > > +    maxItems: 3

> >

> > Don't need maxItems.

> >

>

> Got it

>

> > > +

> > > +required:

> > > +  - compatible

> > > +  - reg

> > > +

> > > +additionalProperties: true

> >

> > This should be the case only for common schemas used by other schemas.

> >

>

> Like iomuxc-gpr in patch 6, the problem is that for those nodes with

> simple-mfd backwards compatibility,

> there could be possibly some random subnodes since there're generic

> combo registers.

> That's why i use additionalProperties true to cover it.

> Do you think it's ok?


No, because all that should be reviewed rather than random subnodes.
Otherwise, how do we validate them?

Rob
Dong Aisheng Aug. 3, 2021, 4:04 a.m. UTC | #11
On Mon, Aug 2, 2021 at 11:02 PM Rob Herring <robh@kernel.org> wrote:
>

> On Mon, Aug 2, 2021 at 5:38 AM Dong Aisheng <dongas86@gmail.com> wrote:

> >

> > Hi Rob,

> >

> > On Thu, Jul 22, 2021 at 10:49 AM Rob Herring <robh@kernel.org> wrote:

> > >

> > > On Thu, Jul 15, 2021 at 04:25:34PM +0800, Dong Aisheng wrote:

> > > > Anatop is a system combo module which supports various analog functions

> > > > like PLL, Regulators, LDOs, Sensors and etc.

> > > > This binding doc is generated based on the exist usage in dts

> > > > in order to fix dt schema check failures.

> > > >

> > > > Cc: Rob Herring <robh+dt@kernel.org>

> > > > Cc: Shawn Guo <shawnguo@kernel.org>

> > > > Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>

> > > > ---

> > > >  .../bindings/soc/imx/fsl,anatop.yaml          | 68 +++++++++++++++++++

> > > >  1 file changed, 68 insertions(+)

> > > >  create mode 100644 Documentation/devicetree/bindings/soc/imx/fsl,anatop.yaml

> > > >

> > > > diff --git a/Documentation/devicetree/bindings/soc/imx/fsl,anatop.yaml b/Documentation/devicetree/bindings/soc/imx/fsl,anatop.yaml

> > > > new file mode 100644

> > > > index 000000000000..f379d960f527

> > > > --- /dev/null

> > > > +++ b/Documentation/devicetree/bindings/soc/imx/fsl,anatop.yaml

> > > > @@ -0,0 +1,68 @@

> > > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)

> > > > +%YAML 1.2

> > > > +---

> > > > +$id: http://devicetree.org/schemas/soc/imx/fsl,anatop.yaml#

> > > > +$schema: http://devicetree.org/meta-schemas/core.yaml#

> > > > +

> > > > +title: Freescale Anatop binding

> > > > +

> > > > +maintainers:

> > > > +  - Dong Aisheng <aisheng.dong@nxp.com>

> > > > +

> > > > +properties:

> > > > +  compatible:

> > > > +    oneOf:

> > > > +      - items:

> > > > +          - const: fsl,imx6q-anatop

> > > > +          - const: syscon

> > > > +          - const: simple-mfd

> > > > +      - items:

> > > > +          - enum:

> > > > +              - fsl,imx6sl-anatop

> > > > +              - fsl,imx6sll-anatop

> > > > +              - fsl,imx6sx-anatop

> > > > +              - fsl,imx6ul-anatop

> > > > +              - fsl,imx7d-anatop

> > > > +          - const: fsl,imx6q-anatop

> > > > +          - const: syscon

> > > > +          - const: simple-mfd

> > > > +      - items:

> > > > +          - enum:

> > > > +              - fsl,imx8mq-anatop

> > > > +              - fsl,imx8mm-anatop

> > > > +              - fsl,vf610-anatop

> > > > +          - const: syscon

> > > > +      - items:

> > > > +          - enum:

> > > > +              - fsl,imx8mn-anatop

> > > > +              - fsl,imx8mp-anatop

> > > > +          - const: fsl,imx8mm-anatop

> > > > +          - const: syscon

> > > > +

> > > > +  reg:

> > > > +    maxItems: 1

> > > > +

> > > > +  interrupts:

> > > > +    items:

> > > > +      - description: Temperature Sensor

> > > > +      - description: PMU interrupt 1

> > > > +      - description: PMU interrupt 2

> > > > +    minItems: 1

> > > > +    maxItems: 3

> > >

> > > Don't need maxItems.

> > >

> >

> > Got it

> >

> > > > +

> > > > +required:

> > > > +  - compatible

> > > > +  - reg

> > > > +

> > > > +additionalProperties: true

> > >

> > > This should be the case only for common schemas used by other schemas.

> > >

> >

> > Like iomuxc-gpr in patch 6, the problem is that for those nodes with

> > simple-mfd backwards compatibility,

> > there could be possibly some random subnodes since there're generic

> > combo registers.

> > That's why i use additionalProperties true to cover it.

> > Do you think it's ok?

>

> No, because all that should be reviewed rather than random subnodes.

> Otherwise, how do we validate them?


anatop and iomuxc-gpr are not simple mfd devices as they're misc
registers and could contain
various sub misc functions. And those sub functions usually have a
separate dt binding doc which
already covers them and does validation.
The binding here is addressing validation itself. It does not limit
the possible various sub function nodes
which already have a binding doc. Just like a bus node.

If we define them now, it means we may need to keep updating schema when new
user node appear as current dts may not use all possible sub functions.

However, i do agree that defining them all (and may need add more in
the future) helps validation.
But i'm not sure if it's worthy to do it for such cases for a 'bus' node?

Could you help clarify a bit more?

Regards
Aisheng

>

> Rob