diff options
author | Liu Yu-B13201 <Yu.Liu@freescale.com> | 2010-01-13 17:13:19 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-01-21 04:17:56 -0500 |
commit | 5f8cbc13225eadd981c817f7d14b8deab61ebfaa (patch) | |
tree | 5fc6ca51afd9996fe55858735d1478371b02ddd2 | |
parent | 81abb43a243b6d74b6f7201a7a22aa5355cd3a8a (diff) |
phy: add RTBI mode for m88e1111
Signed-off-by: Liu Yu <yu.liu@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/phy/marvell.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index 6f69b9ba0df8..65ed385c2ceb 100644 --- a/drivers/net/phy/marvell.c +++ b/drivers/net/phy/marvell.c | |||
@@ -63,6 +63,7 @@ | |||
63 | #define MII_M1111_HWCFG_MODE_COPPER_RGMII 0xb | 63 | #define MII_M1111_HWCFG_MODE_COPPER_RGMII 0xb |
64 | #define MII_M1111_HWCFG_MODE_FIBER_RGMII 0x3 | 64 | #define MII_M1111_HWCFG_MODE_FIBER_RGMII 0x3 |
65 | #define MII_M1111_HWCFG_MODE_SGMII_NO_CLK 0x4 | 65 | #define MII_M1111_HWCFG_MODE_SGMII_NO_CLK 0x4 |
66 | #define MII_M1111_HWCFG_MODE_COPPER_RTBI 0x9 | ||
66 | #define MII_M1111_HWCFG_FIBER_COPPER_AUTO 0x8000 | 67 | #define MII_M1111_HWCFG_FIBER_COPPER_AUTO 0x8000 |
67 | #define MII_M1111_HWCFG_FIBER_COPPER_RES 0x2000 | 68 | #define MII_M1111_HWCFG_FIBER_COPPER_RES 0x2000 |
68 | 69 | ||
@@ -269,6 +270,43 @@ static int m88e1111_config_init(struct phy_device *phydev) | |||
269 | return err; | 270 | return err; |
270 | } | 271 | } |
271 | 272 | ||
273 | if (phydev->interface == PHY_INTERFACE_MODE_RTBI) { | ||
274 | temp = phy_read(phydev, MII_M1111_PHY_EXT_CR); | ||
275 | if (temp < 0) | ||
276 | return temp; | ||
277 | temp |= (MII_M1111_RX_DELAY | MII_M1111_TX_DELAY); | ||
278 | err = phy_write(phydev, MII_M1111_PHY_EXT_CR, temp); | ||
279 | if (err < 0) | ||
280 | return err; | ||
281 | |||
282 | temp = phy_read(phydev, MII_M1111_PHY_EXT_SR); | ||
283 | if (temp < 0) | ||
284 | return temp; | ||
285 | temp &= ~(MII_M1111_HWCFG_MODE_MASK | MII_M1111_HWCFG_FIBER_COPPER_RES); | ||
286 | temp |= 0x7 | MII_M1111_HWCFG_FIBER_COPPER_AUTO; | ||
287 | err = phy_write(phydev, MII_M1111_PHY_EXT_SR, temp); | ||
288 | if (err < 0) | ||
289 | return err; | ||
290 | |||
291 | /* soft reset */ | ||
292 | err = phy_write(phydev, MII_BMCR, BMCR_RESET); | ||
293 | if (err < 0) | ||
294 | return err; | ||
295 | do | ||
296 | temp = phy_read(phydev, MII_BMCR); | ||
297 | while (temp & BMCR_RESET); | ||
298 | |||
299 | temp = phy_read(phydev, MII_M1111_PHY_EXT_SR); | ||
300 | if (temp < 0) | ||
301 | return temp; | ||
302 | temp &= ~(MII_M1111_HWCFG_MODE_MASK | MII_M1111_HWCFG_FIBER_COPPER_RES); | ||
303 | temp |= MII_M1111_HWCFG_MODE_COPPER_RTBI | MII_M1111_HWCFG_FIBER_COPPER_AUTO; | ||
304 | err = phy_write(phydev, MII_M1111_PHY_EXT_SR, temp); | ||
305 | if (err < 0) | ||
306 | return err; | ||
307 | } | ||
308 | |||
309 | |||
272 | err = phy_write(phydev, MII_BMCR, BMCR_RESET); | 310 | err = phy_write(phydev, MII_BMCR, BMCR_RESET); |
273 | if (err < 0) | 311 | if (err < 0) |
274 | return err; | 312 | return err; |