diff mbox series

[v3,net-next,02/13] dt-bindings: net: add i.MX95 ENETC support

Message ID 20241017074637.1265584-3-wei.fang@nxp.com (mailing list archive)
State Superseded
Headers show
Series add basic support for i.MX95 NETC | expand

Commit Message

Wei Fang Oct. 17, 2024, 7:46 a.m. UTC
The ENETC of i.MX95 has been upgraded to revision 4.1, and the vendor
ID and device ID have also changed, so add the new compatible strings
for i.MX95 ENETC. In addition, i.MX95 supports configuration of RGMII
or RMII reference clock.

Signed-off-by: Wei Fang <wei.fang@nxp.com>
---
v2: Remove "nxp,imx95-enetc" compatible string.
v3:
1. Add restriction to "clcoks" and "clock-names" properties and rename
the clock, also remove the items from these two properties.
2. Remove unnecessary items for "pci1131,e101" compatible string.
---
 .../devicetree/bindings/net/fsl,enetc.yaml    | 22 ++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

Comments

Frank Li Oct. 17, 2024, 4:23 p.m. UTC | #1
On Thu, Oct 17, 2024 at 03:46:26PM +0800, Wei Fang wrote:
> The ENETC of i.MX95 has been upgraded to revision 4.1, and the vendor
> ID and device ID have also changed, so add the new compatible strings
> for i.MX95 ENETC. In addition, i.MX95 supports configuration of RGMII
> or RMII reference clock.
>
> Signed-off-by: Wei Fang <wei.fang@nxp.com>
> ---
> v2: Remove "nxp,imx95-enetc" compatible string.
> v3:
> 1. Add restriction to "clcoks" and "clock-names" properties and rename
> the clock, also remove the items from these two properties.
> 2. Remove unnecessary items for "pci1131,e101" compatible string.
> ---
>  .../devicetree/bindings/net/fsl,enetc.yaml    | 22 ++++++++++++++++---
>  1 file changed, 19 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/net/fsl,enetc.yaml b/Documentation/devicetree/bindings/net/fsl,enetc.yaml
> index e152c93998fe..e418c3e6e6b1 100644
> --- a/Documentation/devicetree/bindings/net/fsl,enetc.yaml
> +++ b/Documentation/devicetree/bindings/net/fsl,enetc.yaml
> @@ -20,10 +20,13 @@ maintainers:
>
>  properties:
>    compatible:
> -    items:
> +    oneOf:
> +      - items:
> +          - enum:
> +              - pci1957,e100
> +          - const: fsl,enetc
>        - enum:
> -          - pci1957,e100
> -      - const: fsl,enetc
> +          - pci1131,e101
>
>    reg:
>      maxItems: 1
> @@ -40,6 +43,19 @@ required:
>  allOf:
>    - $ref: /schemas/pci/pci-device.yaml
>    - $ref: ethernet-controller.yaml
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - pci1131,e101
> +    then:
> +      properties:
> +        clocks:
> +          maxItems: 1
> +          description: MAC transmit/receiver reference clock
> +        clock-names:
> +          const: ref

Did you run CHECK_DTBS for your dts file? clocks\clock-names should be
under top 'properties" firstly. Then use 'if' restrict it. But I am not
sure for that. only dt_binding_check is not enough because your example
have not use clocks and clok-names.

Frank

>
>  unevaluatedProperties: false
>
> --
> 2.34.1
>
Wei Fang Oct. 18, 2024, 1:20 a.m. UTC | #2
> -----Original Message-----
> From: Frank Li <frank.li@nxp.com>
> Sent: 2024年10月18日 0:23
> To: Wei Fang <wei.fang@nxp.com>
> Cc: davem@davemloft.net; edumazet@google.com; kuba@kernel.org;
> pabeni@redhat.com; robh@kernel.org; krzk+dt@kernel.org;
> conor+dt@kernel.org; Vladimir Oltean <vladimir.oltean@nxp.com>; Claudiu
> Manoil <claudiu.manoil@nxp.com>; Clark Wang <xiaoning.wang@nxp.com>;
> christophe.leroy@csgroup.eu; linux@armlinux.org.uk; bhelgaas@google.com;
> horms@kernel.org; imx@lists.linux.dev; netdev@vger.kernel.org;
> devicetree@vger.kernel.org; linux-kernel@vger.kernel.org;
> linux-pci@vger.kernel.org
> Subject: Re: [PATCH v3 net-next 02/13] dt-bindings: net: add i.MX95 ENETC
> support
> 
> On Thu, Oct 17, 2024 at 03:46:26PM +0800, Wei Fang wrote:
> > The ENETC of i.MX95 has been upgraded to revision 4.1, and the vendor
> > ID and device ID have also changed, so add the new compatible strings
> > for i.MX95 ENETC. In addition, i.MX95 supports configuration of RGMII
> > or RMII reference clock.
> >
> > Signed-off-by: Wei Fang <wei.fang@nxp.com>
> > ---
> > v2: Remove "nxp,imx95-enetc" compatible string.
> > v3:
> > 1. Add restriction to "clcoks" and "clock-names" properties and rename
> > the clock, also remove the items from these two properties.
> > 2. Remove unnecessary items for "pci1131,e101" compatible string.
> > ---
> >  .../devicetree/bindings/net/fsl,enetc.yaml    | 22 ++++++++++++++++---
> >  1 file changed, 19 insertions(+), 3 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/net/fsl,enetc.yaml
> > b/Documentation/devicetree/bindings/net/fsl,enetc.yaml
> > index e152c93998fe..e418c3e6e6b1 100644
> > --- a/Documentation/devicetree/bindings/net/fsl,enetc.yaml
> > +++ b/Documentation/devicetree/bindings/net/fsl,enetc.yaml
> > @@ -20,10 +20,13 @@ maintainers:
> >
> >  properties:
> >    compatible:
> > -    items:
> > +    oneOf:
> > +      - items:
> > +          - enum:
> > +              - pci1957,e100
> > +          - const: fsl,enetc
> >        - enum:
> > -          - pci1957,e100
> > -      - const: fsl,enetc
> > +          - pci1131,e101
> >
> >    reg:
> >      maxItems: 1
> > @@ -40,6 +43,19 @@ required:
> >  allOf:
> >    - $ref: /schemas/pci/pci-device.yaml
> >    - $ref: ethernet-controller.yaml
> > +  - if:
> > +      properties:
> > +        compatible:
> > +          contains:
> > +            enum:
> > +              - pci1131,e101
> > +    then:
> > +      properties:
> > +        clocks:
> > +          maxItems: 1
> > +          description: MAC transmit/receiver reference clock
> > +        clock-names:
> > +          const: ref
> 
> Did you run CHECK_DTBS for your dts file? clocks\clock-names should be under
> top 'properties" firstly. Then use 'if' restrict it. But I am not sure for that. only
> dt_binding_check is not enough because your example have not use clocks and
> clok-names.
> 

I have run dtbs_check and dt_binding_check in my local env. there were no
warnings and errors.

> 
> >
> >  unevaluatedProperties: false
> >
> > --
> > 2.34.1
> >
Alexander Stein Oct. 18, 2024, 6:52 a.m. UTC | #3
Hi,

Am Freitag, 18. Oktober 2024, 03:20:55 CEST schrieb Wei Fang:
> > -----Original Message-----
> > From: Frank Li <frank.li@nxp.com>
> > Sent: 2024年10月18日 0:23
> > To: Wei Fang <wei.fang@nxp.com>
> > Cc: davem@davemloft.net; edumazet@google.com; kuba@kernel.org;
> > pabeni@redhat.com; robh@kernel.org; krzk+dt@kernel.org;
> > conor+dt@kernel.org; Vladimir Oltean <vladimir.oltean@nxp.com>; Claudiu
> > Manoil <claudiu.manoil@nxp.com>; Clark Wang <xiaoning.wang@nxp.com>;
> > christophe.leroy@csgroup.eu; linux@armlinux.org.uk; bhelgaas@google.com;
> > horms@kernel.org; imx@lists.linux.dev; netdev@vger.kernel.org;
> > devicetree@vger.kernel.org; linux-kernel@vger.kernel.org;
> > linux-pci@vger.kernel.org
> > Subject: Re: [PATCH v3 net-next 02/13] dt-bindings: net: add i.MX95 ENETC
> > support
> > 
> > On Thu, Oct 17, 2024 at 03:46:26PM +0800, Wei Fang wrote:
> > > The ENETC of i.MX95 has been upgraded to revision 4.1, and the vendor
> > > ID and device ID have also changed, so add the new compatible strings
> > > for i.MX95 ENETC. In addition, i.MX95 supports configuration of RGMII
> > > or RMII reference clock.
> > >
> > > Signed-off-by: Wei Fang <wei.fang@nxp.com>
> > > ---
> > > v2: Remove "nxp,imx95-enetc" compatible string.
> > > v3:
> > > 1. Add restriction to "clcoks" and "clock-names" properties and rename
> > > the clock, also remove the items from these two properties.
> > > 2. Remove unnecessary items for "pci1131,e101" compatible string.
> > > ---
> > >  .../devicetree/bindings/net/fsl,enetc.yaml    | 22 ++++++++++++++++---
> > >  1 file changed, 19 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/Documentation/devicetree/bindings/net/fsl,enetc.yaml
> > > b/Documentation/devicetree/bindings/net/fsl,enetc.yaml
> > > index e152c93998fe..e418c3e6e6b1 100644
> > > --- a/Documentation/devicetree/bindings/net/fsl,enetc.yaml
> > > +++ b/Documentation/devicetree/bindings/net/fsl,enetc.yaml
> > > @@ -20,10 +20,13 @@ maintainers:
> > >
> > >  properties:
> > >    compatible:
> > > -    items:
> > > +    oneOf:
> > > +      - items:
> > > +          - enum:
> > > +              - pci1957,e100
> > > +          - const: fsl,enetc
> > >        - enum:
> > > -          - pci1957,e100
> > > -      - const: fsl,enetc
> > > +          - pci1131,e101
> > >
> > >    reg:
> > >      maxItems: 1
> > > @@ -40,6 +43,19 @@ required:
> > >  allOf:
> > >    - $ref: /schemas/pci/pci-device.yaml
> > >    - $ref: ethernet-controller.yaml
> > > +  - if:
> > > +      properties:
> > > +        compatible:
> > > +          contains:
> > > +            enum:
> > > +              - pci1131,e101
> > > +    then:
> > > +      properties:
> > > +        clocks:
> > > +          maxItems: 1
> > > +          description: MAC transmit/receiver reference clock
> > > +        clock-names:
> > > +          const: ref
> > 
> > Did you run CHECK_DTBS for your dts file? clocks\clock-names should be under
> > top 'properties" firstly. Then use 'if' restrict it. But I am not sure for that. only
> > dt_binding_check is not enough because your example have not use clocks and
> > clok-names.
> > 
> 
> I have run dtbs_check and dt_binding_check in my local env. there were no
> warnings and errors.

Is there already the DT part somewhere? Do you mind sharing it?

Best regards,
Alexander
Wei Fang Oct. 18, 2024, 7:50 a.m. UTC | #4
> -----Original Message-----
> From: Alexander Stein <alexander.stein@ew.tq-group.com>
> Sent: 2024年10月18日 14:53
> To: Frank Li <frank.li@nxp.com>; Wei Fang <wei.fang@nxp.com>
> Cc: davem@davemloft.net; edumazet@google.com; kuba@kernel.org;
> pabeni@redhat.com; robh@kernel.org; krzk+dt@kernel.org;
> conor+dt@kernel.org; Vladimir Oltean <vladimir.oltean@nxp.com>; Claudiu
> Manoil <claudiu.manoil@nxp.com>; Clark Wang <xiaoning.wang@nxp.com>;
> christophe.leroy@csgroup.eu; linux@armlinux.org.uk; bhelgaas@google.com;
> horms@kernel.org; imx@lists.linux.dev; netdev@vger.kernel.org;
> devicetree@vger.kernel.org; linux-kernel@vger.kernel.org;
> linux-pci@vger.kernel.org
> Subject: Re: [PATCH v3 net-next 02/13] dt-bindings: net: add i.MX95 ENETC
> support
> 
> Hi,
> 
> Am Freitag, 18. Oktober 2024, 03:20:55 CEST schrieb Wei Fang:
> > > -----Original Message-----
> > > From: Frank Li <frank.li@nxp.com>
> > > Sent: 2024年10月18日 0:23
> > > To: Wei Fang <wei.fang@nxp.com>
> > > Cc: davem@davemloft.net; edumazet@google.com; kuba@kernel.org;
> > > pabeni@redhat.com; robh@kernel.org; krzk+dt@kernel.org;
> > > conor+dt@kernel.org; Vladimir Oltean <vladimir.oltean@nxp.com>;
> > > conor+Claudiu
> > > Manoil <claudiu.manoil@nxp.com>; Clark Wang
> <xiaoning.wang@nxp.com>;
> > > christophe.leroy@csgroup.eu; linux@armlinux.org.uk;
> > > bhelgaas@google.com; horms@kernel.org; imx@lists.linux.dev;
> > > netdev@vger.kernel.org; devicetree@vger.kernel.org;
> > > linux-kernel@vger.kernel.org; linux-pci@vger.kernel.org
> > > Subject: Re: [PATCH v3 net-next 02/13] dt-bindings: net: add i.MX95
> > > ENETC support
> > >
> > > On Thu, Oct 17, 2024 at 03:46:26PM +0800, Wei Fang wrote:
> > > > The ENETC of i.MX95 has been upgraded to revision 4.1, and the
> > > > vendor ID and device ID have also changed, so add the new
> > > > compatible strings for i.MX95 ENETC. In addition, i.MX95 supports
> > > > configuration of RGMII or RMII reference clock.
> > > >
> > > > Signed-off-by: Wei Fang <wei.fang@nxp.com>
> > > > ---
> > > > v2: Remove "nxp,imx95-enetc" compatible string.
> > > > v3:
> > > > 1. Add restriction to "clcoks" and "clock-names" properties and
> > > > rename the clock, also remove the items from these two properties.
> > > > 2. Remove unnecessary items for "pci1131,e101" compatible string.
> > > > ---
> > > >  .../devicetree/bindings/net/fsl,enetc.yaml    | 22
> ++++++++++++++++---
> > > >  1 file changed, 19 insertions(+), 3 deletions(-)
> > > >
> > > > diff --git a/Documentation/devicetree/bindings/net/fsl,enetc.yaml
> > > > b/Documentation/devicetree/bindings/net/fsl,enetc.yaml
> > > > index e152c93998fe..e418c3e6e6b1 100644
> > > > --- a/Documentation/devicetree/bindings/net/fsl,enetc.yaml
> > > > +++ b/Documentation/devicetree/bindings/net/fsl,enetc.yaml
> > > > @@ -20,10 +20,13 @@ maintainers:
> > > >
> > > >  properties:
> > > >    compatible:
> > > > -    items:
> > > > +    oneOf:
> > > > +      - items:
> > > > +          - enum:
> > > > +              - pci1957,e100
> > > > +          - const: fsl,enetc
> > > >        - enum:
> > > > -          - pci1957,e100
> > > > -      - const: fsl,enetc
> > > > +          - pci1131,e101
> > > >
> > > >    reg:
> > > >      maxItems: 1
> > > > @@ -40,6 +43,19 @@ required:
> > > >  allOf:
> > > >    - $ref: /schemas/pci/pci-device.yaml
> > > >    - $ref: ethernet-controller.yaml
> > > > +  - if:
> > > > +      properties:
> > > > +        compatible:
> > > > +          contains:
> > > > +            enum:
> > > > +              - pci1131,e101
> > > > +    then:
> > > > +      properties:
> > > > +        clocks:
> > > > +          maxItems: 1
> > > > +          description: MAC transmit/receiver reference clock
> > > > +        clock-names:
> > > > +          const: ref
> > >
> > > Did you run CHECK_DTBS for your dts file? clocks\clock-names should
> > > be under top 'properties" firstly. Then use 'if' restrict it. But I
> > > am not sure for that. only dt_binding_check is not enough because
> > > your example have not use clocks and clok-names.
> > >
> >
> > I have run dtbs_check and dt_binding_check in my local env. there were
> > no warnings and errors.
> 
> Is there already the DT part somewhere? Do you mind sharing it?
> 
I will prepare the DT patch when this series is applied. Below is my local
patch of imx95.dtsi. FYI.

diff --git a/arch/arm64/boot/dts/freescale/imx95.dtsi b/arch/arm64/boot/dts/freescale/imx95.dtsi
index 03661e76550f..0f107a41b024 100644
--- a/arch/arm64/boot/dts/freescale/imx95.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx95.dtsi
@@ -1609,7 +1609,7 @@ pcie1_ep: pcie-ep@4c380000 {

                netcmix_blk_ctrl: syscon@4c810000 {
                        compatible = "nxp,imx95-netcmix-blk-ctrl", "syscon";
-                       reg = <0x0 0x4c810000 0x0 0x10000>;
+                       reg = <0x0 0x4c810000 0x0 0x8>;
                        #clock-cells = <1>;
                        clocks = <&scmi_clk IMX95_CLK_BUSNETCMIX>;
                        assigned-clocks = <&scmi_clk IMX95_CLK_BUSNETCMIX>;
@@ -1638,5 +1638,95 @@ ddr-pmu@4e090dc0 {
                        reg = <0x0 0x4e090dc0 0x0 0x200>;
                        interrupts = <GIC_SPI 91 IRQ_TYPE_LEVEL_HIGH>;
                };
+
+               netc_blk_ctrl: netc-blk-ctrl@4cde0000 {
+                       compatible = "nxp,imx95-netc-blk-ctrl";
+                       reg = <0x0 0x4cde0000 0x0 0x10000>,
+                             <0x0 0x4cdf0000 0x0 0x10000>,
+                             <0x0 0x4c81000c 0x0 0x18>;
+                       reg-names = "ierb", "prb", "netcmix";
+                       #address-cells = <2>;
+                       #size-cells = <2>;
+                       ranges;
+                       power-domains = <&scmi_devpd IMX95_PD_NETC>;
+                       assigned-clocks = <&scmi_clk IMX95_CLK_ENET>,
+                                         <&scmi_clk IMX95_CLK_ENETREF>;
+                       assigned-clock-parents = <&scmi_clk IMX95_CLK_SYSPLL1_PFD2>,
+                                                <&scmi_clk IMX95_CLK_SYSPLL1_PFD0>;
+                       assigned-clock-rates = <666666666>, <250000000>;
+                       clocks = <&scmi_clk IMX95_CLK_ENET>;
+                       clock-names = "ipg";
+                       status = "disabled";
+
+                       pcie_4ca00000: pcie@4ca00000 {
+                               compatible = "pci-host-ecam-generic";
+                               reg = <0x0 0x4ca00000 0x0 0x100000>;
+                               /* Must be 3. */
+                               #address-cells = <3>;
+                               /* Must be 2. */
+                               #size-cells = <2>;
+                               device_type = "pci";
+                               bus-range = <0x0 0x0>;
+                               msi-map = <0x0 &its 0x60 0x1>,  //ENETC0 PF
+                                         <0x10 &its 0x61 0x1>, //ENETC0 VF0
+                                         <0x20 &its 0x62 0x1>, //ENETC0 VF1
+                                         <0x40 &its 0x63 0x1>, //ENETC1 PF
+                                         <0x80 &its 0x64 0x1>, //ENETC2 PF
+                                         <0x90 &its 0x65 0x1>, //ENETC2 VF0
+                                         <0xa0 &its 0x66 0x1>, //ENETC2 VF1
+                                         <0xc0 &its 0x67 0x1>; //NETC Timer
+                                        /* ENETC0~2 and Timer BAR0 - non-prefetchable memory */
+                               ranges = <0x82000000 0x0 0x4cc00000  0x0 0x4cc00000  0x0 0xe0000
+                                        /* Timer BAR2 - prefetchable memory */
+                                        0xc2000000 0x0 0x4cd00000  0x0 0x4cd00000  0x0 0x10000
+                                        /* ENETC0~2: VF0-1 BAR0 - non-prefetchable memory */
+                                        0x82000000 0x0 0x4cd20000  0x0 0x4cd20000  0x0 0x60000
+                                        /* ENETC0~2: VF0-1 BAR2 - prefetchable memory */
+                                        0xc2000000 0x0 0x4cd80000  0x0 0x4cd80000  0x0 0x60000>;
+
+                               enetc_port0: ethernet@0,0 {
+                                       compatible = "pci1131,e101";
+                                       reg = <0x000000 0 0 0 0>;
+                                       clocks = <&scmi_clk IMX95_CLK_ENETREF>;
+                                       clock-names = "ref";
+                                       status = "disabled";
+                               };
+
+                               enetc_port1: ethernet@8,0 {
+                                       compatible = "pci1131,e101";
+                                       reg = <0x004000 0 0 0 0>;
+                                       clocks = <&scmi_clk IMX95_CLK_ENETREF>;
+                                       clock-names = "ref";
+                                       status = "disabled";
+                               };
+
+                               enetc_port2: ethernet@10,0 {
+                                       compatible = "pci1131,e101";
+                                       reg = <0x008000 0 0 0 0>;
+                                       status = "disabled";
+                               };
+                       };
+
+                       pcie_4cb00000: pcie@4cb00000 {
+                               compatible = "pci-host-ecam-generic";
+                               reg = <0x0 0x4cb00000 0x0 0x100000>;
+                               #address-cells = <3>;
+                               #size-cells = <2>;
+                               device_type = "pci";
+                               bus-range = <0x1 0x1>;
+                                        /* EMDIO BAR0 - non-prefetchable memory */
+                               ranges = <0x82000000 0x0 0x4cce0000  0x0 0x4cce0000  0x0 0x20000
+                                        /* EMDIO BAR2 - prefetchable memory */
+                                        0xc2000000 0x0 0x4cd10000  0x0 0x4cd10000  0x0 0x10000>;
+
+                               netc_emdio: mdio@0,0 {
+                                       compatible = "pci1131,ee00";
+                                       reg = <0x010000 0 0 0 0>;
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+                                       status = "disabled";
+                               };
+                       };
+               };
        };
 };
Alexander Stein Oct. 18, 2024, 11:39 a.m. UTC | #5
Hi,

Am Freitag, 18. Oktober 2024, 09:50:43 CEST schrieb Wei Fang:
> > -----Original Message-----
> > From: Alexander Stein <alexander.stein@ew.tq-group.com>
> > Sent: 2024年10月18日 14:53
> > To: Frank Li <frank.li@nxp.com>; Wei Fang <wei.fang@nxp.com>
> > Cc: davem@davemloft.net; edumazet@google.com; kuba@kernel.org;
> > pabeni@redhat.com; robh@kernel.org; krzk+dt@kernel.org;
> > conor+dt@kernel.org; Vladimir Oltean <vladimir.oltean@nxp.com>; Claudiu
> > Manoil <claudiu.manoil@nxp.com>; Clark Wang <xiaoning.wang@nxp.com>;
> > christophe.leroy@csgroup.eu; linux@armlinux.org.uk; bhelgaas@google.com;
> > horms@kernel.org; imx@lists.linux.dev; netdev@vger.kernel.org;
> > devicetree@vger.kernel.org; linux-kernel@vger.kernel.org;
> > linux-pci@vger.kernel.org
> > Subject: Re: [PATCH v3 net-next 02/13] dt-bindings: net: add i.MX95 ENETC
> > support
> > 
> > Hi,
> > 
> > Am Freitag, 18. Oktober 2024, 03:20:55 CEST schrieb Wei Fang:
> > > > -----Original Message-----
> > > > From: Frank Li <frank.li@nxp.com>
> > > > Sent: 2024年10月18日 0:23
> > > > To: Wei Fang <wei.fang@nxp.com>
> > > > Cc: davem@davemloft.net; edumazet@google.com; kuba@kernel.org;
> > > > pabeni@redhat.com; robh@kernel.org; krzk+dt@kernel.org;
> > > > conor+dt@kernel.org; Vladimir Oltean <vladimir.oltean@nxp.com>;
> > > > conor+Claudiu
> > > > Manoil <claudiu.manoil@nxp.com>; Clark Wang
> > <xiaoning.wang@nxp.com>;
> > > > christophe.leroy@csgroup.eu; linux@armlinux.org.uk;
> > > > bhelgaas@google.com; horms@kernel.org; imx@lists.linux.dev;
> > > > netdev@vger.kernel.org; devicetree@vger.kernel.org;
> > > > linux-kernel@vger.kernel.org; linux-pci@vger.kernel.org
> > > > Subject: Re: [PATCH v3 net-next 02/13] dt-bindings: net: add i.MX95
> > > > ENETC support
> > > >
> > > > On Thu, Oct 17, 2024 at 03:46:26PM +0800, Wei Fang wrote:
> > > > > The ENETC of i.MX95 has been upgraded to revision 4.1, and the
> > > > > vendor ID and device ID have also changed, so add the new
> > > > > compatible strings for i.MX95 ENETC. In addition, i.MX95 supports
> > > > > configuration of RGMII or RMII reference clock.
> > > > >
> > > > > Signed-off-by: Wei Fang <wei.fang@nxp.com>
> > > > > ---
> > > > > v2: Remove "nxp,imx95-enetc" compatible string.
> > > > > v3:
> > > > > 1. Add restriction to "clcoks" and "clock-names" properties and
> > > > > rename the clock, also remove the items from these two properties.
> > > > > 2. Remove unnecessary items for "pci1131,e101" compatible string.
> > > > > ---
> > > > >  .../devicetree/bindings/net/fsl,enetc.yaml    | 22
> > ++++++++++++++++---
> > > > >  1 file changed, 19 insertions(+), 3 deletions(-)
> > > > >
> > > > > diff --git a/Documentation/devicetree/bindings/net/fsl,enetc.yaml
> > > > > b/Documentation/devicetree/bindings/net/fsl,enetc.yaml
> > > > > index e152c93998fe..e418c3e6e6b1 100644
> > > > > --- a/Documentation/devicetree/bindings/net/fsl,enetc.yaml
> > > > > +++ b/Documentation/devicetree/bindings/net/fsl,enetc.yaml
> > > > > @@ -20,10 +20,13 @@ maintainers:
> > > > >
> > > > >  properties:
> > > > >    compatible:
> > > > > -    items:
> > > > > +    oneOf:
> > > > > +      - items:
> > > > > +          - enum:
> > > > > +              - pci1957,e100
> > > > > +          - const: fsl,enetc
> > > > >        - enum:
> > > > > -          - pci1957,e100
> > > > > -      - const: fsl,enetc
> > > > > +          - pci1131,e101
> > > > >
> > > > >    reg:
> > > > >      maxItems: 1
> > > > > @@ -40,6 +43,19 @@ required:
> > > > >  allOf:
> > > > >    - $ref: /schemas/pci/pci-device.yaml
> > > > >    - $ref: ethernet-controller.yaml
> > > > > +  - if:
> > > > > +      properties:
> > > > > +        compatible:
> > > > > +          contains:
> > > > > +            enum:
> > > > > +              - pci1131,e101
> > > > > +    then:
> > > > > +      properties:
> > > > > +        clocks:
> > > > > +          maxItems: 1
> > > > > +          description: MAC transmit/receiver reference clock
> > > > > +        clock-names:
> > > > > +          const: ref
> > > >
> > > > Did you run CHECK_DTBS for your dts file? clocks\clock-names should
> > > > be under top 'properties" firstly. Then use 'if' restrict it. But I
> > > > am not sure for that. only dt_binding_check is not enough because
> > > > your example have not use clocks and clok-names.
> > > >
> > >
> > > I have run dtbs_check and dt_binding_check in my local env. there were
> > > no warnings and errors.
> > 
> > Is there already the DT part somewhere? Do you mind sharing it?
> > 
> I will prepare the DT patch when this series is applied. Below is my local
> patch of imx95.dtsi. FYI.
> > [snip]

Thanks for providing the DT patch. With this I was able to get ethernet
running on my i.MX95 based board.
Please keep me on CC if you send DT patch. Thanks.

Best regards,
Alexander
Rob Herring Oct. 18, 2024, 1:09 p.m. UTC | #6
On Thu, Oct 17, 2024 at 12:23:05PM -0400, Frank Li wrote:
> On Thu, Oct 17, 2024 at 03:46:26PM +0800, Wei Fang wrote:
> > The ENETC of i.MX95 has been upgraded to revision 4.1, and the vendor
> > ID and device ID have also changed, so add the new compatible strings
> > for i.MX95 ENETC. In addition, i.MX95 supports configuration of RGMII
> > or RMII reference clock.
> >
> > Signed-off-by: Wei Fang <wei.fang@nxp.com>
> > ---
> > v2: Remove "nxp,imx95-enetc" compatible string.
> > v3:
> > 1. Add restriction to "clcoks" and "clock-names" properties and rename
> > the clock, also remove the items from these two properties.
> > 2. Remove unnecessary items for "pci1131,e101" compatible string.
> > ---
> >  .../devicetree/bindings/net/fsl,enetc.yaml    | 22 ++++++++++++++++---
> >  1 file changed, 19 insertions(+), 3 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/net/fsl,enetc.yaml b/Documentation/devicetree/bindings/net/fsl,enetc.yaml
> > index e152c93998fe..e418c3e6e6b1 100644
> > --- a/Documentation/devicetree/bindings/net/fsl,enetc.yaml
> > +++ b/Documentation/devicetree/bindings/net/fsl,enetc.yaml
> > @@ -20,10 +20,13 @@ maintainers:
> >
> >  properties:
> >    compatible:
> > -    items:
> > +    oneOf:
> > +      - items:
> > +          - enum:
> > +              - pci1957,e100
> > +          - const: fsl,enetc
> >        - enum:
> > -          - pci1957,e100
> > -      - const: fsl,enetc
> > +          - pci1131,e101
> >
> >    reg:
> >      maxItems: 1
> > @@ -40,6 +43,19 @@ required:
> >  allOf:
> >    - $ref: /schemas/pci/pci-device.yaml
> >    - $ref: ethernet-controller.yaml
> > +  - if:
> > +      properties:
> > +        compatible:
> > +          contains:
> > +            enum:
> > +              - pci1131,e101
> > +    then:
> > +      properties:
> > +        clocks:
> > +          maxItems: 1
> > +          description: MAC transmit/receiver reference clock
> > +        clock-names:
> > +          const: ref
> 
> Did you run CHECK_DTBS for your dts file? clocks\clock-names should be
> under top 'properties" firstly. Then use 'if' restrict it. But I am not
> sure for that. only dt_binding_check is not enough because your example
> have not use clocks and clok-names.

That's a manual check, but yes. Define all properties at top level.

Rob
Wei Fang Oct. 19, 2024, 9:58 a.m. UTC | #7
> > > Is there already the DT part somewhere? Do you mind sharing it?
> > >
> > I will prepare the DT patch when this series is applied. Below is my
> > local patch of imx95.dtsi. FYI.
> > > [snip]
> 
> Thanks for providing the DT patch. With this I was able to get ethernet running
> on my i.MX95 based board.
> Please keep me on CC if you send DT patch. Thanks.
> 

Okay, I will.
Wei Fang Oct. 19, 2024, 9:58 a.m. UTC | #8
> -----Original Message-----
> From: Rob Herring <robh@kernel.org>
> Sent: 2024年10月18日 21:09
> To: Frank Li <frank.li@nxp.com>
> Cc: Wei Fang <wei.fang@nxp.com>; davem@davemloft.net;
> edumazet@google.com; kuba@kernel.org; pabeni@redhat.com;
> krzk+dt@kernel.org; conor+dt@kernel.org; Vladimir Oltean
> <vladimir.oltean@nxp.com>; Claudiu Manoil <claudiu.manoil@nxp.com>;
> Clark Wang <xiaoning.wang@nxp.com>; christophe.leroy@csgroup.eu;
> linux@armlinux.org.uk; bhelgaas@google.com; horms@kernel.org;
> imx@lists.linux.dev; netdev@vger.kernel.org; devicetree@vger.kernel.org;
> linux-kernel@vger.kernel.org; linux-pci@vger.kernel.org
> Subject: Re: [PATCH v3 net-next 02/13] dt-bindings: net: add i.MX95 ENETC
> support
> 
> On Thu, Oct 17, 2024 at 12:23:05PM -0400, Frank Li wrote:
> > On Thu, Oct 17, 2024 at 03:46:26PM +0800, Wei Fang wrote:
> > > The ENETC of i.MX95 has been upgraded to revision 4.1, and the
> > > vendor ID and device ID have also changed, so add the new compatible
> > > strings for i.MX95 ENETC. In addition, i.MX95 supports configuration
> > > of RGMII or RMII reference clock.
> > >
> > > Signed-off-by: Wei Fang <wei.fang@nxp.com>
> > > ---
> > > v2: Remove "nxp,imx95-enetc" compatible string.
> > > v3:
> > > 1. Add restriction to "clcoks" and "clock-names" properties and
> > > rename the clock, also remove the items from these two properties.
> > > 2. Remove unnecessary items for "pci1131,e101" compatible string.
> > > ---
> > >  .../devicetree/bindings/net/fsl,enetc.yaml    | 22 ++++++++++++++++---
> > >  1 file changed, 19 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/Documentation/devicetree/bindings/net/fsl,enetc.yaml
> > > b/Documentation/devicetree/bindings/net/fsl,enetc.yaml
> > > index e152c93998fe..e418c3e6e6b1 100644
> > > --- a/Documentation/devicetree/bindings/net/fsl,enetc.yaml
> > > +++ b/Documentation/devicetree/bindings/net/fsl,enetc.yaml
> > > @@ -20,10 +20,13 @@ maintainers:
> > >
> > >  properties:
> > >    compatible:
> > > -    items:
> > > +    oneOf:
> > > +      - items:
> > > +          - enum:
> > > +              - pci1957,e100
> > > +          - const: fsl,enetc
> > >        - enum:
> > > -          - pci1957,e100
> > > -      - const: fsl,enetc
> > > +          - pci1131,e101
> > >
> > >    reg:
> > >      maxItems: 1
> > > @@ -40,6 +43,19 @@ required:
> > >  allOf:
> > >    - $ref: /schemas/pci/pci-device.yaml
> > >    - $ref: ethernet-controller.yaml
> > > +  - if:
> > > +      properties:
> > > +        compatible:
> > > +          contains:
> > > +            enum:
> > > +              - pci1131,e101
> > > +    then:
> > > +      properties:
> > > +        clocks:
> > > +          maxItems: 1
> > > +          description: MAC transmit/receiver reference clock
> > > +        clock-names:
> > > +          const: ref
> >
> > Did you run CHECK_DTBS for your dts file? clocks\clock-names should be
> > under top 'properties" firstly. Then use 'if' restrict it. But I am
> > not sure for that. only dt_binding_check is not enough because your
> > example have not use clocks and clok-names.
> 
> That's a manual check, but yes. Define all properties at top level.
> 

Okay, I will move them to top level, thanks.
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/fsl,enetc.yaml b/Documentation/devicetree/bindings/net/fsl,enetc.yaml
index e152c93998fe..e418c3e6e6b1 100644
--- a/Documentation/devicetree/bindings/net/fsl,enetc.yaml
+++ b/Documentation/devicetree/bindings/net/fsl,enetc.yaml
@@ -20,10 +20,13 @@  maintainers:
 
 properties:
   compatible:
-    items:
+    oneOf:
+      - items:
+          - enum:
+              - pci1957,e100
+          - const: fsl,enetc
       - enum:
-          - pci1957,e100
-      - const: fsl,enetc
+          - pci1131,e101
 
   reg:
     maxItems: 1
@@ -40,6 +43,19 @@  required:
 allOf:
   - $ref: /schemas/pci/pci-device.yaml
   - $ref: ethernet-controller.yaml
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - pci1131,e101
+    then:
+      properties:
+        clocks:
+          maxItems: 1
+          description: MAC transmit/receiver reference clock
+        clock-names:
+          const: ref
 
 unevaluatedProperties: false