Commit 4117b5be authored by Kapil Juneja's avatar Kapil Juneja Committed by Jeff Garzik

phylib: m88e1111: enable SGMII mode

If connected via SGMII, initialize with SGMII mode configured.
Signed-off-by: default avatarKapil Juneja <Kapil.Juneja@freescale.com>
Signed-off-by: default avatarAndy Fleming <afleming@freescale.com>
Signed-off-by: default avatarKim Phillips <kim.phillips@freescale.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent d3c12873
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
#define MII_M1111_PHY_EXT_SR 0x1b #define MII_M1111_PHY_EXT_SR 0x1b
#define MII_M1111_HWCFG_MODE_MASK 0xf #define MII_M1111_HWCFG_MODE_MASK 0xf
#define MII_M1111_HWCFG_MODE_RGMII 0xb #define MII_M1111_HWCFG_MODE_RGMII 0xb
#define MII_M1111_HWCFG_MODE_SGMII_NO_CLK 0x4
MODULE_DESCRIPTION("Marvell PHY driver"); MODULE_DESCRIPTION("Marvell PHY driver");
MODULE_AUTHOR("Andy Fleming"); MODULE_AUTHOR("Andy Fleming");
...@@ -169,6 +170,21 @@ static int m88e1111_config_init(struct phy_device *phydev) ...@@ -169,6 +170,21 @@ static int m88e1111_config_init(struct phy_device *phydev)
return err; return err;
} }
if (phydev->interface == PHY_INTERFACE_MODE_SGMII) {
int temp;
temp = phy_read(phydev, MII_M1111_PHY_EXT_SR);
if (temp < 0)
return temp;
temp &= ~(MII_M1111_HWCFG_MODE_MASK);
temp |= MII_M1111_HWCFG_MODE_SGMII_NO_CLK;
err = phy_write(phydev, MII_M1111_PHY_EXT_SR, temp);
if (err < 0)
return err;
}
err = phy_write(phydev, MII_BMCR, BMCR_RESET); err = phy_write(phydev, MII_BMCR, BMCR_RESET);
if (err < 0) if (err < 0)
return err; return err;
......
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