From: "J. Neuschäfer" <j.ne@posteo.net>
Move the information related to the Freescale Gianfar (TSEC) MDIO bus
and the Ten-Bit Interface (TBI) from fsl-tsec-phy.txt to a new binding
file in YAML format, fsl,gianfar-mdio.yaml.
Signed-off-by: J. Neuschäfer <j.ne@posteo.net>
---
dt-bindings: net: Convert fsl,gianfar-tbi to YAML
---
.../devicetree/bindings/net/fsl,gianfar-mdio.yaml | 94 ++++++++++++++++++++++
.../devicetree/bindings/net/fsl-tsec-phy.txt | 41 +---------
2 files changed, 96 insertions(+), 39 deletions(-)
diff --git a/Documentation/devicetree/bindings/net/fsl,gianfar-mdio.yaml b/Documentation/devicetree/bindings/net/fsl,gianfar-mdio.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..2dade7f48c366b7f5c7408e1f7de1a6f5fc80787
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/fsl,gianfar-mdio.yaml
@@ -0,0 +1,94 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/fsl,gianfar-mdio.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Freescale Gianfar (TSEC) MDIO Device
+
+description:
+ This binding describes the MDIO is a bus to which the PHY devices are
+ connected. For each device that exists on this bus, a child node should be
+ created.
+
+ As of this writing, every TSEC is associated with an internal Ten-Bit
+ Interface (TBI) PHY. This PHY is accessed through the local MDIO bus. These
+ buses are defined similarly to the mdio buses, except they are compatible
+ with "fsl,gianfar-tbi". The TBI PHYs underneath them are similar to normal
+ PHYs, but the reg property is considered instructive, rather than
+ descriptive. The reg property should be chosen so it doesn't interfere with
+ other PHYs on the bus.
+
+maintainers:
+ - J. Neuschäfer <j.ne@posteo.net>
+
+properties:
+ compatible:
+ enum:
+ - fsl,gianfar-tbi
+ - fsl,gianfar-mdio
+ - fsl,etsec2-tbi
+ - fsl,etsec2-mdio
+ - fsl,ucc-mdio
+ - gianfar
+ - ucc_geth_phy
+
+ reg:
+ minItems: 1
+ items:
+ - description:
+ Offset and length of the register set for the device
+
+ - description:
+ Optionally, the offset and length of the TBIPA register (TBI PHY
+ address register). If TBIPA register is not specified, the driver
+ will attempt to infer it from the register set specified (your
+ mileage may vary).
+
+ device_type:
+ const: mdio
+
+ "#address-cells":
+ const: 1
+
+ "#size-cells":
+ const: 0
+
+required:
+ - reg
+ - "#address-cells"
+ - "#size-cells"
+
+allOf:
+ - $ref: mdio.yaml#
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - gianfar
+ - ucc_geth_phy
+ then:
+ required:
+ - device_type
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ soc {
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ mdio@24520 {
+ reg = <0x24520 0x20>;
+ compatible = "fsl,gianfar-mdio";
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ ethernet-phy@0 {
+ reg = <0>;
+ };
+ };
+ };
diff --git a/Documentation/devicetree/bindings/net/fsl-tsec-phy.txt b/Documentation/devicetree/bindings/net/fsl-tsec-phy.txt
index 9c9668c1b6a24edff7b7cf625b9f14c3cbc2e0c8..0e55e0af7d6f59cfb571dd3fcff704b7f4c140d2 100644
--- a/Documentation/devicetree/bindings/net/fsl-tsec-phy.txt
+++ b/Documentation/devicetree/bindings/net/fsl-tsec-phy.txt
@@ -1,47 +1,10 @@
* MDIO IO device
-The MDIO is a bus to which the PHY devices are connected. For each
-device that exists on this bus, a child node should be created. See
-the definition of the PHY node in booting-without-of.txt for an example
-of how to define a PHY.
-
-Required properties:
- - reg : Offset and length of the register set for the device, and optionally
- the offset and length of the TBIPA register (TBI PHY address
- register). If TBIPA register is not specified, the driver will
- attempt to infer it from the register set specified (your mileage may
- vary).
- - compatible : Should define the compatible device type for the
- mdio. Currently supported strings/devices are:
- - "fsl,gianfar-tbi"
- - "fsl,gianfar-mdio"
- - "fsl,etsec2-tbi"
- - "fsl,etsec2-mdio"
- - "fsl,ucc-mdio"
- - "fsl,fman-mdio"
- When device_type is "mdio", the following strings are also considered:
- - "gianfar"
- - "ucc_geth_phy"
-
-Example:
-
- mdio@24520 {
- reg = <24520 20>;
- compatible = "fsl,gianfar-mdio";
-
- ethernet-phy@0 {
- ......
- };
- };
+Refer to Documentation/devicetree/bindings/net/fsl,gianfar-mdio.yaml
* TBI Internal MDIO bus
-As of this writing, every tsec is associated with an internal TBI PHY.
-This PHY is accessed through the local MDIO bus. These buses are defined
-similarly to the mdio buses, except they are compatible with "fsl,gianfar-tbi".
-The TBI PHYs underneath them are similar to normal PHYs, but the reg property
-is considered instructive, rather than descriptive. The reg property should
-be chosen so it doesn't interfere with other PHYs on the bus.
+Refer to Documentation/devicetree/bindings/net/fsl,gianfar-mdio.yaml
* Gianfar-compatible ethernet nodes
--
2.48.0.rc1.219.gb6b6757d772
On Thu, Feb 20, 2025 at 06:29:21PM +0100, J. Neuschäfer wrote:
> Move the information related to the Freescale Gianfar (TSEC) MDIO bus
> and the Ten-Bit Interface (TBI) from fsl-tsec-phy.txt to a new binding
> file in YAML format, fsl,gianfar-mdio.yaml.
>
> Signed-off-by: J. Neuschäfer <j.ne@posteo.net>
> ---
>
> dt-bindings: net: Convert fsl,gianfar-tbi to YAML
> ---
> .../devicetree/bindings/net/fsl,gianfar-mdio.yaml | 94 ++++++++++++++++++++++
> .../devicetree/bindings/net/fsl-tsec-phy.txt | 41 +---------
> 2 files changed, 96 insertions(+), 39 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/net/fsl,gianfar-mdio.yaml b/Documentation/devicetree/bindings/net/fsl,gianfar-mdio.yaml
> new file mode 100644
> index 0000000000000000000000000000000000000000..2dade7f48c366b7f5c7408e1f7de1a6f5fc80787
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/fsl,gianfar-mdio.yaml
> @@ -0,0 +1,94 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/fsl,gianfar-mdio.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Freescale Gianfar (TSEC) MDIO Device
> +
> +description:
> + This binding describes the MDIO is a bus to which the PHY devices are
> + connected. For each device that exists on this bus, a child node should be
> + created.
> +
> + As of this writing, every TSEC is associated with an internal Ten-Bit
> + Interface (TBI) PHY. This PHY is accessed through the local MDIO bus. These
> + buses are defined similarly to the mdio buses, except they are compatible
> + with "fsl,gianfar-tbi". The TBI PHYs underneath them are similar to normal
> + PHYs, but the reg property is considered instructive, rather than
> + descriptive. The reg property should be chosen so it doesn't interfere with
> + other PHYs on the bus.
> +
> +maintainers:
> + - J. Neuschäfer <j.ne@posteo.net>
> +
> +properties:
> + compatible:
> + enum:
> + - fsl,gianfar-tbi
> + - fsl,gianfar-mdio
> + - fsl,etsec2-tbi
> + - fsl,etsec2-mdio
> + - fsl,ucc-mdio
> + - gianfar
Can you just comment out this to avoid the duplicate issue.
Though I think if you write a custom 'select' which looks for
'device_type = "mdio"' with gianfar compatible and similar in the other
binding, then the warning will go away.
> + - ucc_geth_phy
> +
> + reg:
> + minItems: 1
> + items:
> + - description:
> + Offset and length of the register set for the device
> +
> + - description:
> + Optionally, the offset and length of the TBIPA register (TBI PHY
> + address register). If TBIPA register is not specified, the driver
> + will attempt to infer it from the register set specified (your
> + mileage may vary).
> +
> + device_type:
> + const: mdio
> +
> + "#address-cells":
> + const: 1
> +
> + "#size-cells":
> + const: 0
These are defined in mdio.yaml, so drop them here.
> +
> +required:
> + - reg
> + - "#address-cells"
> + - "#size-cells"
> +
> +allOf:
> + - $ref: mdio.yaml#
> +
> + - if:
> + properties:
> + compatible:
> + contains:
> + enum:
> + - gianfar
> + - ucc_geth_phy
> + then:
> + required:
> + - device_type
Essentially, move this to the 'select' schema and add that property
device_type must be 'mdio'. You won't need it here anymore because it
had to be true for the schema to be applied.
> +
> +unevaluatedProperties: false
> +
> +examples:
> + - |
> + soc {
> + #address-cells = <1>;
> + #size-cells = <1>;
> +
> + mdio@24520 {
> + reg = <0x24520 0x20>;
> + compatible = "fsl,gianfar-mdio";
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + ethernet-phy@0 {
> + reg = <0>;
> + };
> + };
> + };
> diff --git a/Documentation/devicetree/bindings/net/fsl-tsec-phy.txt b/Documentation/devicetree/bindings/net/fsl-tsec-phy.txt
> index 9c9668c1b6a24edff7b7cf625b9f14c3cbc2e0c8..0e55e0af7d6f59cfb571dd3fcff704b7f4c140d2 100644
> --- a/Documentation/devicetree/bindings/net/fsl-tsec-phy.txt
> +++ b/Documentation/devicetree/bindings/net/fsl-tsec-phy.txt
> @@ -1,47 +1,10 @@
> * MDIO IO device
>
> -The MDIO is a bus to which the PHY devices are connected. For each
> -device that exists on this bus, a child node should be created. See
> -the definition of the PHY node in booting-without-of.txt for an example
> -of how to define a PHY.
> -
> -Required properties:
> - - reg : Offset and length of the register set for the device, and optionally
> - the offset and length of the TBIPA register (TBI PHY address
> - register). If TBIPA register is not specified, the driver will
> - attempt to infer it from the register set specified (your mileage may
> - vary).
> - - compatible : Should define the compatible device type for the
> - mdio. Currently supported strings/devices are:
> - - "fsl,gianfar-tbi"
> - - "fsl,gianfar-mdio"
> - - "fsl,etsec2-tbi"
> - - "fsl,etsec2-mdio"
> - - "fsl,ucc-mdio"
> - - "fsl,fman-mdio"
> - When device_type is "mdio", the following strings are also considered:
> - - "gianfar"
> - - "ucc_geth_phy"
> -
> -Example:
> -
> - mdio@24520 {
> - reg = <24520 20>;
> - compatible = "fsl,gianfar-mdio";
> -
> - ethernet-phy@0 {
> - ......
> - };
> - };
> +Refer to Documentation/devicetree/bindings/net/fsl,gianfar-mdio.yaml
>
> * TBI Internal MDIO bus
>
> -As of this writing, every tsec is associated with an internal TBI PHY.
> -This PHY is accessed through the local MDIO bus. These buses are defined
> -similarly to the mdio buses, except they are compatible with "fsl,gianfar-tbi".
> -The TBI PHYs underneath them are similar to normal PHYs, but the reg property
> -is considered instructive, rather than descriptive. The reg property should
> -be chosen so it doesn't interfere with other PHYs on the bus.
> +Refer to Documentation/devicetree/bindings/net/fsl,gianfar-mdio.yaml
>
> * Gianfar-compatible ethernet nodes
>
>
> --
> 2.48.0.rc1.219.gb6b6757d772
>
On Fri, Feb 21, 2025 at 10:36:51AM -0600, Rob Herring wrote: > On Thu, Feb 20, 2025 at 06:29:21PM +0100, J. Neuschäfer wrote: > > Move the information related to the Freescale Gianfar (TSEC) MDIO bus > > and the Ten-Bit Interface (TBI) from fsl-tsec-phy.txt to a new binding > > file in YAML format, fsl,gianfar-mdio.yaml. > > > > Signed-off-by: J. Neuschäfer <j.ne@posteo.net> > > --- [...] > > +properties: > > + compatible: > > + enum: > > + - fsl,gianfar-tbi > > + - fsl,gianfar-mdio > > + - fsl,etsec2-tbi > > + - fsl,etsec2-mdio > > + - fsl,ucc-mdio > > + - gianfar > > Can you just comment out this to avoid the duplicate issue. > > Though I think if you write a custom 'select' which looks for > 'device_type = "mdio"' with gianfar compatible and similar in the other > binding, then the warning will go away. I'm not sure how the 'select' syntax works, is there a reference document I could read? > > > + - ucc_geth_phy > > + > > + reg: > > + minItems: 1 > > + items: > > + - description: > > + Offset and length of the register set for the device > > + > > + - description: > > + Optionally, the offset and length of the TBIPA register (TBI PHY > > + address register). If TBIPA register is not specified, the driver > > + will attempt to infer it from the register set specified (your > > + mileage may vary). > > + > > + device_type: > > + const: mdio > > + > > > + "#address-cells": > > + const: 1 > > + > > + "#size-cells": > > + const: 0 > > These are defined in mdio.yaml, so drop them here. Will do. > > > + > > +required: > > + - reg > > + - "#address-cells" > > + - "#size-cells" > > + > > +allOf: > > + - $ref: mdio.yaml# > > + > > + - if: > > + properties: > > + compatible: > > + contains: > > + enum: > > + - gianfar > > + - ucc_geth_phy > > + then: > > + required: > > + - device_type > > Essentially, move this to the 'select' schema and add that property > device_type must be 'mdio'. You won't need it here anymore because it > had to be true for the schema to be applied. I'll have to read up on how select works. Best Regards, J. Neuschäfer
On Mon, Feb 24, 2025 at 08:58:19PM +0000, J. Neuschäfer wrote:
> On Fri, Feb 21, 2025 at 10:36:51AM -0600, Rob Herring wrote:
> > On Thu, Feb 20, 2025 at 06:29:21PM +0100, J. Neuschäfer wrote:
> > > Move the information related to the Freescale Gianfar (TSEC) MDIO bus
> > > and the Ten-Bit Interface (TBI) from fsl-tsec-phy.txt to a new binding
> > > file in YAML format, fsl,gianfar-mdio.yaml.
> > >
> > > Signed-off-by: J. Neuschäfer <j.ne@posteo.net>
> > > ---
> [...]
> > > +properties:
> > > + compatible:
> > > + enum:
> > > + - fsl,gianfar-tbi
> > > + - fsl,gianfar-mdio
> > > + - fsl,etsec2-tbi
> > > + - fsl,etsec2-mdio
> > > + - fsl,ucc-mdio
> > > + - gianfar
> >
> > Can you just comment out this to avoid the duplicate issue.
> >
> > Though I think if you write a custom 'select' which looks for
> > 'device_type = "mdio"' with gianfar compatible and similar in the other
> > binding, then the warning will go away.
>
> I'm not sure how the 'select' syntax works, is there a reference
> document I could read?
Ok, I think I figured it out, this seems to work as intended:
select:
oneOf:
- properties:
compatible:
enum:
- fsl,gianfar-tbi
- fsl,gianfar-mdio
- fsl,etsec2-tbi
- fsl,etsec2-mdio
- fsl,ucc-mdio
required:
- compatible
- properties:
compatible:
enum:
- gianfar
- ucc_geth_phy
device_type:
const: mdio
required:
- compatible
- device_type
properties:
compatible:
enum:
- fsl,gianfar-tbi
- fsl,gianfar-mdio
- fsl,etsec2-tbi
- fsl,etsec2-mdio
- fsl,ucc-mdio
- gianfar
- ucc_geth_phy
reg:
...
Best regards,
J. Neuschäfer
On Tue, Feb 25, 2025 at 11:12:42AM +0000, J. Neuschäfer wrote: > On Mon, Feb 24, 2025 at 08:58:19PM +0000, J. Neuschäfer wrote: > > On Fri, Feb 21, 2025 at 10:36:51AM -0600, Rob Herring wrote: > > > On Thu, Feb 20, 2025 at 06:29:21PM +0100, J. Neuschäfer wrote: > > > > Move the information related to the Freescale Gianfar (TSEC) MDIO bus > > > > and the Ten-Bit Interface (TBI) from fsl-tsec-phy.txt to a new binding > > > > file in YAML format, fsl,gianfar-mdio.yaml. > > > > > > > > Signed-off-by: J. Neuschäfer <j.ne@posteo.net> > > > > --- > > [...] > > > > +properties: > > > > + compatible: > > > > + enum: > > > > + - fsl,gianfar-tbi > > > > + - fsl,gianfar-mdio > > > > + - fsl,etsec2-tbi > > > > + - fsl,etsec2-mdio > > > > + - fsl,ucc-mdio > > > > + - gianfar > > > > > > Can you just comment out this to avoid the duplicate issue. > > > > > > Though I think if you write a custom 'select' which looks for > > > 'device_type = "mdio"' with gianfar compatible and similar in the other > > > binding, then the warning will go away. > > > > I'm not sure how the 'select' syntax works, is there a reference > > document I could read? > > Ok, I think I figured it out, this seems to work as intended: > Looks pretty good. > > select: > oneOf: > - properties: > compatible: Add "contains" here. That way if someone puts another string in with these we still match and then throw a warning. > enum: > - fsl,gianfar-tbi > - fsl,gianfar-mdio > - fsl,etsec2-tbi > - fsl,etsec2-mdio > - fsl,ucc-mdio > > required: > - compatible > > - properties: > compatible: > enum: > - gianfar > - ucc_geth_phy You could move ucc_geth_phy because there's not a collision with it. Add a comment somewhere that this is all because of a reuse of gianfar. > device_type: > const: mdio > > required: > - compatible > - device_type You can move 'required: [compatible]' out of the oneOf. > > properties: > compatible: > enum: > - fsl,gianfar-tbi > - fsl,gianfar-mdio > - fsl,etsec2-tbi > - fsl,etsec2-mdio > - fsl,ucc-mdio > - gianfar > - ucc_geth_phy > > reg: > ... > > > > Best regards, > J. Neuschäfer
On Wed, Feb 26, 2025 at 07:31:14AM -0600, Rob Herring wrote: > On Tue, Feb 25, 2025 at 11:12:42AM +0000, J. Neuschäfer wrote: > > On Mon, Feb 24, 2025 at 08:58:19PM +0000, J. Neuschäfer wrote: > > > On Fri, Feb 21, 2025 at 10:36:51AM -0600, Rob Herring wrote: > > > > On Thu, Feb 20, 2025 at 06:29:21PM +0100, J. Neuschäfer wrote: > > > > > Move the information related to the Freescale Gianfar (TSEC) MDIO bus > > > > > and the Ten-Bit Interface (TBI) from fsl-tsec-phy.txt to a new binding > > > > > file in YAML format, fsl,gianfar-mdio.yaml. > > > > > > > > > > Signed-off-by: J. Neuschäfer <j.ne@posteo.net> > > > > > --- > > > [...] > > > > > +properties: > > > > > + compatible: > > > > > + enum: > > > > > + - fsl,gianfar-tbi > > > > > + - fsl,gianfar-mdio > > > > > + - fsl,etsec2-tbi > > > > > + - fsl,etsec2-mdio > > > > > + - fsl,ucc-mdio > > > > > + - gianfar > > > > > > > > Can you just comment out this to avoid the duplicate issue. > > > > > > > > Though I think if you write a custom 'select' which looks for > > > > 'device_type = "mdio"' with gianfar compatible and similar in the other > > > > binding, then the warning will go away. > > > > > > I'm not sure how the 'select' syntax works, is there a reference > > > document I could read? > > > > Ok, I think I figured it out, this seems to work as intended: > > > > Looks pretty good. > > > > > select: > > oneOf: > > - properties: > > compatible: > > Add "contains" here. That way if someone puts another string in with > these we still match and then throw a warning. Good idea. > > > enum: > > - fsl,gianfar-tbi > > - fsl,gianfar-mdio > > - fsl,etsec2-tbi > > - fsl,etsec2-mdio > > - fsl,ucc-mdio > > > > required: > > - compatible > > > > - properties: > > compatible: > > enum: > > - gianfar > > - ucc_geth_phy > > You could move ucc_geth_phy because there's not a collision with it. ucc_geth_phy also requires device_type = "mdio". It is more compact to write it like this, but perhaps clarity wins out here, and this requirement should be expressed with an "if:"? > Add a comment somewhere that this is all because of a reuse of gianfar. Will do. > > > device_type: > > const: mdio > > > > required: > > - compatible > > - device_type > > You can move 'required: [compatible]' out of the oneOf. Will do. Thanks, J. Neuschäfer
On Wed, Feb 26, 2025 at 02:59:06PM +0000, J. Neuschäfer wrote: > On Wed, Feb 26, 2025 at 07:31:14AM -0600, Rob Herring wrote: > > On Tue, Feb 25, 2025 at 11:12:42AM +0000, J. Neuschäfer wrote: > > > On Mon, Feb 24, 2025 at 08:58:19PM +0000, J. Neuschäfer wrote: > > > > On Fri, Feb 21, 2025 at 10:36:51AM -0600, Rob Herring wrote: > > > > > On Thu, Feb 20, 2025 at 06:29:21PM +0100, J. Neuschäfer wrote: > > > > > > Move the information related to the Freescale Gianfar (TSEC) MDIO bus > > > > > > and the Ten-Bit Interface (TBI) from fsl-tsec-phy.txt to a new binding > > > > > > file in YAML format, fsl,gianfar-mdio.yaml. > > > > > > > > > > > > Signed-off-by: J. Neuschäfer <j.ne@posteo.net> > > > > > > --- > > > > [...] > > > > > > +properties: > > > > > > + compatible: > > > > > > + enum: > > > > > > + - fsl,gianfar-tbi > > > > > > + - fsl,gianfar-mdio > > > > > > + - fsl,etsec2-tbi > > > > > > + - fsl,etsec2-mdio > > > > > > + - fsl,ucc-mdio > > > > > > + - gianfar > > > > > > > > > > Can you just comment out this to avoid the duplicate issue. > > > > > > > > > > Though I think if you write a custom 'select' which looks for > > > > > 'device_type = "mdio"' with gianfar compatible and similar in the other > > > > > binding, then the warning will go away. > > > > > > > > I'm not sure how the 'select' syntax works, is there a reference > > > > document I could read? > > > > > > Ok, I think I figured it out, this seems to work as intended: > > > > > > > Looks pretty good. > > > > > > > > select: > > > oneOf: > > > - properties: > > > compatible: > > > > Add "contains" here. That way if someone puts another string in with > > these we still match and then throw a warning. > > Good idea. > > > > > > enum: > > > - fsl,gianfar-tbi > > > - fsl,gianfar-mdio > > > - fsl,etsec2-tbi > > > - fsl,etsec2-mdio > > > - fsl,ucc-mdio > > > > > > required: > > > - compatible > > > > > > - properties: > > > compatible: > > > enum: > > > - gianfar > > > - ucc_geth_phy > > > > You could move ucc_geth_phy because there's not a collision with it. > > ucc_geth_phy also requires device_type = "mdio". It is more compact > to write it like this, but perhaps clarity wins out here, and this > requirement should be expressed with an "if:"? Yes, an if/then schema outside of the select would be fine. Rob
© 2016 - 2025 Red Hat, Inc.