diff mbox series

[v2,15/21] dt-bindings: net: Update Freescale TSEC to support "queue-group"

Message ID 20210312133602.31105-16-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
At present the Freescale TSEC node DT bindings doc requires a <reg>
property in the TSEC node. But this might not always be the case.
In the upstream Linux kernel, there is no DT bindings doc for it
but the kernel driver tests a subnode of a name prefixed with
"queue-group", as we can see from gfar_of_init():

  for_each_available_child_of_node(np, child) {
      if (!of_node_name_eq(child, "queue-group"))
  ...

in drivers/net/ethernet/freescale/gianfar.c

Update our DT bindings to describe this alternate description.

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/fsl-tsec-phy.txt | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

Comments

Vladimir Oltean March 13, 2021, 12:50 p.m. UTC | #1
On Fri, Mar 12, 2021 at 09:35:56PM +0800, Bin Meng wrote:
> At present the Freescale TSEC node DT bindings doc requires a <reg>
> property in the TSEC node. But this might not always be the case.
> In the upstream Linux kernel, there is no DT bindings doc for it
> but the kernel driver tests a subnode of a name prefixed with
> "queue-group", as we can see from gfar_of_init():
> 
>   for_each_available_child_of_node(np, child) {
>       if (!of_node_name_eq(child, "queue-group"))
>   ...
> 
> in drivers/net/ethernet/freescale/gianfar.c
> 
> Update our DT bindings to describe this alternate description.
> 
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
> ---

Fascinating. I did not even notice that the Linux DT bindings do not
have a "reg" property and rely on "ranges" for translation to the
queue-group. I guess that changes things. I'll go again through the
patches starting from the first one.
diff mbox series

Patch

diff --git a/doc/device-tree-bindings/net/fsl-tsec-phy.txt b/doc/device-tree-bindings/net/fsl-tsec-phy.txt
index a44c5fd9d9..2f9309839c 100644
--- a/doc/device-tree-bindings/net/fsl-tsec-phy.txt
+++ b/doc/device-tree-bindings/net/fsl-tsec-phy.txt
@@ -3,7 +3,9 @@ 
 Properties:
 
   - compatible : Should be "fsl,etsec2" or "gianfar"
-  - reg : Offset and length of the register set for the device
+  - reg : Offset and length of the register set for the device. If this is
+    missing, a subnode with a name prefix "queue-group" must be provided to
+    provide the <reg> property.
   - phy-handle : See ethernet.txt file in the same directory.
   - phy-connection-type : See ethernet.txt file in the same directory. This
     property is only really needed if the connection is of type "rgmii-id",
@@ -18,6 +20,17 @@  Example:
 		phy-connection-type = "sgmii";
 	};
 
+An alternate description with "queue-group" subnode example:
+	ethernet@24000 {
+		compatible = "fsl,etsec2";
+		phy-handle = <&phy0>;
+		phy-connection-type = "sgmii";
+
+		queue-group {
+			reg = <0x24000 0x1000>;
+		};
+	};
+
 Child nodes of the TSEC controller are typically the individual PHY devices
 connected via the MDIO bus (sometimes the MDIO bus controller is separate).