diff mbox series

[PATCHv6,05/18] net: tsec: Add fixed-link PHY support

Message ID 20200922092347.19141-6-Zhiqiang.Hou@nxp.com
State Not Applicable
Delegated to: Priyanka Jain
Headers show
Series powerpc: convert p1010, p1020 and p2020 RDB boards to DM_ETH | expand

Commit Message

Z.Q. Hou Sept. 22, 2020, 9:23 a.m. UTC
From: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>

The info of fixed-link PHY is described in DT node instead of
getting from MII, so detect the fixed-link PHY DT node first,
if it doesn't exist then probe the MII.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
---
V6:
 - No change.

 drivers/net/tsec.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c
index 9d68c6f829..1e04a89102 100644
--- a/drivers/net/tsec.c
+++ b/drivers/net/tsec.c
@@ -683,7 +683,10 @@  static int init_phy(struct tsec_private *priv)
 		tsec_configure_serdes(priv);
 
 #ifdef CONFIG_DM_ETH
-	phydev = dm_eth_phy_connect(priv->dev);
+	if (ofnode_valid(ofnode_find_subnode(priv->dev->node, "fixed-link")))
+		phydev = phy_connect(NULL, 0, priv->dev, priv->interface);
+	else
+		phydev = dm_eth_phy_connect(priv->dev);
 #else
 	phydev = phy_connect(priv->bus, priv->phyaddr, priv->dev,
 			     priv->interface);