]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
net: tsec: Add fixed-link PHY support
authorHou Zhiqiang <Zhiqiang.Hou@nxp.com>
Thu, 16 Jul 2020 10:09:13 +0000 (18:09 +0800)
committerTom Rini <trini@konsulko.com>
Thu, 24 Sep 2020 12:27:44 +0000 (08:27 -0400)
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>
[Rebased]
Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
drivers/net/tsec.c

index 6ca399532e2fb84f1a5ff97ede25ef0c55d231b3..af0d27a8e3324ceb8f28f3b629db58ea90a60e3a 100644 (file)
@@ -683,7 +683,10 @@ static int init_phy(struct tsec_private *priv)
                tsec_configure_serdes(priv);
 
 #if defined(CONFIG_DM_ETH) && defined(CONFIG_DM_MDIO)
-       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);