Subject: [PATCH net-next 2/2] dt-bindings: ethernet-phy: define `supported-mac-connection-types` property

From: Marek Behún <[email-masked]>
Date: Wed, 24 Mar 2021 11:35:56 +0100

An ethernet PHY may support PHY interface modes that are not wired on a
specific board (or are broken for some other reason).

For example the Marvell 88X3310 PHY supports connecting the MAC with the
PHY with `xaui` and `rxaui`, the MAC can also support these modes, but
it is possible for a board not to have them wired (since these modes use
multiple SerDes lanes).

In order for the kernel to know which modes are supported on the board,
we need to specify them in the device tree.

Define a new ethernet PHY property `supported-mac-connection-types`,
which lists the supported modes. If this property is missing, all modes
supported by the PHY and MAC are presumed to be supported by the board.

Signed-off-by: Marek Behún <[email-masked]>
---
 .../devicetree/bindings/net/ethernet-phy.yaml  | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/ethernet-phy.yaml b/Documentation/devicetree/bindings/net/ethernet-phy.yaml
index 2766fe45bb98..3706760b5637 100644
--- a/Documentation/devicetree/bindings/net/ethernet-phy.yaml
+++ b/Documentation/devicetree/bindings/net/ethernet-phy.yaml
@@ -136,6 +136,23 @@ properties:
       used. The absence of this property indicates the muxers
       should be configured so that the external PHY is used.
 
+  supported-mac-connection-types:
+    $ref: "ethernet-controller.yaml#/$defs/phy-connection-type-array"
+    description:
+      The PHY device may support different interface types for
+      connecting the Ethernet MAC device to the PHY device (i.e.
+      rgmii, sgmii, xaui, ...), but not all of these interface
+      types must necessarily be supported for a specific board
+      (not all of them are wired, or there may be some known bug
+      for a specific mode, ...).
+      This property specifies a list of interface modes to the
+      MAC supported by the PHY hardware that are also supported
+      by the board.
+      If this property is missing, all modes supported by the
+      PHY are presumend to be supported by the board.
+    minItems: 1
+    maxItems: 64
+
   resets:
     maxItems: 1
 
@@ -196,5 +213,6 @@ examples:
             reset-gpios = <&gpio1 4 1>;
             reset-assert-us = <1000>;
             reset-deassert-us = <2000>;
+            supported-mac-connection-types = "xaui", "rxaui";
         };
     };
-- 
2.26.2