Commit 00f55366 authored by Dan Murphy's avatar Dan Murphy Committed by David S. Miller

net: phy: DP83TC811: Fix SGMII enable/disable

If SGMII was selected in the DT then the device should
write the SGMII enable bit.

If SGMII is not selected in the DT then the SGMII bit
should be disabled.
Signed-off-by: default avatarDan Murphy <dmurphy@ti.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 42036383
...@@ -284,21 +284,19 @@ static int dp83811_config_init(struct phy_device *phydev) ...@@ -284,21 +284,19 @@ static int dp83811_config_init(struct phy_device *phydev)
if (err < 0) if (err < 0)
return err; return err;
value = phy_read(phydev, MII_DP83811_SGMII_CTRL);
if (phydev->interface == PHY_INTERFACE_MODE_SGMII) { if (phydev->interface == PHY_INTERFACE_MODE_SGMII) {
value = phy_read(phydev, MII_DP83811_SGMII_CTRL); err = phy_write(phydev, MII_DP83811_SGMII_CTRL,
if (!(value & DP83811_SGMII_EN)) {
err = phy_write(phydev, MII_DP83811_SGMII_CTRL,
(DP83811_SGMII_EN | value)); (DP83811_SGMII_EN | value));
if (err < 0) } else {
return err; err = phy_write(phydev, MII_DP83811_SGMII_CTRL,
} else { (~DP83811_SGMII_EN & value));
err = phy_write(phydev, MII_DP83811_SGMII_CTRL,
(~DP83811_SGMII_EN & value));
if (err < 0)
return err;
}
} }
if (err < 0)
return err;
value = DP83811_WOL_MAGIC_EN | DP83811_WOL_SECURE_ON | DP83811_WOL_EN; value = DP83811_WOL_MAGIC_EN | DP83811_WOL_SECURE_ON | DP83811_WOL_EN;
return phy_write_mmd(phydev, DP83811_DEVADDR, MII_DP83811_WOL_CFG, return phy_write_mmd(phydev, DP83811_DEVADDR, MII_DP83811_WOL_CFG,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment