* [RFC PATCH] dt-bindings: net: davinci-mdio: convert bindings to json-schema
@ 2019-10-24 10:47 Grygorii Strashko
2019-10-29 19:27 ` Rob Herring
0 siblings, 1 reply; 2+ messages in thread
From: Grygorii Strashko @ 2019-10-24 10:47 UTC (permalink / raw)
To: David S. Miller, netdev, Rob Herring
Cc: Sekhar Nori, linux-kernel, devicetree, 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>
---
This my first attempt to work with YAML schemas, hence RFC.
.../bindings/net/ti,davinci-mdio.yaml | 64 +++++++++++++++++++
1 file changed, 64 insertions(+)
create mode 100644 Documentation/devicetree/bindings/net/ti,davinci-mdio.yaml
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..e51054d2e0fa
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/ti,davinci-mdio.yaml
@@ -0,0 +1,64 @@
+# 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 Device Tree Bindings
+
+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
+
+required:
+ - compatible
+ - reg
+ - bus_freq
+ - "#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] 2+ messages in thread
* Re: [RFC PATCH] dt-bindings: net: davinci-mdio: convert bindings to json-schema
2019-10-24 10:47 [RFC PATCH] dt-bindings: net: davinci-mdio: convert bindings to json-schema Grygorii Strashko
@ 2019-10-29 19:27 ` Rob Herring
0 siblings, 0 replies; 2+ messages in thread
From: Rob Herring @ 2019-10-29 19:27 UTC (permalink / raw)
To: Grygorii Strashko
Cc: David S. Miller, netdev, Sekhar Nori, linux-kernel, devicetree
On Thu, Oct 24, 2019 at 01:47:30PM +0300, 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>
> ---
> This my first attempt to work with YAML schemas, hence RFC.
No problems validating this schema, but the example in mdio.yaml isn't
happy:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/net/mdio.example.dt.yaml:
mdio@5c030000: 'bus_freq' is a required property
>
> .../bindings/net/ti,davinci-mdio.yaml | 64 +++++++++++++++++++
> 1 file changed, 64 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/net/ti,davinci-mdio.yaml
Convert implies deleting the old binding...
>
> 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..e51054d2e0fa
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/ti,davinci-mdio.yaml
> @@ -0,0 +1,64 @@
> +# 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 Device Tree Bindings
> +
> +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
> +
> +required:
> + - compatible
> + - reg
> + - bus_freq
> + - "#address-cells"
> + - "#size-cells"
> +
> +examples:
> + - |
> + davinci_mdio: mdio@4a101000 {
> + compatible = "ti,davinci_mdio";
> + #address-cells = <1>;
> + #size-cells = <0>;
> + reg = <0x4A101000 0x1000>;
Lowercase hex please.
> + bus_freq = <1000000>;
> + };
> --
> 2.17.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-10-29 19:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-24 10:47 [RFC PATCH] dt-bindings: net: davinci-mdio: convert bindings to json-schema Grygorii Strashko
2019-10-29 19:27 ` 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).