aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorVince Bridgers <vbridger@opensource.altera.com>2014-10-26 15:22:24 -0400
committerDavid S. Miller <davem@davemloft.net>2014-10-28 17:00:22 -0400
commit99d881f993f066c75059d24e44c74f7a3fc199bc (patch)
treed030c3420a854d2a87d7a272ff62284752afc3bb /drivers/net
parent47276fcc2d542e7b15e384c08b1709c1921b06c1 (diff)
net: phy: Add SGMII Configuration for Marvell 88E1145 Initialization
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>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/phy/marvell.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index bd37e45c89c0..225c033b08f3 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -50,10 +50,15 @@
50#define MII_M1011_PHY_SCR 0x10 50#define MII_M1011_PHY_SCR 0x10
51#define MII_M1011_PHY_SCR_AUTO_CROSS 0x0060 51#define MII_M1011_PHY_SCR_AUTO_CROSS 0x0060
52 52
53#define MII_M1145_PHY_EXT_SR 0x1b
53#define MII_M1145_PHY_EXT_CR 0x14 54#define MII_M1145_PHY_EXT_CR 0x14
54#define MII_M1145_RGMII_RX_DELAY 0x0080 55#define MII_M1145_RGMII_RX_DELAY 0x0080
55#define MII_M1145_RGMII_TX_DELAY 0x0002 56#define MII_M1145_RGMII_TX_DELAY 0x0002
56 57
58#define MII_M1145_HWCFG_MODE_SGMII_NO_CLK 0x4
59#define MII_M1145_HWCFG_MODE_MASK 0xf
60#define MII_M1145_HWCFG_FIBER_COPPER_AUTO 0x8000
61
57#define MII_M1111_PHY_LED_CONTROL 0x18 62#define MII_M1111_PHY_LED_CONTROL 0x18
58#define MII_M1111_PHY_LED_DIRECT 0x4100 63#define MII_M1111_PHY_LED_DIRECT 0x4100
59#define MII_M1111_PHY_LED_COMBINE 0x411c 64#define MII_M1111_PHY_LED_COMBINE 0x411c
@@ -676,6 +681,20 @@ static int m88e1145_config_init(struct phy_device *phydev)
676 } 681 }
677 } 682 }
678 683
684 if (phydev->interface == PHY_INTERFACE_MODE_SGMII) {
685 int temp = phy_read(phydev, MII_M1145_PHY_EXT_SR);
686 if (temp < 0)
687 return temp;
688
689 temp &= ~MII_M1145_HWCFG_MODE_MASK;
690 temp |= MII_M1145_HWCFG_MODE_SGMII_NO_CLK;
691 temp |= MII_M1145_HWCFG_FIBER_COPPER_AUTO;
692
693 err = phy_write(phydev, MII_M1145_PHY_EXT_SR, temp);
694 if (err < 0)
695 return err;
696 }
697
679 err = marvell_of_reg_init(phydev); 698 err = marvell_of_reg_init(phydev);
680 if (err < 0) 699 if (err < 0)
681 return err; 700 return err;