aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSergei Poselenov <sposelenov@emcraft.com>2009-04-06 22:01:41 -0400
committerDavid S. Miller <davem@davemloft.net>2009-04-13 17:51:22 -0400
commit140bc92903287cff4545e358c1651e4b7312cbd3 (patch)
treeb12317ef6d338ea2cf9695d1f4892795091bb8f3 /drivers
parent83400207a07584539366f6859362db6872809a12 (diff)
phylib: Basic support for the M88E1121R Marvell chip
Add support for the Marvell M88E1121R Dual GigE PHY Signed-off-by: Yuri Tikhonov <yur@emcraft.com> Signed-off-by: Sergei Poselenov <sposelenov@emcraft.com> Signed-off-by: Anatolij Gustschin <agust@denx.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/phy/marvell.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index eb6411c4694f..e9f436ba800f 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -69,6 +69,11 @@
69#define MII_M1111_COPPER 0 69#define MII_M1111_COPPER 0
70#define MII_M1111_FIBER 1 70#define MII_M1111_FIBER 1
71 71
72#define MII_88E1121_PHY_LED_CTRL 16
73#define MII_88E1121_PHY_LED_PAGE 3
74#define MII_88E1121_PHY_LED_DEF 0x0030
75#define MII_88E1121_PHY_PAGE 22
76
72#define MII_M1011_PHY_STATUS 0x11 77#define MII_M1011_PHY_STATUS 0x11
73#define MII_M1011_PHY_STATUS_1000 0x8000 78#define MII_M1011_PHY_STATUS_1000 0x8000
74#define MII_M1011_PHY_STATUS_100 0x4000 79#define MII_M1011_PHY_STATUS_100 0x4000
@@ -154,6 +159,30 @@ static int marvell_config_aneg(struct phy_device *phydev)
154 return err; 159 return err;
155} 160}
156 161
162static int m88e1121_config_aneg(struct phy_device *phydev)
163{
164 int err, temp;
165
166 err = phy_write(phydev, MII_BMCR, BMCR_RESET);
167 if (err < 0)
168 return err;
169
170 err = phy_write(phydev, MII_M1011_PHY_SCR,
171 MII_M1011_PHY_SCR_AUTO_CROSS);
172 if (err < 0)
173 return err;
174
175 temp = phy_read(phydev, MII_88E1121_PHY_PAGE);
176
177 phy_write(phydev, MII_88E1121_PHY_PAGE, MII_88E1121_PHY_LED_PAGE);
178 phy_write(phydev, MII_88E1121_PHY_LED_CTRL, MII_88E1121_PHY_LED_DEF);
179 phy_write(phydev, MII_88E1121_PHY_PAGE, temp);
180
181 err = genphy_config_aneg(phydev);
182
183 return err;
184}
185
157static int m88e1111_config_init(struct phy_device *phydev) 186static int m88e1111_config_init(struct phy_device *phydev)
158{ 187{
159 int err; 188 int err;
@@ -482,6 +511,18 @@ static struct phy_driver marvell_drivers[] = {
482 .driver = {.owner = THIS_MODULE,}, 511 .driver = {.owner = THIS_MODULE,},
483 }, 512 },
484 { 513 {
514 .phy_id = 0x01410cb0,
515 .phy_id_mask = 0xfffffff0,
516 .name = "Marvell 88E1121R",
517 .features = PHY_GBIT_FEATURES,
518 .flags = PHY_HAS_INTERRUPT,
519 .config_aneg = &m88e1121_config_aneg,
520 .read_status = &marvell_read_status,
521 .ack_interrupt = &marvell_ack_interrupt,
522 .config_intr = &marvell_config_intr,
523 .driver = { .owner = THIS_MODULE },
524 },
525 {
485 .phy_id = 0x01410cd0, 526 .phy_id = 0x01410cd0,
486 .phy_id_mask = 0xfffffff0, 527 .phy_id_mask = 0xfffffff0,
487 .name = "Marvell 88E1145", 528 .name = "Marvell 88E1145",