diff mbox series

[net-next,4/6] dt-bindings: net: renesas,rzn1-gmac: Document RZ/N1 GMAC support

Message ID 20230116103926.276869-5-clement.leger@bootlin.com (mailing list archive)
State Superseded
Delegated to: Geert Uytterhoeven
Headers show
Series net: stmmac: add renesas,rzn1-gmac support | expand

Commit Message

Clément Léger Jan. 16, 2023, 10:39 a.m. UTC
Add "renesas,rzn1-gmac" binding documention which is compatible which
"snps,dwmac" compatible driver but uses a custom PCS to communicate
with the phy.

Signed-off-by: Clément Léger <clement.leger@bootlin.com>
---
 .../bindings/net/renesas,rzn1-gmac.yaml       | 71 +++++++++++++++++++
 1 file changed, 71 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/renesas,rzn1-gmac.yaml

Comments

Geert Uytterhoeven Jan. 16, 2023, 12:27 p.m. UTC | #1
Hi Clément,

Thanks for your patch!

On Mon, Jan 16, 2023 at 11:37 AM Clément Léger
<clement.leger@bootlin.com> wrote:
> Add "renesas,rzn1-gmac" binding documention which is compatible which

documentation

> "snps,dwmac" compatible driver but uses a custom PCS to communicate
> with the phy.
>
> Signed-off-by: Clément Léger <clement.leger@bootlin.com>
> ---
>  .../bindings/net/renesas,rzn1-gmac.yaml       | 71 +++++++++++++++++++
>  1 file changed, 71 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/net/renesas,rzn1-gmac.yaml
>
> diff --git a/Documentation/devicetree/bindings/net/renesas,rzn1-gmac.yaml b/Documentation/devicetree/bindings/net/renesas,rzn1-gmac.yaml
> new file mode 100644
> index 000000000000..effb9a312832
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/renesas,rzn1-gmac.yaml
> @@ -0,0 +1,71 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/renesas,rzn1-gmac.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Renesas GMAC1 Device Tree Bindings
> +
> +maintainers:
> +  - Clément Léger <clement.leger@bootlin.com>
> +
> +select:
> +  properties:
> +    compatible:
> +      contains:
> +        enum:
> +          - renesas,r9a06g032-gmac
> +          - renesas,rzn1-gmac
> +  required:
> +    - compatible
> +
> +allOf:
> +  - $ref: "snps,dwmac.yaml#"
> +
> +properties:
> +  compatible:
> +    additionalItems: true
> +    maxItems: 3
> +    items:
> +      - enum:
> +          - renesas,r9a06g032-gmac
> +          - renesas,rzn1-gmac
> +    contains:
> +      enum:
> +        - snps,dwmac

Why not just

    items:
      - enum:
          - renesas,r9a06g032-gmac
          - renesas,rzn1-gmac
          - snps,dwmac

?

> +examples:
> +  - |
> +    #include <dt-bindings/clock/r9a06g032-sysctrl.h>
> +    #include <dt-bindings/interrupt-controller/arm-gic.h>
> +
> +    ethernet@44000000 {
> +      compatible = "renesas,rzn1-gmac";

Documentation/devicetree/bindings/net/renesas,rzn1-gmac.example.dtb:
ethernet@44000000: compatible: ['renesas,rzn1-gmac'] does not contain
items matching the given schema

> +      reg = <0x44000000 0x2000>;
> +      interrupt-parent = <&gic>;
> +      interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>,
> +             <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>,
> +             <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>;
> +      interrupt-names = "macirq", "eth_wake_irq", "eth_lpi";
> +      clock-names = "stmmaceth";
> +      clocks = <&sysctrl R9A06G032_HCLK_GMAC0>;
> +      snps,multicast-filter-bins = <256>;
> +      snps,perfect-filter-entries = <128>;
> +      tx-fifo-depth = <2048>;
> +      rx-fifo-depth = <4096>;
> +      pcs-handle = <&mii_conv1>;
> +      phy-mode = "mii";
> +    };
> +
> +...

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Rob Herring Jan. 16, 2023, 4:36 p.m. UTC | #2
On Mon, 16 Jan 2023 11:39:24 +0100, Clément Léger wrote:
> Add "renesas,rzn1-gmac" binding documention which is compatible which
> "snps,dwmac" compatible driver but uses a custom PCS to communicate
> with the phy.
> 
> Signed-off-by: Clément Léger <clement.leger@bootlin.com>
> ---
>  .../bindings/net/renesas,rzn1-gmac.yaml       | 71 +++++++++++++++++++
>  1 file changed, 71 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/net/renesas,rzn1-gmac.yaml
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/renesas,rzn1-gmac.example.dtb: ethernet@44000000: compatible: ['renesas,rzn1-gmac'] does not contain items matching the given schema
	From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/renesas,rzn1-gmac.yaml

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20230116103926.276869-5-clement.leger@bootlin.com

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

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

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.
Krzysztof Kozlowski Jan. 22, 2023, 2:19 p.m. UTC | #3
On 16/01/2023 11:39, Clément Léger wrote:
> Add "renesas,rzn1-gmac" binding documention which is compatible which
> "snps,dwmac" compatible driver but uses a custom PCS to communicate
> with the phy.
> 
> Signed-off-by: Clément Léger <clement.leger@bootlin.com>
> ---
>  .../bindings/net/renesas,rzn1-gmac.yaml       | 71 +++++++++++++++++++
>  1 file changed, 71 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/net/renesas,rzn1-gmac.yaml
> 
> diff --git a/Documentation/devicetree/bindings/net/renesas,rzn1-gmac.yaml b/Documentation/devicetree/bindings/net/renesas,rzn1-gmac.yaml
> new file mode 100644
> index 000000000000..effb9a312832
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/renesas,rzn1-gmac.yaml
> @@ -0,0 +1,71 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/renesas,rzn1-gmac.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Renesas GMAC1 Device Tree Bindings

Drop Device Tree Bindings.

> +
> +maintainers:
> +  - Clément Léger <clement.leger@bootlin.com>
> +
> +select:
> +  properties:
> +    compatible:
> +      contains:
> +        enum:
> +          - renesas,r9a06g032-gmac
> +          - renesas,rzn1-gmac
> +  required:
> +    - compatible
> +
> +allOf:
> +  - $ref: "snps,dwmac.yaml#"

Drop quotes.

> +
> +properties:
> +  compatible:
> +    additionalItems: true

No. Drop.

> +    maxItems: 3

No.

> +    items:
> +      - enum:
> +          - renesas,r9a06g032-gmac
> +          - renesas,rzn1-gmac
> +    contains:
> +      enum:
> +        - snps,dwmac

No, please list possibilities

> +
> +  pcs-handle:
> +    description:
> +      phandle pointing to a PCS sub-node compatible with
> +      renesas,rzn1-miic.yaml#
> +    $ref: /schemas/types.yaml#/definitions/phandle
> +
> +required:
> +  - compatible
> +
> +unevaluatedProperties: false
> +

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/renesas,rzn1-gmac.yaml b/Documentation/devicetree/bindings/net/renesas,rzn1-gmac.yaml
new file mode 100644
index 000000000000..effb9a312832
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/renesas,rzn1-gmac.yaml
@@ -0,0 +1,71 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/renesas,rzn1-gmac.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Renesas GMAC1 Device Tree Bindings
+
+maintainers:
+  - Clément Léger <clement.leger@bootlin.com>
+
+select:
+  properties:
+    compatible:
+      contains:
+        enum:
+          - renesas,r9a06g032-gmac
+          - renesas,rzn1-gmac
+  required:
+    - compatible
+
+allOf:
+  - $ref: "snps,dwmac.yaml#"
+
+properties:
+  compatible:
+    additionalItems: true
+    maxItems: 3
+    items:
+      - enum:
+          - renesas,r9a06g032-gmac
+          - renesas,rzn1-gmac
+    contains:
+      enum:
+        - snps,dwmac
+
+  pcs-handle:
+    description:
+      phandle pointing to a PCS sub-node compatible with
+      renesas,rzn1-miic.yaml#
+    $ref: /schemas/types.yaml#/definitions/phandle
+
+required:
+  - compatible
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/r9a06g032-sysctrl.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    ethernet@44000000 {
+      compatible = "renesas,rzn1-gmac";
+      reg = <0x44000000 0x2000>;
+      interrupt-parent = <&gic>;
+      interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>,
+             <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>,
+             <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>;
+      interrupt-names = "macirq", "eth_wake_irq", "eth_lpi";
+      clock-names = "stmmaceth";
+      clocks = <&sysctrl R9A06G032_HCLK_GMAC0>;
+      snps,multicast-filter-bins = <256>;
+      snps,perfect-filter-entries = <128>;
+      tx-fifo-depth = <2048>;
+      rx-fifo-depth = <4096>;
+      pcs-handle = <&mii_conv1>;
+      phy-mode = "mii";
+    };
+
+...