diff mbox series

[v1,1/2] dt-bindings: net: Add support NPCM dwmac

Message ID 20231121151733.2015384-2-tmaimon77@gmail.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series net: stmmac: add NPCM dwmac support | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/codegen success Generated files up to date
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/cc_maintainers warning 3 maintainers not CCed: conor+dt@kernel.org kuba@kernel.org pabeni@redhat.com
netdev/build_clang success Errors and warnings before: 8 this patch: 8
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch warning WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Tomer Maimon Nov. 21, 2023, 3:17 p.m. UTC
Add documentation to describe Nuvoton BMC NPCM dwmac driver(sgmii).

Signed-off-by: Tomer Maimon <tmaimon77@gmail.com>
---
 .../bindings/net/nuvoton,npcm8xx-sgmii.yaml   | 72 +++++++++++++++++++
 .../devicetree/bindings/net/snps,dwmac.yaml   |  1 +
 2 files changed, 73 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/nuvoton,npcm8xx-sgmii.yaml

Comments

Krzysztof Kozlowski Nov. 21, 2023, 5:21 p.m. UTC | #1
On 21/11/2023 16:17, Tomer Maimon wrote:
> Add documentation to describe Nuvoton BMC NPCM dwmac driver(sgmii).
> 
> Signed-off-by: Tomer Maimon <tmaimon77@gmail.com>
> ---
>  .../bindings/net/nuvoton,npcm8xx-sgmii.yaml   | 72 +++++++++++++++++++
>  .../devicetree/bindings/net/snps,dwmac.yaml   |  1 +
>  2 files changed, 73 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/net/nuvoton,npcm8xx-sgmii.yaml
> 
> diff --git a/Documentation/devicetree/bindings/net/nuvoton,npcm8xx-sgmii.yaml b/Documentation/devicetree/bindings/net/nuvoton,npcm8xx-sgmii.yaml
> new file mode 100644
> index 000000000000..6a5f2cade7c9
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/nuvoton,npcm8xx-sgmii.yaml
> @@ -0,0 +1,72 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/nuvoton,npcm8xx-sgmii.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Nuvoton NPCM DWMAC SGMII Ethernet controller
> +
> +maintainers:
> +  - Tomer Maimon <tmaimon77@gmail.com>
> +
> +select:
> +  properties:
> +    compatible:
> +      contains:
> +        enum:
> +          - nuvoton,npcm8xx-sgmii

This must be specific compatible, no wildcards. Then use the same for
filename.

> +  required:
> +    - compatible
> +
> +allOf:
> +  - $ref: snps,dwmac.yaml#
> +
> +properties:
> +  compatible:
> +    oneOf:
> +      - items:
> +          - enum:
> +              - nuvoton,npcm8xx-sgmii
> +          - const: snps,dwmac-3.50a

Blank line

> +  reg:
> +    items:
> +      - description:
> +          The first range represent DWMAC controller registers.

Keep it in one line and drop redundant "The first range represent".

> +      - description:
> +          The second range represent PCS configuration registers.
> +
> +  clocks:
> +    items:
> +      - description: GMAC main clock
> +
> +  clock-names:
> +    items:
> +      - const: stmmaceth
> +

Constrain also interrupts and resets.

> +required:
> +  - compatible
> +  - reg
> +  - clocks
> +  - clock-names
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/arm-gic.h>
> +    #include <dt-bindings/clock/nuvoton,npcm845-clk.h>
> +
> +    ahb {
> +      #address-cells = <2>;
> +      #size-cells = <2>;

Your indentation is mixed. Use 4 spaces for example indentation.

> +
> +      gmac0: ethernet@f0802000 {

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/nuvoton,npcm8xx-sgmii.yaml b/Documentation/devicetree/bindings/net/nuvoton,npcm8xx-sgmii.yaml
new file mode 100644
index 000000000000..6a5f2cade7c9
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/nuvoton,npcm8xx-sgmii.yaml
@@ -0,0 +1,72 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/nuvoton,npcm8xx-sgmii.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Nuvoton NPCM DWMAC SGMII Ethernet controller
+
+maintainers:
+  - Tomer Maimon <tmaimon77@gmail.com>
+
+select:
+  properties:
+    compatible:
+      contains:
+        enum:
+          - nuvoton,npcm8xx-sgmii
+  required:
+    - compatible
+
+allOf:
+  - $ref: snps,dwmac.yaml#
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+          - enum:
+              - nuvoton,npcm8xx-sgmii
+          - const: snps,dwmac-3.50a
+  reg:
+    items:
+      - description:
+          The first range represent DWMAC controller registers.
+      - description:
+          The second range represent PCS configuration registers.
+
+  clocks:
+    items:
+      - description: GMAC main clock
+
+  clock-names:
+    items:
+      - const: stmmaceth
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/clock/nuvoton,npcm845-clk.h>
+
+    ahb {
+      #address-cells = <2>;
+      #size-cells = <2>;
+
+      gmac0: ethernet@f0802000 {
+          compatible = "nuvoton,npcm8xx-sgmii","snps,dwmac-3.50a";
+          reg = <0x0 0xf0802000 0x0 0x2000>, <0x0 0xf0780000 0x0 0x200>;
+          interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
+          interrupt-names = "macirq";
+          clocks = <&clk NPCM8XX_CLK_AHB>;
+          clock-names = "stmmaceth";
+          phy-mode = "rgmii-id";
+      };
+    };
diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
index 5c2769dc689a..ba52dbc85144 100644
--- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
@@ -66,6 +66,7 @@  properties:
         - ingenic,x2000-mac
         - loongson,ls2k-dwmac
         - loongson,ls7a-dwmac
+        - nuvoton,npcm8xx-sgmii
         - qcom,qcs404-ethqos
         - qcom,sa8775p-ethqos
         - qcom,sc8280xp-ethqos