netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dt-bindings: net: xilinx_gmii2rgmii: Convert to json schema
@ 2023-07-13 10:34 Pranavi Somisetty
  2023-07-13 11:23 ` Krzysztof Kozlowski
  0 siblings, 1 reply; 6+ messages in thread
From: Pranavi Somisetty @ 2023-07-13 10:34 UTC (permalink / raw)
  To: davem, edumazet, kuba, pabeni, robh+dt, krzysztof.kozlowski+dt,
	conor+dt, michal.simek, harini.katakam
  Cc: git, radhey.shyam.pandey, pranavi.somisetty, netdev, linux-kernel,
	devicetree, linux-arm-kernel

Convert the Xilinx GMII to RGMII Converter device tree binding
documentation to json schema.
This converter is usually used as gem <---> gmii2rgmii <---> external phy
and, it's phy-handle should point to the phandle of the external phy.

Signed-off-by: Pranavi Somisetty <pranavi.somisetty@amd.com>
---
 .../bindings/net/xilinx_gmii2rgmii.txt        | 35 ------------
 .../bindings/net/xlnx,gmii-to-rgmii.yaml      | 53 +++++++++++++++++++
 2 files changed, 53 insertions(+), 35 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/net/xilinx_gmii2rgmii.txt
 create mode 100644 Documentation/devicetree/bindings/net/xlnx,gmii-to-rgmii.yaml

diff --git a/Documentation/devicetree/bindings/net/xilinx_gmii2rgmii.txt b/Documentation/devicetree/bindings/net/xilinx_gmii2rgmii.txt
deleted file mode 100644
index 038dda48b8e6..000000000000
--- a/Documentation/devicetree/bindings/net/xilinx_gmii2rgmii.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-XILINX GMIITORGMII Converter Driver Device Tree Bindings
---------------------------------------------------------
-
-The Gigabit Media Independent Interface (GMII) to Reduced Gigabit Media
-Independent Interface (RGMII) core provides the RGMII between RGMII-compliant
-Ethernet physical media devices (PHY) and the Gigabit Ethernet controller.
-This core can be used in all three modes of operation(10/100/1000 Mb/s).
-The Management Data Input/Output (MDIO) interface is used to configure the
-Speed of operation. This core can switch dynamically between the three
-Different speed modes by configuring the conveter register through mdio write.
-
-This converter sits between the ethernet MAC and the external phy.
-MAC <==> GMII2RGMII <==> RGMII_PHY
-
-For more details about mdio please refer phy.txt file in the same directory.
-
-Required properties:
-- compatible	: Should be "xlnx,gmii-to-rgmii-1.0"
-- reg		: The ID number for the phy, usually a small integer
-- phy-handle	: Should point to the external phy device.
-		  See ethernet.txt file in the same directory.
-
-Example:
-	mdio {
-		#address-cells = <1>;
-		#size-cells = <0>;
-		phy: ethernet-phy@0 {
-			......
-		};
-		gmiitorgmii: gmiitorgmii@8 {
-			compatible = "xlnx,gmii-to-rgmii-1.0";
-			reg = <8>;
-			phy-handle = <&phy>;
-		};
-	};
diff --git a/Documentation/devicetree/bindings/net/xlnx,gmii-to-rgmii.yaml b/Documentation/devicetree/bindings/net/xlnx,gmii-to-rgmii.yaml
new file mode 100644
index 000000000000..8990054f9d53
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/xlnx,gmii-to-rgmii.yaml
@@ -0,0 +1,53 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/xlnx,gmii-to-rgmii.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Xilinx GMII to RGMII Converter
+
+maintainers:
+  - Harini Katakam <harini.katakam@amd.com>
+
+description:
+  The Gigabit Media Independent Interface (GMII) to Reduced Gigabit Media
+  Independent Interface (RGMII) core provides the RGMII between RGMII-compliant
+  ethernet physical media devices (PHY) and the Gigabit Ethernet controller.
+  This core can be used in all three modes of operation(10/100/1000 Mb/s).
+  The Management Data Input/Output (MDIO) interface is used to configure the
+  speed of operation. This core can switch dynamically between the three
+  different speed modes by configuring the converter register through mdio write.
+  The core cannot function without an external phy connected to it.
+
+properties:
+  compatible:
+    const: xlnx,gmii-to-rgmii-1.0
+
+  reg:
+    minimum: 0
+    maximum: 31
+    description: The ID number for the phy, usually a small integer.
+
+  phy-handle: true
+
+required:
+  - compatible
+  - reg
+  - phy-handle
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    mdio {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        phy: ethernet-phy@0 {
+            reg = <0>;
+        };
+        gmiitorgmii@8 {
+            compatible = "xlnx,gmii-to-rgmii-1.0";
+            reg = <8>;
+            phy-handle = <&phy>;
+        };
+    };
-- 
2.36.1


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

* Re: [PATCH] dt-bindings: net: xilinx_gmii2rgmii: Convert to json schema
  2023-07-13 10:34 [PATCH] dt-bindings: net: xilinx_gmii2rgmii: Convert to json schema Pranavi Somisetty
@ 2023-07-13 11:23 ` Krzysztof Kozlowski
  2023-07-13 15:59   ` Andrew Lunn
  0 siblings, 1 reply; 6+ messages in thread
From: Krzysztof Kozlowski @ 2023-07-13 11:23 UTC (permalink / raw)
  To: Pranavi Somisetty, davem, edumazet, kuba, pabeni, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, michal.simek, harini.katakam
  Cc: git, radhey.shyam.pandey, netdev, linux-kernel, devicetree,
	linux-arm-kernel

On 13/07/2023 12:34, Pranavi Somisetty wrote:
> Convert the Xilinx GMII to RGMII Converter device tree binding
> documentation to json schema.
> This converter is usually used as gem <---> gmii2rgmii <---> external phy
> and, it's phy-handle should point to the phandle of the external phy.
> 
> Signed-off-by: Pranavi Somisetty <pranavi.somisetty@amd.com>

...

> +
> +description:
> +  The Gigabit Media Independent Interface (GMII) to Reduced Gigabit Media
> +  Independent Interface (RGMII) core provides the RGMII between RGMII-compliant
> +  ethernet physical media devices (PHY) and the Gigabit Ethernet controller.
> +  This core can be used in all three modes of operation(10/100/1000 Mb/s).
> +  The Management Data Input/Output (MDIO) interface is used to configure the
> +  speed of operation. This core can switch dynamically between the three
> +  different speed modes by configuring the converter register through mdio write.
> +  The core cannot function without an external phy connected to it.
> +
> +properties:
> +  compatible:
> +    const: xlnx,gmii-to-rgmii-1.0
> +
> +  reg:
> +    minimum: 0
> +    maximum: 31
> +    description: The ID number for the phy, usually a small integer.

Drop the "usually small...", it's obvious from constraints.

> +
> +  phy-handle: true

Where is this defined?

> +
> +required:
> +  - compatible
> +  - reg
> +  - phy-handle
> +
> +unevaluatedProperties: false

Either you miss $ref or this should be additionalProperties. I bet it's
the first problem.

> +
> +examples:
> +  - |
> +    mdio {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +        phy: ethernet-phy@0 {
> +            reg = <0>;
> +        };

Drop this node, quite obvious.

> +        gmiitorgmii@8 {
> +            compatible = "xlnx,gmii-to-rgmii-1.0";
> +            reg = <8>;
> +            phy-handle = <&phy>;
> +        };
> +    };

Best regards,
Krzysztof


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

* Re: [PATCH] dt-bindings: net: xilinx_gmii2rgmii: Convert to json schema
  2023-07-13 11:23 ` Krzysztof Kozlowski
@ 2023-07-13 15:59   ` Andrew Lunn
  2023-07-13 18:53     ` Krzysztof Kozlowski
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Lunn @ 2023-07-13 15:59 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Pranavi Somisetty, davem, edumazet, kuba, pabeni, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, michal.simek, harini.katakam,
	git, radhey.shyam.pandey, netdev, linux-kernel, devicetree,
	linux-arm-kernel

> > +examples:
> > +  - |
> > +    mdio {
> > +        #address-cells = <1>;
> > +        #size-cells = <0>;
> > +        phy: ethernet-phy@0 {
> > +            reg = <0>;
> > +        };
> 
> Drop this node, quite obvious.

Dumb question. Isn't it needed since it is referenced by phy-handle =
<&phy> below. Without it, the fragment is not valid DT and so the
checking tools will fail?

> > +        gmiitorgmii@8 {
> > +            compatible = "xlnx,gmii-to-rgmii-1.0";
> > +            reg = <8>;
> > +            phy-handle = <&phy>;
> > +        };
> > +    };

	Andrew

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

* Re: [PATCH] dt-bindings: net: xilinx_gmii2rgmii: Convert to json schema
  2023-07-13 15:59   ` Andrew Lunn
@ 2023-07-13 18:53     ` Krzysztof Kozlowski
  2023-07-13 19:30       ` Andrew Lunn
  0 siblings, 1 reply; 6+ messages in thread
From: Krzysztof Kozlowski @ 2023-07-13 18:53 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Pranavi Somisetty, davem, edumazet, kuba, pabeni, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, michal.simek, harini.katakam,
	git, radhey.shyam.pandey, netdev, linux-kernel, devicetree,
	linux-arm-kernel

On 13/07/2023 17:59, Andrew Lunn wrote:
>>> +examples:
>>> +  - |
>>> +    mdio {
>>> +        #address-cells = <1>;
>>> +        #size-cells = <0>;
>>> +        phy: ethernet-phy@0 {
>>> +            reg = <0>;
>>> +        };
>>
>> Drop this node, quite obvious.
> 
> Dumb question. Isn't it needed since it is referenced by phy-handle =
> <&phy> below. Without it, the fragment is not valid DT and so the
> checking tools will fail?

No, because the example is compiled with silencing missing phandles.

Best regards,
Krzysztof


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

* Re: [PATCH] dt-bindings: net: xilinx_gmii2rgmii: Convert to json schema
  2023-07-13 18:53     ` Krzysztof Kozlowski
@ 2023-07-13 19:30       ` Andrew Lunn
  2023-07-14  4:17         ` Krzysztof Kozlowski
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Lunn @ 2023-07-13 19:30 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Pranavi Somisetty, davem, edumazet, kuba, pabeni, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, michal.simek, harini.katakam,
	git, radhey.shyam.pandey, netdev, linux-kernel, devicetree,
	linux-arm-kernel

On Thu, Jul 13, 2023 at 08:53:34PM +0200, Krzysztof Kozlowski wrote:
> On 13/07/2023 17:59, Andrew Lunn wrote:
> >>> +examples:
> >>> +  - |
> >>> +    mdio {
> >>> +        #address-cells = <1>;
> >>> +        #size-cells = <0>;
> >>> +        phy: ethernet-phy@0 {
> >>> +            reg = <0>;
> >>> +        };
> >>
> >> Drop this node, quite obvious.
> > 
> > Dumb question. Isn't it needed since it is referenced by phy-handle =
> > <&phy> below. Without it, the fragment is not valid DT and so the
> > checking tools will fail?
> 
> No, because the example is compiled with silencing missing phandles.

Ah, thanks.

This is a rather odd device, there is no other like it in mainline, so
i think having that PHY is useful, even if you think it is obvious
what is going on here.

     Andrew

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

* Re: [PATCH] dt-bindings: net: xilinx_gmii2rgmii: Convert to json schema
  2023-07-13 19:30       ` Andrew Lunn
@ 2023-07-14  4:17         ` Krzysztof Kozlowski
  0 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2023-07-14  4:17 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Pranavi Somisetty, davem, edumazet, kuba, pabeni, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, michal.simek, harini.katakam,
	git, radhey.shyam.pandey, netdev, linux-kernel, devicetree,
	linux-arm-kernel

On 13/07/2023 21:30, Andrew Lunn wrote:
> On Thu, Jul 13, 2023 at 08:53:34PM +0200, Krzysztof Kozlowski wrote:
>> On 13/07/2023 17:59, Andrew Lunn wrote:
>>>>> +examples:
>>>>> +  - |
>>>>> +    mdio {
>>>>> +        #address-cells = <1>;
>>>>> +        #size-cells = <0>;
>>>>> +        phy: ethernet-phy@0 {
>>>>> +            reg = <0>;
>>>>> +        };
>>>>
>>>> Drop this node, quite obvious.
>>>
>>> Dumb question. Isn't it needed since it is referenced by phy-handle =
>>> <&phy> below. Without it, the fragment is not valid DT and so the
>>> checking tools will fail?
>>
>> No, because the example is compiled with silencing missing phandles.
> 
> Ah, thanks.
> 
> This is a rather odd device, there is no other like it in mainline, so
> i think having that PHY is useful, even if you think it is obvious
> what is going on here.

For almost all other devices in other subsystems we do not provides such
nodes. The "ethernet-phy" node should be obvious because nothing else is
expected to be in "phy-handle". However, if you find it useful, then I
am also fine with it.

Best regards,
Krzysztof


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

end of thread, other threads:[~2023-07-14  4:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-13 10:34 [PATCH] dt-bindings: net: xilinx_gmii2rgmii: Convert to json schema Pranavi Somisetty
2023-07-13 11:23 ` Krzysztof Kozlowski
2023-07-13 15:59   ` Andrew Lunn
2023-07-13 18:53     ` Krzysztof Kozlowski
2023-07-13 19:30       ` Andrew Lunn
2023-07-14  4:17         ` Krzysztof Kozlowski

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