Skip to content

Commit

Permalink
net: phy: Add SGMII Configuration for Marvell 88E1145 Initialization
Browse files Browse the repository at this point in the history
Marvell phy 88E1145 configuration & initialization was missing a case
for initializing SGMII mode. This patch adds that case.

Signed-off-by: Vince Bridgers <vbridger@opensource.altera.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Vince Bridgers authored and davem330 committed Oct 28, 2014
1 parent 47276fc commit 99d881f
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions drivers/net/phy/marvell.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,15 @@
#define MII_M1011_PHY_SCR 0x10
#define MII_M1011_PHY_SCR_AUTO_CROSS 0x0060

#define MII_M1145_PHY_EXT_SR 0x1b
#define MII_M1145_PHY_EXT_CR 0x14
#define MII_M1145_RGMII_RX_DELAY 0x0080
#define MII_M1145_RGMII_TX_DELAY 0x0002

#define MII_M1145_HWCFG_MODE_SGMII_NO_CLK 0x4
#define MII_M1145_HWCFG_MODE_MASK 0xf
#define MII_M1145_HWCFG_FIBER_COPPER_AUTO 0x8000

#define MII_M1111_PHY_LED_CONTROL 0x18
#define MII_M1111_PHY_LED_DIRECT 0x4100
#define MII_M1111_PHY_LED_COMBINE 0x411c
Expand Down Expand Up @@ -676,6 +681,20 @@ static int m88e1145_config_init(struct phy_device *phydev)
}
}

if (phydev->interface == PHY_INTERFACE_MODE_SGMII) {
int temp = phy_read(phydev, MII_M1145_PHY_EXT_SR);
if (temp < 0)
return temp;

temp &= ~MII_M1145_HWCFG_MODE_MASK;
temp |= MII_M1145_HWCFG_MODE_SGMII_NO_CLK;
temp |= MII_M1145_HWCFG_FIBER_COPPER_AUTO;

err = phy_write(phydev, MII_M1145_PHY_EXT_SR, temp);
if (err < 0)
return err;
}

err = marvell_of_reg_init(phydev);
if (err < 0)
return err;
Expand Down

0 comments on commit 99d881f

Please sign in to comment.