diff options
Diffstat (limited to 'drivers/net/phy')
-rw-r--r-- | drivers/net/phy/marvell.c | 19 |
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; |