From patchwork Wed Jul 1 16:58:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhiqiang Hou X-Patchwork-Id: 240565 List-Id: U-Boot discussion From: Zhiqiang.Hou at nxp.com (Zhiqiang Hou) Date: Thu, 2 Jul 2020 00:58:45 +0800 Subject: [PATCHv4 04/16] net: tsec: Add fixed-link PHY support In-Reply-To: <20200701165857.39930-1-Zhiqiang.Hou@nxp.com> References: <20200701165857.39930-1-Zhiqiang.Hou@nxp.com> Message-ID: <20200701165857.39930-5-Zhiqiang.Hou@nxp.com> From: Hou Zhiqiang 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 Signed-off-by: Hou Zhiqiang --- V4: - New patch. drivers/net/tsec.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c index babe44691e..cb3e56d439 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);