diff mbox series

[1/2] dt-bindings: net: Add bindings for Intel Keem Bay

Message ID 1594097238-8827-2-git-send-email-vineetha.g.jaya.kumaran@intel.com
State Changes Requested
Headers show
Series Add Ethernet support for Intel Keem Bay SoC | expand

Checks

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

Commit Message

G Jaya Kumaran, Vineetha July 7, 2020, 4:47 a.m. UTC
From: "Vineetha G. Jaya Kumaran" <vineetha.g.jaya.kumaran@intel.com>

Add Device Tree bindings documentation for the ethernet controller
on Intel Keem Bay.

Signed-off-by: Vineetha G. Jaya Kumaran <vineetha.g.jaya.kumaran@intel.com>
---
 .../devicetree/bindings/net/intel,dwmac-plat.yaml  | 123 +++++++++++++++++++++
 1 file changed, 123 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml

Comments

Andrew Lunn July 7, 2020, 1:07 p.m. UTC | #1
> +        mdio0 {
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +            compatible = "snps,dwmac-mdio";
> +
> +            ethernet-phy@0 {
> +                compatible = "ethernet-phy-id0141.0dd0",
> +                              "ethernet-phy-ieee802.3-c22";

You only need to provide the phy-id when the PHY is broken and
registers 2 and 3 don't contain a valid ID. And c22 is the default, so
also not needed. The Marvell 88E1510 will work without these
compatible strings.

	   Andrew
G Jaya Kumaran, Vineetha July 9, 2020, 2:40 p.m. UTC | #2
> -----Original Message-----
> From: Andrew Lunn <andrew@lunn.ch>
> Sent: Tuesday, July 7, 2020 9:08 PM
> To: G Jaya Kumaran, Vineetha <vineetha.g.jaya.kumaran@intel.com>
> Cc: davem@davemloft.net; kuba@kernel.org; mcoquelin.stm32@gmail.com;
> robh+dt@kernel.org; netdev@vger.kernel.org; devicetree@vger.kernel.org;
> Voon, Weifeng <weifeng.voon@intel.com>; Kweh, Hock Leong
> <hock.leong.kweh@intel.com>; Ong, Boon Leong <boon.leong.ong@intel.com>
> Subject: Re: [PATCH 1/2] dt-bindings: net: Add bindings for Intel Keem Bay
> 
> > +        mdio0 {
> > +            #address-cells = <1>;
> > +            #size-cells = <0>;
> > +            compatible = "snps,dwmac-mdio";
> > +
> > +            ethernet-phy@0 {
> > +                compatible = "ethernet-phy-id0141.0dd0",
> > +                              "ethernet-phy-ieee802.3-c22";
> 
> You only need to provide the phy-id when the PHY is broken and registers 2 and
> 3 don't contain a valid ID. And c22 is the default, so also not needed. The
> Marvell 88E1510 will work without these compatible strings.
> 
> 	   Andrew

Thanks Andrew, I will change this in v2.
Rob Herring July 9, 2020, 4:45 p.m. UTC | #3
On Tue, 07 Jul 2020 12:47:17 +0800, vineetha.g.jaya.kumaran@intel.com wrote:
> From: "Vineetha G. Jaya Kumaran" <vineetha.g.jaya.kumaran@intel.com>
> 
> Add Device Tree bindings documentation for the ethernet controller
> on Intel Keem Bay.
> 
> Signed-off-by: Vineetha G. Jaya Kumaran <vineetha.g.jaya.kumaran@intel.com>
> ---
>  .../devicetree/bindings/net/intel,dwmac-plat.yaml  | 123 +++++++++++++++++++++
>  1 file changed, 123 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml
> 


My bot found errors running 'make dt_binding_check' on your patch:

/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml: properties:clocks:maxItems: False schema does not allow 3
Documentation/devicetree/bindings/Makefile:20: recipe for target 'Documentation/devicetree/bindings/net/intel,dwmac-plat.example.dts' failed
make[1]: *** [Documentation/devicetree/bindings/net/intel,dwmac-plat.example.dts] Error 1
make[1]: *** Waiting for unfinished jobs....
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml: ignoring, error in schema: properties: clocks: maxItems
warning: no schema found in file: ./Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml: ignoring, error in schema: properties: clocks: maxItems
warning: no schema found in file: ./Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml
Makefile:1347: recipe for target 'dt_binding_check' failed
make: *** [dt_binding_check] Error 2


See https://patchwork.ozlabs.org/patch/1324088

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure dt-schema is up to date:

pip3 install git+https://github.com/devicetree-org/dt-schema.git@master --upgrade

Please check and re-submit.
G Jaya Kumaran, Vineetha July 10, 2020, 11:15 a.m. UTC | #4
> -----Original Message-----
> From: Rob Herring <robh@kernel.org>
> Sent: Friday, July 10, 2020 12:45 AM
> To: G Jaya Kumaran, Vineetha <vineetha.g.jaya.kumaran@intel.com>
> Cc: Ong, Boon Leong <boon.leong.ong@intel.com>; netdev@vger.kernel.org;
> devicetree@vger.kernel.org; mcoquelin.stm32@gmail.com;
> davem@davemloft.net; Voon, Weifeng <weifeng.voon@intel.com>; Kweh,
> Hock Leong <hock.leong.kweh@intel.com>; kuba@kernel.org;
> robh+dt@kernel.org
> Subject: Re: [PATCH 1/2] dt-bindings: net: Add bindings for Intel Keem Bay
> 
> On Tue, 07 Jul 2020 12:47:17 +0800, vineetha.g.jaya.kumaran@intel.com wrote:
> > From: "Vineetha G. Jaya Kumaran" <vineetha.g.jaya.kumaran@intel.com>
> >
> > Add Device Tree bindings documentation for the ethernet controller on
> > Intel Keem Bay.
> >
> > Signed-off-by: Vineetha G. Jaya Kumaran
> > <vineetha.g.jaya.kumaran@intel.com>
> > ---
> >  .../devicetree/bindings/net/intel,dwmac-plat.yaml  | 123
> > +++++++++++++++++++++
> >  1 file changed, 123 insertions(+)
> >  create mode 100644
> > Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml
> >
> 
> 
> My bot found errors running 'make dt_binding_check' on your patch:
> 
> /builds/robherring/linux-dt-
> review/Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml:
> properties:clocks:maxItems: False schema does not allow 3
> Documentation/devicetree/bindings/Makefile:20: recipe for target
> 'Documentation/devicetree/bindings/net/intel,dwmac-plat.example.dts' failed
> make[1]: *** [Documentation/devicetree/bindings/net/intel,dwmac-
> plat.example.dts] Error 1
> make[1]: *** Waiting for unfinished jobs....
> /builds/robherring/linux-dt-
> review/Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml:
> ignoring, error in schema: properties: clocks: maxItems
> warning: no schema found in file:
> ./Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml
> /builds/robherring/linux-dt-
> review/Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml:
> ignoring, error in schema: properties: clocks: maxItems
> warning: no schema found in file:
> ./Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml
> Makefile:1347: recipe for target 'dt_binding_check' failed
> make: *** [dt_binding_check] Error 2
> 
> 
> See https://patchwork.ozlabs.org/patch/1324088
> 
> If you already ran 'make dt_binding_check' and didn't see the above error(s),
> then make sure dt-schema is up to date:
> 
> pip3 install git+https://github.com/devicetree-org/dt-schema.git@master --
> upgrade
> 
> Please check and re-submit.

Thanks Rob,  I did run make dt_binding_check on my side but did not encounter any errors. 
Will update and check before resubmitting.
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml b/Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml
new file mode 100644
index 0000000..aef413b
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml
@@ -0,0 +1,123 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/intel,dwmac-plat.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Intel DWMAC glue layer Device Tree Bindings
+
+maintainers:
+  - Vineetha G. Jaya Kumaran <vineetha.g.jaya.kumaran@intel.com>
+
+allOf:
+  - $ref: "snps,dwmac.yaml#"
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+          - enum:
+              - intel,keembay-dwmac
+          - const: snps,dwmac-4.10a
+  clocks:
+    maxItems: 3
+    items:
+      - description: GMAC main clock
+      - description: PTP reference clock
+      - description: Tx clock
+
+  clock-names:
+    items:
+      - const: stmmaceth
+      - const: ptp_ref
+      - const: tx_clk
+
+required:
+  - compatible
+  - clocks
+  - clock-names
+
+examples:
+# FIXME: Remove defines and include the correct header file
+# once it is available in mainline.
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #define MOVISOC_KMB_PSS_GBE
+    #define MOVISOC_KMB_PSS_AUX_GBE_PTP
+    #define MOVISOC_KMB_PSS_AUX_GBE_TX
+
+    stmmac_axi_setup: stmmac-axi-config {
+        snps,lpi_en;
+        snps,wr_osr_lmt = <0x0>;
+        snps,rd_osr_lmt = <0x2>;
+        snps,blen = <0 0 0 0 16 8 4>;
+    };
+
+    mtl_rx_setup: rx-queues-config {
+        snps,rx-queues-to-use = <2>;
+        snps,rx-sched-sp;
+        queue0 {
+            snps,dcb-algorithm;
+            snps,map-to-dma-channel = <0x0>;
+            snps,priority = <0x0>;
+        };
+
+        queue1 {
+            snps,dcb-algorithm;
+            snps,map-to-dma-channel = <0x1>;
+            snps,priority = <0x1>;
+        };
+    };
+
+    mtl_tx_setup: tx-queues-config {
+        snps,tx-queues-to-use = <2>;
+        snps,tx-sched-wrr;
+        queue0 {
+           snps,weight = <0x10>;
+           snps,dcb-algorithm;
+           snps,priority = <0x0>;
+        };
+
+        queue1 {
+            snps,weight = <0x10>;
+            snps,dcb-algorithm;
+            snps,priority = <0x1>;
+        };
+    };
+
+    gmac0: ethernet@3a000000 {
+        compatible = "intel,keembay-dwmac", "snps,dwmac-4.10a";
+        interrupts = <GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH>;
+        interrupt-names = "macirq";
+        reg = <0x3a000000 0x8000>;
+        snps,perfect-filter-entries = <128>;
+        phy-handle = <&eth_phy0>;
+        phy-mode = "rgmii";
+        rx-fifo-depth = <4096>;
+        tx-fifo-depth = <4096>;
+        clock-names = "stmmaceth", "ptp_ref", "tx_clk";
+        clocks = <&scmi_clk MOVISOC_KMB_PSS_GBE>,
+                 <&scmi_clk MOVISOC_KMB_PSS_AUX_GBE_PTP>,
+                 <&scmi_clk MOVISOC_KMB_PSS_AUX_GBE_TX>;
+        snps,pbl = <0x4>;
+        snps,axi-config = <&stmmac_axi_setup>;
+        snps,mtl-rx-config = <&mtl_rx_setup>;
+        snps,mtl-tx-config = <&mtl_tx_setup>;
+        snps,tso;
+        status = "okay";
+
+        mdio0 {
+            #address-cells = <1>;
+            #size-cells = <0>;
+            compatible = "snps,dwmac-mdio";
+
+            ethernet-phy@0 {
+                compatible = "ethernet-phy-id0141.0dd0",
+                              "ethernet-phy-ieee802.3-c22";
+                reg = <0>;
+            };
+        };
+    };
+
+...