phylib: m88e1111: enable SGMII mode
authorKapil Juneja <Kapil.Juneja@freescale.com>
Fri, 11 May 2007 23:25:18 +0000 (18:25 -0500)
committerJeff Garzik <jeff@garzik.org>
Mon, 9 Jul 2007 02:16:38 +0000 (22:16 -0400)
If connected via SGMII, initialize with SGMII mode configured.

Signed-off-by: Kapil Juneja <Kapil.Juneja@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/phy/marvell.c

index b87f8d2a888bb409af90e36a99662c2310ad54d3..fbe1104e9a07aa158c601170bcb63bb16140b1b5 100644 (file)
@@ -60,6 +60,7 @@
 #define MII_M1111_PHY_EXT_SR           0x1b
 #define MII_M1111_HWCFG_MODE_MASK      0xf
 #define MII_M1111_HWCFG_MODE_RGMII     0xb
+#define MII_M1111_HWCFG_MODE_SGMII_NO_CLK      0x4
 
 MODULE_DESCRIPTION("Marvell PHY driver");
 MODULE_AUTHOR("Andy Fleming");
@@ -169,6 +170,21 @@ static int m88e1111_config_init(struct phy_device *phydev)
                        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);
        if (err < 0)
                return err;