Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4b859450 authored by Maxime Ripard's avatar Maxime Ripard Committed by Rob Herring
Browse files

dt-bindings: net: sun7i-gmac: Convert the binding to a schemas



Switch our Allwinner A20 GMAC controller binding to a YAML schema to enable
the DT validation. Since that controller is based on a Synopsys IP, let's
add the validation to that schemas with a bunch of conditionals.

Reviewed-by: default avatarRob Herring <robh@kernel.org>
Signed-off-by: default avatarMaxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: default avatarRob Herring <robh@kernel.org>
parent 7db3545a
Loading
Loading
Loading
Loading
+0 −27
Original line number Diff line number Diff line
* Allwinner GMAC ethernet controller

This device is a platform glue layer for stmmac.
Please see stmmac.txt for the other unchanged properties.

Required properties:
 - compatible:  Should be "allwinner,sun7i-a20-gmac"
 - clocks: Should contain the GMAC main clock, and tx clock
   The tx clock type should be "allwinner,sun7i-a20-gmac-clk"
 - clock-names: Should contain the clock names "stmmaceth",
   and "allwinner_gmac_tx"

Optional properties:
- phy-supply: phandle to a regulator if the PHY needs one

Examples:

	gmac: ethernet@1c50000 {
		compatible = "allwinner,sun7i-a20-gmac";
		reg = <0x01c50000 0x10000>,
		      <0x01c20164 0x4>;
		interrupts = <0 85 1>;
		interrupt-names = "macirq";
		clocks = <&ahb_gates 49>, <&gmac_tx>;
		clock-names = "stmmaceth", "allwinner_gmac_tx";
		phy-mode = "mii";
	};
+65 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/net/allwinner,sun7i-a20-gmac.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Allwinner A20 GMAC Device Tree Bindings

allOf:
  - $ref: "snps,dwmac.yaml#"

maintainers:
  - Chen-Yu Tsai <wens@csie.org>
  - Maxime Ripard <maxime.ripard@bootlin.com>

properties:
  compatible:
    const: allwinner,sun7i-a20-gmac

  interrupts:
    maxItems: 1

  interrupt-names:
    const: macirq

  clocks:
    items:
      - description: GMAC main clock
      - description: TX clock

  clock-names:
    items:
      - const: stmmaceth
      - const: allwinner_gmac_tx

  phy-supply:
    description:
      PHY regulator

required:
  - compatible
  - reg
  - interrupts
  - interrupt-names
  - clocks
  - clock-names
  - phy-connection-type

examples:
  - |
    gmac: ethernet@1c50000 {
        compatible = "allwinner,sun7i-a20-gmac";
        reg = <0x01c50000 0x10000>;
        interrupts = <0 85 1>;
        interrupt-names = "macirq";
        clocks = <&ahb_gates 49>, <&gmac_tx>;
        clock-names = "stmmaceth", "allwinner_gmac_tx";
        phy-connection-type = "mii";
    };

# FIXME: We should set it, but it would report all the generic
# properties as additional properties.
# additionalProperties: false

...
+3 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ properties:
  compatible:
    contains:
      enum:
        - allwinner,sun7i-a20-gmac
        - snps,dwmac
        - snps,dwmac-3.50a
        - snps,dwmac-3.610
@@ -265,6 +266,7 @@ allOf:
        compatible:
          contains:
            enum:
              - allwinner,sun7i-a20-gmac
              - snps,dwxgmac
              - snps,dwxgmac-2.10
              - st,spear600-gmac
@@ -305,6 +307,7 @@ allOf:
        compatible:
          contains:
            enum:
              - allwinner,sun7i-a20-gmac
              - snps,dwmac-4.00
              - snps,dwmac-4.10a
              - snps,dwxgmac