aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/phy
diff options
context:
space:
mode:
authorAndy Fleming <afleming@freescale.com>2007-07-11 12:42:35 -0400
committerJeff Garzik <jeff@garzik.org>2007-07-18 18:29:37 -0400
commitaf2d940df2b60b15c271033d381c2f3ead655562 (patch)
tree367711410500a4fd7736e2e0ff5036506597857d /drivers/net/phy
parentcc65185d400c4e8698ff1c1b59f90bd491e9bda5 (diff)
Fix Vitesse RGMII-ID support
The Vitesse PHY on the 8641D needs to be set up with internal delay to work in RGMII mode. So we add skew when it is set to RGMII_ID mode. Signed-off-by: Andy Fleming <afleming@freescale.com> Signed-off-by: Haruki Dai <Dai.Haruki@freescale.com> Signed-off-by: Haiying Wang <Haiying.Wang@freescale.com>
Diffstat (limited to 'drivers/net/phy')
-rw-r--r--drivers/net/phy/vitesse.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/drivers/net/phy/vitesse.c b/drivers/net/phy/vitesse.c
index f39ab76e6f67..6a5385647911 100644
--- a/drivers/net/phy/vitesse.c
+++ b/drivers/net/phy/vitesse.c
@@ -21,6 +21,10 @@
21/* Vitesse Extended Control Register 1 */ 21/* Vitesse Extended Control Register 1 */
22#define MII_VSC8244_EXT_CON1 0x17 22#define MII_VSC8244_EXT_CON1 0x17
23#define MII_VSC8244_EXTCON1_INIT 0x0000 23#define MII_VSC8244_EXTCON1_INIT 0x0000
24#define MII_VSC8244_EXTCON1_TX_SKEW_MASK 0x0c00
25#define MII_VSC8244_EXTCON1_RX_SKEW_MASK 0x0300
26#define MII_VSC8244_EXTCON1_TX_SKEW 0x0800
27#define MII_VSC8244_EXTCON1_RX_SKEW 0x0200
24 28
25/* Vitesse Interrupt Mask Register */ 29/* Vitesse Interrupt Mask Register */
26#define MII_VSC8244_IMASK 0x19 30#define MII_VSC8244_IMASK 0x19
@@ -39,7 +43,7 @@
39 43
40/* Vitesse Auxiliary Control/Status Register */ 44/* Vitesse Auxiliary Control/Status Register */
41#define MII_VSC8244_AUX_CONSTAT 0x1c 45#define MII_VSC8244_AUX_CONSTAT 0x1c
42#define MII_VSC8244_AUXCONSTAT_INIT 0x0004 46#define MII_VSC8244_AUXCONSTAT_INIT 0x0000
43#define MII_VSC8244_AUXCONSTAT_DUPLEX 0x0020 47#define MII_VSC8244_AUXCONSTAT_DUPLEX 0x0020
44#define MII_VSC8244_AUXCONSTAT_SPEED 0x0018 48#define MII_VSC8244_AUXCONSTAT_SPEED 0x0018
45#define MII_VSC8244_AUXCONSTAT_GBIT 0x0010 49#define MII_VSC8244_AUXCONSTAT_GBIT 0x0010
@@ -51,6 +55,7 @@ MODULE_LICENSE("GPL");
51 55
52static int vsc824x_config_init(struct phy_device *phydev) 56static int vsc824x_config_init(struct phy_device *phydev)
53{ 57{
58 int extcon;
54 int err; 59 int err;
55 60
56 err = phy_write(phydev, MII_VSC8244_AUX_CONSTAT, 61 err = phy_write(phydev, MII_VSC8244_AUX_CONSTAT,
@@ -58,8 +63,20 @@ static int vsc824x_config_init(struct phy_device *phydev)
58 if (err < 0) 63 if (err < 0)
59 return err; 64 return err;
60 65
61 err = phy_write(phydev, MII_VSC8244_EXT_CON1, 66 extcon = phy_read(phydev, MII_VSC8244_EXT_CON1);
62 MII_VSC8244_EXTCON1_INIT); 67
68 if (extcon < 0)
69 return err;
70
71 extcon &= ~(MII_VSC8244_EXTCON1_TX_SKEW_MASK |
72 MII_VSC8244_EXTCON1_RX_SKEW_MASK);
73
74 if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID)
75 extcon |= (MII_VSC8244_EXTCON1_TX_SKEW |
76 MII_VSC8244_EXTCON1_RX_SKEW);
77
78 err = phy_write(phydev, MII_VSC8244_EXT_CON1, extcon);
79
63 return err; 80 return err;
64} 81}
65 82