* [RFC PATCH] dt-bindings: net: nxp,tja11xx: add compatible support
@ 2020-05-04 8:26 Oleksij Rempel
2020-05-04 8:44 ` Oleksij Rempel
0 siblings, 1 reply; 3+ messages in thread
From: Oleksij Rempel @ 2020-05-04 8:26 UTC (permalink / raw)
To: Andrew Lunn, Florian Fainelli, Heiner Kallweit, Mark Rutland,
Rob Herring
Cc: Oleksij Rempel, Pengutronix Kernel Team, linux-kernel,
David S. Miller, netdev, Marek Vasut, David Jander, devicetree
... and correct SPDX-License-Identifier.
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
.../devicetree/bindings/net/nxp,tja11xx.yaml | 51 ++++++++++++-------
1 file changed, 32 insertions(+), 19 deletions(-)
diff --git a/Documentation/devicetree/bindings/net/nxp,tja11xx.yaml b/Documentation/devicetree/bindings/net/nxp,tja11xx.yaml
index 42be0255512b3..e4ae8257f3258 100644
--- a/Documentation/devicetree/bindings/net/nxp,tja11xx.yaml
+++ b/Documentation/devicetree/bindings/net/nxp,tja11xx.yaml
@@ -1,4 +1,4 @@
-# SPDX-License-Identifier: GPL-2.0+
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/net/nxp,tja11xx.yaml#
@@ -14,25 +14,36 @@ maintainers:
description:
Bindings for NXP TJA11xx automotive PHYs
-allOf:
- - $ref: ethernet-phy.yaml#
+properties:
+ compatible:
+ oneOf:
+ - items:
+ - enum:
+ - nxp,tja1102
+ - const: ethernet-phy-ieee802.3-c22
-patternProperties:
- "^ethernet-phy@[0-9a-f]+$":
- type: object
- description: |
- Some packages have multiple PHYs. Secondary PHY should be defines as
- subnode of the first (parent) PHY.
+ $nodename:
+ pattern: "^ethernet-phy(@[a-f0-9]+)?$"
- properties:
- reg:
- minimum: 0
- maximum: 31
- description:
- The ID number for the child PHY. Should be +1 of parent PHY.
+ reg:
+ minimum: 0
+ maximum: 31
+ description:
+ The ID number for the child PHY. Should be +1 of parent PHY.
- required:
- - reg
+ '#address-cells':
+ description: number of address cells for the MDIO bus
+ const: 1
+
+ '#size-cells':
+ description: number of size cells on the MDIO bus
+ const: 0
+
+required:
+ - compatible
+ - reg
+ - '#address-cells'
+ - '#size-cells'
examples:
- |
@@ -40,8 +51,9 @@ examples:
#address-cells = <1>;
#size-cells = <0>;
- tja1101_phy0: ethernet-phy@4 {
- reg = <0x4>;
+ tja1101_phy0: ethernet-phy@1 {
+ compatible = "nxp,tja1101", "ethernet-phy-ieee802.3-c22";
+ reg = <0x1>;
};
};
- |
@@ -50,6 +62,7 @@ examples:
#size-cells = <0>;
tja1102_phy0: ethernet-phy@4 {
+ compatible = "nxp,tja1102", "ethernet-phy-ieee802.3-c22";
reg = <0x4>;
#address-cells = <1>;
#size-cells = <0>;
--
2.26.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [RFC PATCH] dt-bindings: net: nxp,tja11xx: add compatible support
2020-05-04 8:26 [RFC PATCH] dt-bindings: net: nxp,tja11xx: add compatible support Oleksij Rempel
@ 2020-05-04 8:44 ` Oleksij Rempel
2020-05-04 13:40 ` Andrew Lunn
0 siblings, 1 reply; 3+ messages in thread
From: Oleksij Rempel @ 2020-05-04 8:44 UTC (permalink / raw)
To: Andrew Lunn, Florian Fainelli, Heiner Kallweit, Mark Rutland,
Rob Herring
Cc: Pengutronix Kernel Team, linux-kernel, David S. Miller, netdev,
Marek Vasut, David Jander, devicetree
[-- Attachment #1: Type: text/plain, Size: 3695 bytes --]
Hi all,
here is first attempt to rework this binding. So far I have following
questions and/or issues:
- currently this PHY is identified by ID, not by compatible. Should it
be probed by compatible?
Theoretically I can use:
compatible = "nxp,tja1102", "ethernet-phy-ieee802.3-c22";
But till now this was used only for nodes with not clear support state
and seems to be not a welcome solution (at least till now).
- matching by node name patter seems to trigger warning by different
(not related) bindings. What is a best practice to avoid it?
Regards,
Oleksij
On Mon, May 04, 2020 at 10:26:17AM +0200, Oleksij Rempel wrote:
> ... and correct SPDX-License-Identifier.
>
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> ---
> .../devicetree/bindings/net/nxp,tja11xx.yaml | 51 ++++++++++++-------
> 1 file changed, 32 insertions(+), 19 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/net/nxp,tja11xx.yaml b/Documentation/devicetree/bindings/net/nxp,tja11xx.yaml
> index 42be0255512b3..e4ae8257f3258 100644
> --- a/Documentation/devicetree/bindings/net/nxp,tja11xx.yaml
> +++ b/Documentation/devicetree/bindings/net/nxp,tja11xx.yaml
> @@ -1,4 +1,4 @@
> -# SPDX-License-Identifier: GPL-2.0+
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> %YAML 1.2
> ---
> $id: http://devicetree.org/schemas/net/nxp,tja11xx.yaml#
> @@ -14,25 +14,36 @@ maintainers:
> description:
> Bindings for NXP TJA11xx automotive PHYs
>
> -allOf:
> - - $ref: ethernet-phy.yaml#
> +properties:
> + compatible:
> + oneOf:
> + - items:
> + - enum:
> + - nxp,tja1102
> + - const: ethernet-phy-ieee802.3-c22
>
> -patternProperties:
> - "^ethernet-phy@[0-9a-f]+$":
> - type: object
> - description: |
> - Some packages have multiple PHYs. Secondary PHY should be defines as
> - subnode of the first (parent) PHY.
> + $nodename:
> + pattern: "^ethernet-phy(@[a-f0-9]+)?$"
>
> - properties:
> - reg:
> - minimum: 0
> - maximum: 31
> - description:
> - The ID number for the child PHY. Should be +1 of parent PHY.
> + reg:
> + minimum: 0
> + maximum: 31
> + description:
> + The ID number for the child PHY. Should be +1 of parent PHY.
>
> - required:
> - - reg
> + '#address-cells':
> + description: number of address cells for the MDIO bus
> + const: 1
> +
> + '#size-cells':
> + description: number of size cells on the MDIO bus
> + const: 0
> +
> +required:
> + - compatible
> + - reg
> + - '#address-cells'
> + - '#size-cells'
>
> examples:
> - |
> @@ -40,8 +51,9 @@ examples:
> #address-cells = <1>;
> #size-cells = <0>;
>
> - tja1101_phy0: ethernet-phy@4 {
> - reg = <0x4>;
> + tja1101_phy0: ethernet-phy@1 {
> + compatible = "nxp,tja1101", "ethernet-phy-ieee802.3-c22";
> + reg = <0x1>;
> };
> };
> - |
> @@ -50,6 +62,7 @@ examples:
> #size-cells = <0>;
>
> tja1102_phy0: ethernet-phy@4 {
> + compatible = "nxp,tja1102", "ethernet-phy-ieee802.3-c22";
> reg = <0x4>;
> #address-cells = <1>;
> #size-cells = <0>;
> --
> 2.26.2
>
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFC PATCH] dt-bindings: net: nxp,tja11xx: add compatible support
2020-05-04 8:44 ` Oleksij Rempel
@ 2020-05-04 13:40 ` Andrew Lunn
0 siblings, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2020-05-04 13:40 UTC (permalink / raw)
To: Oleksij Rempel
Cc: Florian Fainelli, Heiner Kallweit, Mark Rutland, Rob Herring,
Pengutronix Kernel Team, linux-kernel, David S. Miller, netdev,
Marek Vasut, David Jander, devicetree
On Mon, May 04, 2020 at 10:44:12AM +0200, Oleksij Rempel wrote:
> Hi all,
>
> here is first attempt to rework this binding. So far I have following
> questions and/or issues:
> - currently this PHY is identified by ID, not by compatible. Should it
> be probed by compatible?
> Theoretically I can use:
> compatible = "nxp,tja1102", "ethernet-phy-ieee802.3-c22";
Hi Oleksij
This will not work, in the current framework. PHYs probe via the ID
registers, or ethernet-phy-id0141.0e90 like compatible strings. MDIO
devices, which means devices like Ethernet switches, probe via
compatible strings. There are a few old DT blobs which do have a
compatible for the PHY, but they are white listed and ignored. See
of_mdio.c, whitelist_phys and of_mdiobus_child_is_phy().
If the DT validation code is wrongly forcing you to have a compatible,
i think your best bet is to use the ethernet-phy-id with the correct
ID values.
Andrew
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-05-04 13:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-04 8:26 [RFC PATCH] dt-bindings: net: nxp,tja11xx: add compatible support Oleksij Rempel
2020-05-04 8:44 ` Oleksij Rempel
2020-05-04 13:40 ` Andrew Lunn
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).