Add devicetree binding document for Loongson-1 DWMAC glue layer.
Signed-off-by: Keguang Zhang <keguang.zhang@gmail.com>
---
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,ls1x-dwmac.yaml | 98 +++++++++++++++++++
1 file changed, 98 insertions(+)
create mode 100644 Documentation/devicetree/bindings/net/loongson,ls1x-dwmac.yaml
diff --git a/Documentation/devicetree/bindings/net/loongson,ls1x-dwmac.yaml b/Documentation/devicetree/bindings/net/loongson,ls1x-dwmac.yaml
new file mode 100644
index 000000000000..cf5477450e29
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/loongson,ls1x-dwmac.yaml
@@ -0,0 +1,98 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/loongson,ls1x-dwmac.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Loongson-1 DWMAC glue layer
+
+maintainers:
+ - Keguang Zhang <keguang.zhang@gmail.com>
+
+select:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - loongson,ls1b-dwmac
+ - loongson,ls1c-dwmac
+ required:
+ - compatible
+
+properties:
+ compatible:
+ items:
+ - enum:
+ - loongson,ls1b-dwmac
+ - loongson,ls1c-dwmac
+ - 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,dwmac-syscon:
+ $ref: /schemas/types.yaml#/definitions/phandle
+ description:
+ Phandle to the syscon containing some extra configurations
+ including PHY interface mode.
+
+required:
+ - compatible
+ - reg
+ - clocks
+ - clock-names
+ - interrupts
+ - interrupt-names
+ - loongson,dwmac-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-dwmac", "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,dwmac-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>;
+ };
+ };
+ };
--
2.39.2
On 16/08/2023 13:13, Keguang Zhang wrote: > Add devicetree binding document for Loongson-1 DWMAC glue layer. > > Signed-off-by: Keguang Zhang <keguang.zhang@gmail.com> > --- > 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,ls1x-dwmac.yaml | 98 +++++++++++++++++++ > 1 file changed, 98 insertions(+) > create mode 100644 Documentation/devicetree/bindings/net/loongson,ls1x-dwmac.yaml > > diff --git a/Documentation/devicetree/bindings/net/loongson,ls1x-dwmac.yaml b/Documentation/devicetree/bindings/net/loongson,ls1x-dwmac.yaml > new file mode 100644 > index 000000000000..cf5477450e29 > --- /dev/null > +++ b/Documentation/devicetree/bindings/net/loongson,ls1x-dwmac.yaml > @@ -0,0 +1,98 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/net/loongson,ls1x-dwmac.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Loongson-1 DWMAC glue layer Please implement Serge's comments about title and description. Rest looks good: Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Best regards, Krzysztof
On Sat, Aug 19, 2023 at 10:26 PM Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > > On 16/08/2023 13:13, Keguang Zhang wrote: > > Add devicetree binding document for Loongson-1 DWMAC glue layer. > > > > Signed-off-by: Keguang Zhang <keguang.zhang@gmail.com> > > --- > > 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,ls1x-dwmac.yaml | 98 +++++++++++++++++++ > > 1 file changed, 98 insertions(+) > > create mode 100644 Documentation/devicetree/bindings/net/loongson,ls1x-dwmac.yaml > > > > diff --git a/Documentation/devicetree/bindings/net/loongson,ls1x-dwmac.yaml b/Documentation/devicetree/bindings/net/loongson,ls1x-dwmac.yaml > > new file mode 100644 > > index 000000000000..cf5477450e29 > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/net/loongson,ls1x-dwmac.yaml > > @@ -0,0 +1,98 @@ > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > > +%YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/net/loongson,ls1x-dwmac.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: Loongson-1 DWMAC glue layer > > Please implement Serge's comments about title and description. Rest > looks good: > Will do. > Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> > As suggested by Serge, this file will be split into loongson,ls1b-gmac.yaml and loongson,ls1c-mac.yaml. Due to this significant change, I'm not sure whether I should keep your Reviewed-by tag or not. Thanks! > Best regards, > Krzysztof > -- Best regards, Keguang Zhang
© 2016 - 2025 Red Hat, Inc.