dt-bindings: net: Add dwmac-starfive bindings
authorEmil Renner Berthing <kernel@esmil.dk>
Mon, 8 Aug 2022 15:15:17 +0000 (17:15 +0200)
committerŁukasz Stelmach <l.stelmach@samsung.com>
Thu, 9 Feb 2023 19:07:48 +0000 (20:07 +0100)
Add bindings for the DWMAC glue layer for the StarFive JH71x0 SoCs.

Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Documentation/devicetree/bindings/net/dwmac-starfive.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/net/snps,dwmac.yaml

diff --git a/Documentation/devicetree/bindings/net/dwmac-starfive.yaml b/Documentation/devicetree/bindings/net/dwmac-starfive.yaml
new file mode 100644 (file)
index 0000000..4826895
--- /dev/null
@@ -0,0 +1,119 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+# Copyright 2022 Emil Renner Berthing
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/net/dwmac-starfive.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: StarFive JH71x0 DWMAC glue layer
+
+maintainers:
+  - Emil Renner Berthing <kernel@esmil.dk>
+
+description:
+  This file documents the platform glue layer for using the stmmac driver on
+  the StarFive JH71x0 RISC-V SoCs.
+
+select:
+  properties:
+    compatible:
+      contains:
+        enum:
+          - starfive,jh7100-gmac
+          - starfive,jh7110-gmac
+  required:
+    - compatible
+
+allOf:
+  - $ref: "snps,dwmac.yaml#"
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+          - const: starfive,jh7100-gmac
+          - const: snps,dwmac
+      - items:
+          - const: starfive,jh7110-gmac
+          - const: snps,dwmac-5.20
+
+  reg: true
+
+  clocks:
+    minItems: 4
+    items:
+      - description: GMAC main clock
+      - description: GMAC AHB clock
+      - description: PTP clock
+      - description: GTX clock
+      - description: TX clock
+
+  clock-names:
+    minItems: 4
+    maxItems: 5
+    contains:
+      enum:
+        - stmmaceth
+        - pclk
+        - ptp_ref
+        - gtxc
+        - tx
+
+  starfive,syscon:
+    $ref: "/schemas/types.yaml#/definitions/phandle"
+    description: phandle to the syscon node
+
+  starfive,gtxclk-dlychain:
+    $ref: '/schemas/types.yaml#/definitions/uint32'
+    description: GTX clock delay chain setting
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - resets
+  - reset-names
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/starfive-jh7110-sys.h>
+    #include <dt-bindings/clock/starfive-jh7110-aon.h>
+    #include <dt-bindings/reset/starfive-jh7110-sys.h>
+    #include <dt-bindings/reset/starfive-jh7110-aon.h>
+
+    gmac0: ethernet@16030000 {
+        compatible = "starfive,jh7110-gmac", "snps,dwmac-5.20";
+        reg = <0x16030000 0x10000>;
+        clocks = <&aoncrg JH7110_AONCLK_GMAC0_AXI>,
+                 <&aoncrg JH7110_AONCLK_GMAC0_AHB>,
+                 <&syscrg JH7110_SYSCLK_GMAC0_PTP>,
+                 <&syscrg JH7110_SYSCLK_GMAC0_GTXC>,
+                 <&aoncrg JH7110_AONCLK_GMAC0_TX_INV>;
+        clock-names = "stmmaceth", "pclk", "ptp_ref",
+                      "gtxc", "tx";
+        resets = <&aoncrg JH7110_AONRST_GMAC0_AXI>;
+        reset-names = "stmmaceth";
+        interrupts = <7>, <6>, <5>;
+        interrupt-names = "macirq", "eth_wake_irq", "eth_lpi";
+        max-frame-size = <9000>;
+        phy-mode = "rgmii-id";
+        snps,multicast-filter-bins = <64>;
+        snps,perfect-filter-entries = <128>;
+        rx-fifo-depth = <2048>;
+        tx-fifo-depth = <2048>;
+        snps,fixed-burst;
+        snps,no-pbl-x8;
+        snps,force_thresh_dma_mode;
+        snps,axi-config = <&stmmac_axi_setup>;
+        snps,tso;
+        snps,en-tx-lpi-clockgating;
+        snps,en-lpi;
+        snps,write-requests = <4>;
+        snps,read-requests = <4>;
+        snps,burst-map = <0x7>;
+        snps,txpbl = <16>;
+        snps,rxpbl = <16>;
+    };
index d8779d3..ee32081 100644 (file)
@@ -90,6 +90,8 @@ properties:
         - snps,dwmac-5.10a
         - snps,dwxgmac
         - snps,dwxgmac-2.10
+        - starfive,jh7100-gmac
+        - starfive,jh7110-gmac
 
   reg:
     minItems: 1