RE: [PATCH 4/4] phy: add RTBI mode for m88e1111
From: Liu Yu-B13201 <hidden>
Date: 2010-01-15 02:49:46
Also in:
netdev
=20
-----Original Message----- From: Kumar Gala [mailto:galak@kernel.crashing.org]=20 Sent: Friday, January 15, 2010 12:20 AM To: Liu Yu-B13201 Cc: davem@davemloft.net; linuxppc-dev@lists.ozlabs.org;=20 netdev@vger.kernel.org Subject: Re: [PATCH 4/4] phy: add RTBI mode for m88e1111 =20 =20 On Jan 14, 2010, at 2:13 AM, Liu Yu wrote: =20quoted
Signed-off-by: Liu Yu <redacted> --- drivers/net/phy/marvell.c | 38=20++++++++++++++++++++++++++++++++++++++quoted
1 files changed, 38 insertions(+), 0 deletions(-) =20diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index 6f69b9b..65ed385 100644 --- a/drivers/net/phy/marvell.c +++ b/drivers/net/phy/marvell.c@@ -63,6 +63,7 @@#define MII_M1111_HWCFG_MODE_COPPER_RGMII 0xb #define MII_M1111_HWCFG_MODE_FIBER_RGMII 0x3 #define MII_M1111_HWCFG_MODE_SGMII_NO_CLK 0x4 +#define MII_M1111_HWCFG_MODE_COPPER_RTBI 0x9 #define MII_M1111_HWCFG_FIBER_COPPER_AUTO 0x8000 #define MII_M1111_HWCFG_FIBER_COPPER_RES 0x2000 =20@@ -269,6 +270,43 @@ static int m88e1111_config_init(struct=20phy_device *phydev)quoted
return err; } =20 + if (phydev->interface =3D=3D PHY_INTERFACE_MODE_RTBI) { + temp =3D phy_read(phydev, MII_M1111_PHY_EXT_CR); + if (temp < 0) + return temp; + temp |=3D (MII_M1111_RX_DELAY | MII_M1111_TX_DELAY); + err =3D phy_write(phydev, MII_M1111_PHY_EXT_CR, temp); + if (err < 0) + return err; + + temp =3D phy_read(phydev, MII_M1111_PHY_EXT_SR); + if (temp < 0) + return temp; + temp &=3D ~(MII_M1111_HWCFG_MODE_MASK |=20MII_M1111_HWCFG_FIBER_COPPER_RES);quoted
+ temp |=3D 0x7 | MII_M1111_HWCFG_FIBER_COPPER_AUTO;=20 Does this magic 0x7 have some meaning? =20
Hrr... it's GMII to fibre mode. Document 88E1111_erata_RevB2 chapter 4.35 describ the reason. Without this sometimes phys couldnot work.