diff mbox series

[v4,2/4] dt-bindings: net: Add Loongson-1 Ethernet Controller

Message ID 20230830134241.506464-3-keguang.zhang@gmail.com (mailing list archive)
State Superseded
Headers show
Series Move Loongson1 MAC arch-code to the driver dir | expand

Commit Message

Keguang Zhang Aug. 30, 2023, 1:42 p.m. UTC
Add devicetree binding document for Loongson-1 Ethernet controller.

Signed-off-by: Keguang Zhang <keguang.zhang@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
V3 -> V4: Add "|" to description part
          Amend "phy-mode" property
V2 -> V3: Split the DT-schema file into loongson,ls1b-gmac.yaml
          and loongson,ls1c-emac.yaml (suggested by Serge Semin)
          Change the compatibles to loongson,ls1b-gmac and loongson,ls1c-emac
          Rename loongson,dwmac-syscon to loongson,ls1-syscon
          Amend the title
          Add description
          Add Reviewed-by tag from Krzysztof Kozlowski(Sorry! I'm not sure)
V1 -> V2: Fix "clock-names" and "interrupt-names" property
          Rename the syscon property to "loongson,dwmac-syscon"
          Drop "phy-handle" and "phy-mode" requirement
          Revert adding loongson,ls1b-dwmac/loongson,ls1c-dwmac
          to snps,dwmac.yaml

 .../bindings/net/loongson,ls1b-gmac.yaml      | 114 ++++++++++++++++++
 .../bindings/net/loongson,ls1c-emac.yaml      | 113 +++++++++++++++++
 2 files changed, 227 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/loongson,ls1b-gmac.yaml
 create mode 100644 Documentation/devicetree/bindings/net/loongson,ls1c-emac.yaml

Comments

Philippe Mathieu-Daudé Sept. 11, 2023, 10:47 a.m. UTC | #1
On 30/8/23 15:42, Keguang Zhang wrote:
> Add devicetree binding document for Loongson-1 Ethernet controller.
> 
> Signed-off-by: Keguang Zhang <keguang.zhang@gmail.com>
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
> V3 -> V4: Add "|" to description part
>            Amend "phy-mode" property
> V2 -> V3: Split the DT-schema file into loongson,ls1b-gmac.yaml
>            and loongson,ls1c-emac.yaml (suggested by Serge Semin)
>            Change the compatibles to loongson,ls1b-gmac and loongson,ls1c-emac
>            Rename loongson,dwmac-syscon to loongson,ls1-syscon
>            Amend the title
>            Add description
>            Add Reviewed-by tag from Krzysztof Kozlowski(Sorry! I'm not sure)
> V1 -> V2: Fix "clock-names" and "interrupt-names" property
>            Rename the syscon property to "loongson,dwmac-syscon"
>            Drop "phy-handle" and "phy-mode" requirement
>            Revert adding loongson,ls1b-dwmac/loongson,ls1c-dwmac
>            to snps,dwmac.yaml
> 
>   .../bindings/net/loongson,ls1b-gmac.yaml      | 114 ++++++++++++++++++
>   .../bindings/net/loongson,ls1c-emac.yaml      | 113 +++++++++++++++++
>   2 files changed, 227 insertions(+)
>   create mode 100644 Documentation/devicetree/bindings/net/loongson,ls1b-gmac.yaml
>   create mode 100644 Documentation/devicetree/bindings/net/loongson,ls1c-emac.yaml

Squash:

-- >8 --
diff --git a/MAINTAINERS b/MAINTAINERS
index ff1f273b4f36..2519d06b5aab 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -14344,9 +14344,12 @@ MIPS/LOONGSON1 ARCHITECTURE
  M:	Keguang Zhang <keguang.zhang@gmail.com>
  L:	linux-mips@vger.kernel.org
  S:	Maintained
+F:	Documentation/devicetree/bindings/*/loongson,ls1x-*.yaml
+F:	Documentation/devicetree/bindings/net/loongson,ls1*.yaml
  F:	arch/mips/include/asm/mach-loongson32/
  F:	arch/mips/loongson32/
  F:	drivers/*/*loongson1*
---
Keguang Zhang Sept. 12, 2023, 2 a.m. UTC | #2
On Mon, Sep 11, 2023 at 6:47 PM Philippe Mathieu-Daudé
<philmd@linaro.org> wrote:
>
> On 30/8/23 15:42, Keguang Zhang wrote:
> > Add devicetree binding document for Loongson-1 Ethernet controller.
> >
> > Signed-off-by: Keguang Zhang <keguang.zhang@gmail.com>
> > Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > ---
> > V3 -> V4: Add "|" to description part
> >            Amend "phy-mode" property
> > V2 -> V3: Split the DT-schema file into loongson,ls1b-gmac.yaml
> >            and loongson,ls1c-emac.yaml (suggested by Serge Semin)
> >            Change the compatibles to loongson,ls1b-gmac and loongson,ls1c-emac
> >            Rename loongson,dwmac-syscon to loongson,ls1-syscon
> >            Amend the title
> >            Add description
> >            Add Reviewed-by tag from Krzysztof Kozlowski(Sorry! I'm not sure)
> > V1 -> V2: Fix "clock-names" and "interrupt-names" property
> >            Rename the syscon property to "loongson,dwmac-syscon"
> >            Drop "phy-handle" and "phy-mode" requirement
> >            Revert adding loongson,ls1b-dwmac/loongson,ls1c-dwmac
> >            to snps,dwmac.yaml
> >
> >   .../bindings/net/loongson,ls1b-gmac.yaml      | 114 ++++++++++++++++++
> >   .../bindings/net/loongson,ls1c-emac.yaml      | 113 +++++++++++++++++
> >   2 files changed, 227 insertions(+)
> >   create mode 100644 Documentation/devicetree/bindings/net/loongson,ls1b-gmac.yaml
> >   create mode 100644 Documentation/devicetree/bindings/net/loongson,ls1c-emac.yaml
>
> Squash:
>
> -- >8 --
> diff --git a/MAINTAINERS b/MAINTAINERS
> index ff1f273b4f36..2519d06b5aab 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -14344,9 +14344,12 @@ MIPS/LOONGSON1 ARCHITECTURE
>   M:    Keguang Zhang <keguang.zhang@gmail.com>
>   L:    linux-mips@vger.kernel.org
>   S:    Maintained
> +F:     Documentation/devicetree/bindings/*/loongson,ls1x-*.yaml
> +F:     Documentation/devicetree/bindings/net/loongson,ls1*.yaml
>   F:    arch/mips/include/asm/mach-loongson32/
>   F:    arch/mips/loongson32/
>   F:    drivers/*/*loongson1*
> ---

Will do.
Thanks!
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/loongson,ls1b-gmac.yaml b/Documentation/devicetree/bindings/net/loongson,ls1b-gmac.yaml
new file mode 100644
index 000000000000..c4f3224bad38
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/loongson,ls1b-gmac.yaml
@@ -0,0 +1,114 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/loongson,ls1b-gmac.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Loongson-1B Gigabit Ethernet MAC Controller
+
+maintainers:
+  - Keguang Zhang <keguang.zhang@gmail.com>
+
+description: |
+  Loongson-1B Gigabit Ethernet MAC Controller is based on
+  Synopsys DesignWare MAC (version 3.50a).
+
+  Main features
+  - Dual 10/100/1000Mbps GMAC controllers
+  - Full-duplex operation (IEEE 802.3x flow control automatic transmission)
+  - Half-duplex operation (CSMA/CD Protocol and back-pressure support)
+  - RX Checksum Offload
+  - TX Checksum insertion
+  - MII interface
+  - RGMII interface
+
+select:
+  properties:
+    compatible:
+      contains:
+        enum:
+          - loongson,ls1b-gmac
+  required:
+    - compatible
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - loongson,ls1b-gmac
+      - const: snps,dwmac-3.50a
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    items:
+      - const: stmmaceth
+
+  interrupts:
+    maxItems: 1
+
+  interrupt-names:
+    items:
+      - const: macirq
+
+  loongson,ls1-syscon:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description:
+      Phandle to the syscon containing some extra configurations
+      including PHY interface mode.
+
+  phy-mode:
+    enum:
+      - mii
+      - rgmii-id
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - interrupts
+  - interrupt-names
+  - loongson,ls1-syscon
+
+allOf:
+  - $ref: snps,dwmac.yaml#
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/loongson,ls1x-clk.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    gmac0: ethernet@1fe10000 {
+        compatible = "loongson,ls1b-gmac", "snps,dwmac-3.50a";
+        reg = <0x1fe10000 0x10000>;
+
+        clocks = <&clkc LS1X_CLKID_AHB>;
+        clock-names = "stmmaceth";
+
+        interrupt-parent = <&intc1>;
+        interrupts = <2 IRQ_TYPE_LEVEL_HIGH>;
+        interrupt-names = "macirq";
+
+        loongson,ls1-syscon = <&syscon>;
+
+        phy-handle = <&phy0>;
+        phy-mode = "mii";
+        snps,pbl = <1>;
+
+        mdio {
+            #address-cells = <1>;
+            #size-cells = <0>;
+            compatible = "snps,dwmac-mdio";
+
+            phy0: ethernet-phy@0 {
+                reg = <0x0>;
+            };
+        };
+    };
diff --git a/Documentation/devicetree/bindings/net/loongson,ls1c-emac.yaml b/Documentation/devicetree/bindings/net/loongson,ls1c-emac.yaml
new file mode 100644
index 000000000000..99001b940b83
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/loongson,ls1c-emac.yaml
@@ -0,0 +1,113 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/loongson,ls1c-emac.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Loongson-1C Ethernet MAC Controller
+
+maintainers:
+  - Keguang Zhang <keguang.zhang@gmail.com>
+
+description: |
+  Loongson-1C Ethernet MAC Controller is based on
+  Synopsys DesignWare MAC (version 3.50a).
+
+  Main features
+  - 10/100Mbps
+  - Full-duplex operation (IEEE 802.3x flow control automatic transmission)
+  - Half-duplex operation (CSMA/CD Protocol and back-pressure support)
+  - IEEE 802.1Q VLAN tag detection for reception frames
+  - MII interface
+  - RMII interface
+
+select:
+  properties:
+    compatible:
+      contains:
+        enum:
+          - loongson,ls1c-emac
+  required:
+    - compatible
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - loongson,ls1c-emac
+      - const: snps,dwmac-3.50a
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    items:
+      - const: stmmaceth
+
+  interrupts:
+    maxItems: 1
+
+  interrupt-names:
+    items:
+      - const: macirq
+
+  loongson,ls1-syscon:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description:
+      Phandle to the syscon containing some extra configurations
+      including PHY interface mode.
+
+  phy-mode:
+    enum:
+      - mii
+      - rmii
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - interrupts
+  - interrupt-names
+  - loongson,ls1-syscon
+
+allOf:
+  - $ref: snps,dwmac.yaml#
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/loongson,ls1x-clk.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    emac: ethernet@1fe10000 {
+        compatible = "loongson,ls1c-emac", "snps,dwmac-3.50a";
+        reg = <0x1fe10000 0x10000>;
+
+        clocks = <&clkc LS1X_CLKID_AHB>;
+        clock-names = "stmmaceth";
+
+        interrupt-parent = <&intc1>;
+        interrupts = <2 IRQ_TYPE_LEVEL_HIGH>;
+        interrupt-names = "macirq";
+
+        loongson,ls1-syscon = <&syscon>;
+
+        phy-handle = <&phy0>;
+        phy-mode = "mii";
+        snps,pbl = <1>;
+
+        mdio {
+            #address-cells = <1>;
+            #size-cells = <0>;
+            compatible = "snps,dwmac-mdio";
+
+            phy0: ethernet-phy@13 {
+                reg = <0x13>;
+            };
+        };
+    };