From: Siva Durga Prasad Paladugu Date: Sun, 21 Feb 2016 10:16:15 +0000 (+0530) Subject: net: xilinx_axi: Clear Isolate bit if found set suring phy X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=39579875c8c128e723e2cafcc4c63eed3b1a12e1;p=thirdparty%2Fu-boot.git net: xilinx_axi: Clear Isolate bit if found set suring phy In SGMII cases the isolate bit might set after DMA and ethernet resets and hence check and clear during setup_phy if it was set. Signed-off-by: Siva Durga Prasad Paladugu Signed-off-by: Michal Simek --- diff --git a/drivers/net/xilinx_axi_emac.c b/drivers/net/xilinx_axi_emac.c index 74f9a693ef8..b50237e1f03 100644 --- a/drivers/net/xilinx_axi_emac.c +++ b/drivers/net/xilinx_axi_emac.c @@ -269,6 +269,23 @@ static int setup_phy(struct udevice *dev) struct axi_regs *regs = priv->iobase; struct phy_device *phydev = priv->phydev; + if (priv->interface == PHY_INTERFACE_MODE_SGMII) { + /* + * In SGMII cases the isolate bit might set + * after DMA and ethernet resets and hence + * check and clear if set. + */ + ret = phyread(priv, priv->phyaddr, MII_BMCR, &temp); + if (ret) + return 0; + if (temp & BMCR_ISOLATE) { + temp &= ~BMCR_ISOLATE; + ret = phywrite(priv, priv->phyaddr, MII_BMCR, temp); + if (ret) + return 0; + } + } + if (phy_startup(phydev)) { printf("axiemac: could not initialize PHY %s\n", phydev->dev->name);