From: Maxime Ripard <maxime.ripard@bootlin.com>
To: Mark Rutland <mark.rutland@arm.com>,
Rob Herring <robh+dt@kernel.org>,
Frank Rowand <frowand.list@gmail.com>,
"David S . Miller" <davem@davemloft.net>,
Chen-Yu Tsai <wens@csie.org>,
Maxime Ripard <maxime.ripard@bootlin.com>
Cc: "Maxime Coquelin" <mcoquelin.stm32@gmail.com>,
"Alexandre Torgue" <alexandre.torgue@st.com>,
netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
devicetree@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
"Maxime Chevallier" <maxime.chevallier@bootlin.com>,
"Antoine Ténart" <antoine.tenart@bootlin.com>,
"Andrew Lunn" <andrew@lunn.ch>,
"Florian Fainelli" <f.fainelli@gmail.com>,
"Heiner Kallweit" <hkallweit1@gmail.com>,
"Rob Herring" <robh@kernel.org>
Subject: [PATCH v3 09/16] dt-bindings: net: sun7i-gmac: Convert the binding to a schemas
Date: Wed, 19 Jun 2019 11:47:18 +0200 [thread overview]
Message-ID: <727b6d0540a500ccdb2addd9a54bcf62463b426f.1560937626.git-series.maxime.ripard@bootlin.com> (raw)
In-Reply-To: <27aeb33cf5b896900d5d11bd6957eda268014f0c.1560937626.git-series.maxime.ripard@bootlin.com>
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: Rob Herring <robh@kernel.org>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
---
Changes from v2:
- Switch to phy-connection-type instead of phy-mode
Changes from v1:
- Add a file of its own
---
Documentation/devicetree/bindings/net/allwinner,sun7i-a20-gmac.txt | 27 ---------------------------
Documentation/devicetree/bindings/net/allwinner,sun7i-a20-gmac.yaml | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Documentation/devicetree/bindings/net/snps,dwmac.yaml | 3 +++
3 files changed, 69 insertions(+), 27 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/net/allwinner,sun7i-a20-gmac.txt
create mode 100644 Documentation/devicetree/bindings/net/allwinner,sun7i-a20-gmac.yaml
diff --git a/Documentation/devicetree/bindings/net/allwinner,sun7i-a20-gmac.txt b/Documentation/devicetree/bindings/net/allwinner,sun7i-a20-gmac.txt
deleted file mode 100644
index 8b3f953656e3..000000000000
--- a/Documentation/devicetree/bindings/net/allwinner,sun7i-a20-gmac.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-* 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";
- };
diff --git a/Documentation/devicetree/bindings/net/allwinner,sun7i-a20-gmac.yaml b/Documentation/devicetree/bindings/net/allwinner,sun7i-a20-gmac.yaml
new file mode 100644
index 000000000000..38f6a2a73f46
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/allwinner,sun7i-a20-gmac.yaml
@@ -0,0 +1,66 @@
+# 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>,
+ <0x01c20164 0x4>;
+ 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
+
+...
diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
index 30e2ff7a2dcb..fed623a81dcd 100644
--- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
@@ -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
--
git-series 0.9.1
next prev parent reply other threads:[~2019-06-19 9:48 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-19 9:47 [PATCH v3 01/16] dt-bindings: net: Add YAML schemas for the generic Ethernet options Maxime Ripard
2019-06-19 9:47 ` [PATCH v3 02/16] dt-bindings: net: Add a YAML schemas for the generic PHY options Maxime Ripard
2019-06-19 9:47 ` [PATCH v3 03/16] dt-bindings: net: Add a YAML schemas for the generic MDIO options Maxime Ripard
2019-06-19 14:17 ` Rob Herring
2019-06-20 9:56 ` Maxime Ripard
2019-06-19 9:47 ` [PATCH v3 04/16] MAINTAINERS: Add Ethernet PHY YAML file Maxime Ripard
2019-06-19 9:47 ` [PATCH v3 05/16] dt-bindings: net: phy: The interrupt property is not mandatory Maxime Ripard
2019-06-19 9:47 ` [PATCH v3 06/16] dt-bindings: net: sun4i-emac: Convert the binding to a schemas Maxime Ripard
2019-06-19 14:46 ` Rob Herring
2019-06-19 20:44 ` Rob Herring
2019-06-19 9:47 ` [PATCH v3 07/16] dt-bindings: net: sun4i-mdio: " Maxime Ripard
2019-06-19 14:19 ` Rob Herring
2019-06-19 9:47 ` [PATCH v3 08/16] dt-bindings: net: stmmac: " Maxime Ripard
2019-06-19 14:12 ` Rob Herring
2019-06-19 9:47 ` Maxime Ripard [this message]
2019-06-19 9:47 ` [PATCH v3 10/16] dt-bindings: net: sun8i-emac: " Maxime Ripard
2019-06-19 14:10 ` Rob Herring
2019-06-19 9:47 ` [PATCH v3 11/16] dt-bindings: net: dwmac: Deprecate the PHY reset properties Maxime Ripard
2019-06-19 14:47 ` Rob Herring
2019-06-19 9:47 ` [PATCH v3 12/16] ARM: dts: sunxi: Switch to the generic PHY properties Maxime Ripard
2019-06-19 9:47 ` [PATCH v3 13/16] ARM: dts: sunxi: Switch from phy to phy-handle Maxime Ripard
2019-06-19 9:47 ` [PATCH v3 14/16] ARM: dts: sunxi: Switch from phy-mode to phy-connection-type Maxime Ripard
2019-06-19 14:11 ` Andrew Lunn
2019-06-19 9:47 ` [PATCH v3 15/16] ARM: dts: sunxi: h3/h5: " Maxime Ripard
2019-06-19 9:47 ` [PATCH v3 16/16] arm64: dts: allwinner: " Maxime Ripard
2019-06-19 14:03 ` [PATCH v3 01/16] dt-bindings: net: Add YAML schemas for the generic Ethernet options Andrew Lunn
2019-06-20 9:08 ` Maxime Ripard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=727b6d0540a500ccdb2addd9a54bcf62463b426f.1560937626.git-series.maxime.ripard@bootlin.com \
--to=maxime.ripard@bootlin.com \
--cc=alexandre.torgue@st.com \
--cc=andrew@lunn.ch \
--cc=antoine.tenart@bootlin.com \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=f.fainelli@gmail.com \
--cc=frowand.list@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mark.rutland@arm.com \
--cc=maxime.chevallier@bootlin.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=robh@kernel.org \
--cc=wens@csie.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).