diff mbox series

[v2,01/21] dt-bindings: net: Add the old DT bindings for "fixed-link"

Message ID 20210312133602.31105-2-bmeng.cn@gmail.com
State Superseded
Delegated to: Priyanka Jain
Headers show
Series ppc: qemu: Add eTSEC support | expand

Commit Message

Bin Meng March 12, 2021, 1:35 p.m. UTC
Per the upstream Linux kernel doc:

  Documentation/devicetree/bindings/net/ethernet-controller.yaml

There are two ways to describe a fixed PHY attached to an Ethernet
device. This updates our dt-bindings doc to add the old DT bindings.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
---

(no changes since v1)

 doc/device-tree-bindings/net/fixed-link.txt | 47 +++++++++++++++------
 1 file changed, 35 insertions(+), 12 deletions(-)

Comments

Vladimir Oltean March 13, 2021, 12:10 p.m. UTC | #1
On Fri, Mar 12, 2021 at 09:35:42PM +0800, Bin Meng wrote:
> Per the upstream Linux kernel doc:
> 
>   Documentation/devicetree/bindings/net/ethernet-controller.yaml
> 
> There are two ways to describe a fixed PHY attached to an Ethernet
> device. This updates our dt-bindings doc to add the old DT bindings.
> 
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
> ---

Why?
Do we even parse the old-style bindings? And if so, where?
Vladimir Oltean March 13, 2021, 12:59 p.m. UTC | #2
On Fri, Mar 12, 2021 at 09:35:42PM +0800, Bin Meng wrote:
> +- The old DT binding, where 'fixed-link' is a property with 5 cells
> +  encoding various information about the fixed PHY, in the form of
> +  <phy_id, full-duplex, speed, pause, asym-pause>.
> +
> +  * 'phy_id', emulated PHY ID, choose any but unique to the all specified
> +    fixed-links

Could you please explicitly state that U-Boot deliberately ignores the
phy_id and unconditionally uses PHY_FIXED_ID? It would be suicidal to do
anything else (and I see Linux ignores fixed_link_prop[0] too), but at
least we should be upfront about it.

> +  * 'full-duplex', 0 for half duplex or 1 for full duplex
> +  * 'speed', link speed in Mbits/sec, accepts only 10, 100 and 1000
> +  * 'pause', 0 for no pause, 1 for pause
> +  * 'asym-pause', 0 for no asymmetric pause, 1 for asymmetric pause

Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
diff mbox series

Patch

diff --git a/doc/device-tree-bindings/net/fixed-link.txt b/doc/device-tree-bindings/net/fixed-link.txt
index 5829bd81a2..71ab480701 100644
--- a/doc/device-tree-bindings/net/fixed-link.txt
+++ b/doc/device-tree-bindings/net/fixed-link.txt
@@ -5,21 +5,36 @@  Some Ethernet MACs have a "fixed link", and are not connected to a
 normal MDIO-managed PHY device. For those situations, a Device Tree
 binding allows to describe a "fixed link".
 
-Such a fixed link situation is described by creating a 'fixed-link'
-sub-node of the Ethernet MAC device node, with the following
-properties:
-
-* 'speed' (integer, mandatory), to indicate the link speed. Accepted
-  values are 10, 100 and 1000
-* 'full-duplex' (boolean, optional), to indicate that full duplex is
-  used. When absent, half duplex is assumed.
-* 'pause' (boolean, optional), to indicate that pause should be
-  enabled.
-* 'asym-pause' (boolean, optional), to indicate that asym_pause should
-  be enabled.
+Note there are two ways to describe a fixed PHY attached to an
+Ethernet device:
+
+- The new DT binding, where 'fixed-link' is a sub-node of the Ethernet
+  MAC device node, with the following properties:
+
+  * 'speed' (integer, mandatory), to indicate the link speed. Accepted
+    values are 10, 100 and 1000
+  * 'full-duplex' (boolean, optional), to indicate that full duplex is
+    used. When absent, half duplex is assumed.
+  * 'pause' (boolean, optional), to indicate that pause should be
+    enabled.
+  * 'asym-pause' (boolean, optional), to indicate that asym_pause should
+    be enabled.
+
+- The old DT binding, where 'fixed-link' is a property with 5 cells
+  encoding various information about the fixed PHY, in the form of
+  <phy_id, full-duplex, speed, pause, asym-pause>.
+
+  * 'phy_id', emulated PHY ID, choose any but unique to the all specified
+    fixed-links
+  * 'full-duplex', 0 for half duplex or 1 for full duplex
+  * 'speed', link speed in Mbits/sec, accepts only 10, 100 and 1000
+  * 'pause', 0 for no pause, 1 for pause
+  * 'asym-pause', 0 for no asymmetric pause, 1 for asymmetric pause
 
 Examples:
 
+The new binding:
+
 ethernet@0 {
 	...
 	fixed-link {
@@ -28,3 +43,11 @@  ethernet@0 {
 	};
 	...
 };
+
+The old binding:
+
+ethernet@0 {
+	...
+	fixed-link = <0 1 1000 0 0>;
+	...
+};