diff mbox series

dt-bindings: net: Convert mdio-gpio to yaml

Message ID 20210428163120.3657234-1-clabbe@baylibre.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series dt-bindings: net: Convert mdio-gpio to yaml | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Corentin LABBE April 28, 2021, 4:31 p.m. UTC
Converts net/mdio-gpio.txt to yaml

Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
---
This patch is a part of the work on fixing all DTs on gemini platform.

 .../devicetree/bindings/net/mdio-gpio.txt     | 27 ---------
 .../devicetree/bindings/net/mdio-gpio.yaml    | 56 +++++++++++++++++++
 2 files changed, 56 insertions(+), 27 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/net/mdio-gpio.txt
 create mode 100644 Documentation/devicetree/bindings/net/mdio-gpio.yaml

Comments

Andrew Lunn April 28, 2021, 7:19 p.m. UTC | #1
> +  gpios:
> +    minItems: 2
> +    description: |
> +      MDC and MDIO lines connected to GPIO controllers are listed in
> +      the gpios property as described in section VIII.1 in the
> +      following order: MDC, MDIO.

You should probably add maxItems: 3, or however you describe this in
yaml. You often find with x86 machines you don't have GPIOs, just GPI
and GPO, and you need to combine two to form the MDIO line of the MDIO
bus.

	Andrew
Corentin LABBE April 29, 2021, 7:19 p.m. UTC | #2
Le Wed, Apr 28, 2021 at 09:19:32PM +0200, Andrew Lunn a écrit :
> > +  gpios:
> > +    minItems: 2
> > +    description: |
> > +      MDC and MDIO lines connected to GPIO controllers are listed in
> > +      the gpios property as described in section VIII.1 in the
> > +      following order: MDC, MDIO.
> 
> You should probably add maxItems: 3, or however you describe this in
> yaml. You often find with x86 machines you don't have GPIOs, just GPI
> and GPO, and you need to combine two to form the MDIO line of the MDIO
> bus.
> 

I will do it.
Thanks
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/mdio-gpio.txt b/Documentation/devicetree/bindings/net/mdio-gpio.txt
deleted file mode 100644
index 4d91a36c5cf5..000000000000
--- a/Documentation/devicetree/bindings/net/mdio-gpio.txt
+++ /dev/null
@@ -1,27 +0,0 @@ 
-MDIO on GPIOs
-
-Currently defined compatibles:
-- virtual,gpio-mdio
-- microchip,mdio-smi0
-
-MDC and MDIO lines connected to GPIO controllers are listed in the
-gpios property as described in section VIII.1 in the following order:
-
-MDC, MDIO.
-
-Note: Each gpio-mdio bus should have an alias correctly numbered in "aliases"
-node.
-
-Example:
-
-aliases {
-	mdio-gpio0 = &mdio0;
-};
-
-mdio0: mdio {
-	compatible = "virtual,mdio-gpio";
-	#address-cells = <1>;
-	#size-cells = <0>;
-	gpios = <&qe_pio_a 11
-		 &qe_pio_c 6>;
-};
diff --git a/Documentation/devicetree/bindings/net/mdio-gpio.yaml b/Documentation/devicetree/bindings/net/mdio-gpio.yaml
new file mode 100644
index 000000000000..55c629cb5e57
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/mdio-gpio.yaml
@@ -0,0 +1,56 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/mdio-gpio.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MDIO on GPIOs
+
+maintainers:
+  - Andrew Lunn <andrew@lunn.ch>
+  - Florian Fainelli <f.fainelli@gmail.com>
+  - Heiner Kallweit <hkallweit1@gmail.com>
+
+allOf:
+  - $ref: "mdio.yaml#"
+
+properties:
+  compatible:
+    enum:
+      - virtual,mdio-gpio
+      - microchip,mdio-smi0
+
+  "#address-cells":
+    const: 1
+
+  "#size-cells":
+    const: 0
+
+  gpios:
+    minItems: 2
+    description: |
+      MDC and MDIO lines connected to GPIO controllers are listed in
+      the gpios property as described in section VIII.1 in the
+      following order: MDC, MDIO.
+
+#Note: Each gpio-mdio bus should have an alias correctly numbered in "aliases"
+#node.
+unevaluatedProperties: false
+
+examples:
+  - |
+    aliases {
+        mdio-gpio0 = &mdio0;
+    };
+
+    mdio0: mdio {
+      compatible = "virtual,mdio-gpio";
+      #address-cells = <1>;
+      #size-cells = <0>;
+      gpios = <&qe_pio_a 11
+               &qe_pio_c 6>;
+      ethphy0: ethernet-phy@0 {
+        reg = <0>;
+      };
+    };
+...