netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dt-bindings: net: davinci-mdio: convert bindings to json-schema
@ 2019-11-01 16:45 Grygorii Strashko
  2019-11-01 18:15 ` Simon Horman
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Grygorii Strashko @ 2019-11-01 16:45 UTC (permalink / raw)
  To: David S. Miller, netdev, Rob Herring, devicetree
  Cc: Sekhar Nori, linux-kernel, Grygorii Strashko

Now that we have the DT validation in place, let's convert the device tree
bindings for the TI SoC Davinci/OMAP/Keystone2 MDIO Controllerr over to a
YAML schemas.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
---
changes since rfc:
 - removed old bindings
 - bus_freq defined as "required" for davinci_mdio
rfc: https://lkml.org/lkml/2019/10/24/300

 .../devicetree/bindings/net/davinci-mdio.txt  | 36 ----------
 .../bindings/net/ti,davinci-mdio.yaml         | 71 +++++++++++++++++++
 2 files changed, 71 insertions(+), 36 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/net/davinci-mdio.txt
 create mode 100644 Documentation/devicetree/bindings/net/ti,davinci-mdio.yaml

diff --git a/Documentation/devicetree/bindings/net/davinci-mdio.txt b/Documentation/devicetree/bindings/net/davinci-mdio.txt
deleted file mode 100644
index e6527de80f10..000000000000
--- a/Documentation/devicetree/bindings/net/davinci-mdio.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-TI SoC Davinci/Keystone2 MDIO Controller Device Tree Bindings
----------------------------------------------------
-
-Required properties:
-- compatible		: Should be "ti,davinci_mdio"
-			  and "ti,keystone_mdio" for Keystone 2 SoCs
-			  and "ti,cpsw-mdio" for am335x, am472x, am57xx/dra7, dm814x SoCs
-			  and "ti,am4372-mdio" for am472x SoC
-- reg			: physical base address and size of the davinci mdio
-			  registers map
-- bus_freq		: Mdio Bus frequency
-
-Optional properties:
-- ti,hwmods		: Must be "davinci_mdio"
-
-Note: "ti,hwmods" field is used to fetch the base address and irq
-resources from TI, omap hwmod data base during device registration.
-Future plan is to migrate hwmod data base contents into device tree
-blob so that, all the required data will be used from device tree dts
-file.
-
-Examples:
-
-	mdio: davinci_mdio@4a101000 {
-		compatible = "ti,davinci_mdio";
-		reg = <0x4A101000 0x1000>;
-		bus_freq = <1000000>;
-	};
-
-(or)
-
-	mdio: davinci_mdio@4a101000 {
-		compatible = "ti,davinci_mdio";
-		ti,hwmods = "davinci_mdio";
-		bus_freq = <1000000>;
-	};
diff --git a/Documentation/devicetree/bindings/net/ti,davinci-mdio.yaml b/Documentation/devicetree/bindings/net/ti,davinci-mdio.yaml
new file mode 100644
index 000000000000..242ac4935a4b
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/ti,davinci-mdio.yaml
@@ -0,0 +1,71 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/ti,davinci-mdio.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: TI SoC Davinci/Keystone2 MDIO Controller
+
+maintainers:
+  - Grygorii Strashko <grygorii.strashko@ti.com>
+
+description:
+  TI SoC Davinci/Keystone2 MDIO Controller
+
+allOf:
+  - $ref: "mdio.yaml#"
+
+properties:
+  compatible:
+    oneOf:
+       - const: ti,davinci_mdio
+       - items:
+         - const: ti,keystone_mdio
+         - const: ti,davinci_mdio
+       - items:
+         - const: ti,cpsw-mdio
+         - const: ti,davinci_mdio
+       - items:
+         - const: ti,am4372-mdio
+         - const: ti,cpsw-mdio
+         - const: ti,davinci_mdio
+
+  reg:
+    maxItems: 1
+
+  bus_freq:
+      maximum: 2500000
+      description:
+        MDIO Bus frequency
+
+  ti,hwmods:
+    description: TI hwmod name
+    deprecated: true
+    allOf:
+      - $ref: /schemas/types.yaml#/definitions/string-array
+      - items:
+          const: davinci_mdio
+
+if:
+  properties:
+    compatible:
+      contains:
+        const: ti,davinci_mdio
+  required:
+    - bus_freq
+
+required:
+  - compatible
+  - reg
+  - "#address-cells"
+  - "#size-cells"
+
+examples:
+  - |
+    davinci_mdio: mdio@4a101000 {
+         compatible = "ti,davinci_mdio";
+         #address-cells = <1>;
+         #size-cells = <0>;
+         reg = <0x4a101000 0x1000>;
+         bus_freq = <1000000>;
+    };
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] dt-bindings: net: davinci-mdio: convert bindings to json-schema
  2019-11-01 16:45 [PATCH] dt-bindings: net: davinci-mdio: convert bindings to json-schema Grygorii Strashko
@ 2019-11-01 18:15 ` Simon Horman
  2019-11-04  3:11 ` David Miller
  2019-11-06  4:33 ` Rob Herring
  2 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2019-11-01 18:15 UTC (permalink / raw)
  To: Grygorii Strashko
  Cc: David S. Miller, netdev, Rob Herring, devicetree, Sekhar Nori,
	linux-kernel

On Fri, Nov 01, 2019 at 06:45:02PM +0200, Grygorii Strashko wrote:
> Now that we have the DT validation in place, let's convert the device tree
> bindings for the TI SoC Davinci/OMAP/Keystone2 MDIO Controllerr over to a
> YAML schemas.
> 
> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>

Reviewed-by: Simon Horman <simon.horman@netronome.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] dt-bindings: net: davinci-mdio: convert bindings to json-schema
  2019-11-01 16:45 [PATCH] dt-bindings: net: davinci-mdio: convert bindings to json-schema Grygorii Strashko
  2019-11-01 18:15 ` Simon Horman
@ 2019-11-04  3:11 ` David Miller
  2019-11-06  4:33 ` Rob Herring
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2019-11-04  3:11 UTC (permalink / raw)
  To: grygorii.strashko; +Cc: netdev, robh+dt, devicetree, nsekhar, linux-kernel

From: Grygorii Strashko <grygorii.strashko@ti.com>
Date: Fri, 1 Nov 2019 18:45:02 +0200

> Now that we have the DT validation in place, let's convert the device tree
> bindings for the TI SoC Davinci/OMAP/Keystone2 MDIO Controllerr over to a
> YAML schemas.
> 
> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
> ---
> changes since rfc:
>  - removed old bindings
>  - bus_freq defined as "required" for davinci_mdio
> rfc: https://lkml.org/lkml/2019/10/24/300

I am assume the devicetree folks will pick this up.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] dt-bindings: net: davinci-mdio: convert bindings to json-schema
  2019-11-01 16:45 [PATCH] dt-bindings: net: davinci-mdio: convert bindings to json-schema Grygorii Strashko
  2019-11-01 18:15 ` Simon Horman
  2019-11-04  3:11 ` David Miller
@ 2019-11-06  4:33 ` Rob Herring
  2 siblings, 0 replies; 4+ messages in thread
From: Rob Herring @ 2019-11-06  4:33 UTC (permalink / raw)
  To: Grygorii Strashko
  Cc: David S. Miller, netdev, Rob Herring, devicetree, Sekhar Nori,
	linux-kernel, Grygorii Strashko

On Fri, 1 Nov 2019 18:45:02 +0200, Grygorii Strashko wrote:
> Now that we have the DT validation in place, let's convert the device tree
> bindings for the TI SoC Davinci/OMAP/Keystone2 MDIO Controllerr over to a
> YAML schemas.
> 
> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
> ---
> changes since rfc:
>  - removed old bindings
>  - bus_freq defined as "required" for davinci_mdio
> rfc: https://lkml.org/lkml/2019/10/24/300
> 
>  .../devicetree/bindings/net/davinci-mdio.txt  | 36 ----------
>  .../bindings/net/ti,davinci-mdio.yaml         | 71 +++++++++++++++++++
>  2 files changed, 71 insertions(+), 36 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/net/davinci-mdio.txt
>  create mode 100644 Documentation/devicetree/bindings/net/ti,davinci-mdio.yaml
> 

Applied, thanks.

Rob

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-11-06  4:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-01 16:45 [PATCH] dt-bindings: net: davinci-mdio: convert bindings to json-schema Grygorii Strashko
2019-11-01 18:15 ` Simon Horman
2019-11-04  3:11 ` David Miller
2019-11-06  4:33 ` Rob Herring

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).