aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ibm_newemac/phy.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ibm_newemac/phy.c')
-rw-r--r--drivers/net/ibm_newemac/phy.c81
1 files changed, 81 insertions, 0 deletions
diff --git a/drivers/net/ibm_newemac/phy.c b/drivers/net/ibm_newemac/phy.c
index aa1f0ddf1e3e..37bfeea8788a 100644
--- a/drivers/net/ibm_newemac/phy.c
+++ b/drivers/net/ibm_newemac/phy.c
@@ -8,6 +8,11 @@
8 * This file should be shared with other drivers or eventually 8 * This file should be shared with other drivers or eventually
9 * merged as the "low level" part of miilib 9 * merged as the "low level" part of miilib
10 * 10 *
11 * Copyright 2007 Benjamin Herrenschmidt, IBM Corp.
12 * <benh@kernel.crashing.org>
13 *
14 * Based on the arch/ppc version of the driver:
15 *
11 * (c) 2003, Benjamin Herrenscmidt (benh@kernel.crashing.org) 16 * (c) 2003, Benjamin Herrenscmidt (benh@kernel.crashing.org)
12 * (c) 2004-2005, Eugene Surovegin <ebs@ebshome.net> 17 * (c) 2004-2005, Eugene Surovegin <ebs@ebshome.net>
13 * 18 *
@@ -306,8 +311,84 @@ static struct mii_phy_def cis8201_phy_def = {
306 .ops = &cis8201_phy_ops 311 .ops = &cis8201_phy_ops
307}; 312};
308 313
314static struct mii_phy_def bcm5248_phy_def = {
315
316 .phy_id = 0x0143bc00,
317 .phy_id_mask = 0x0ffffff0,
318 .name = "BCM5248 10/100 SMII Ethernet",
319 .ops = &generic_phy_ops
320};
321
322static int m88e1111_init(struct mii_phy *phy)
323{
324 pr_debug("%s: Marvell 88E1111 Ethernet\n", __FUNCTION__);
325 phy_write(phy, 0x14, 0x0ce3);
326 phy_write(phy, 0x18, 0x4101);
327 phy_write(phy, 0x09, 0x0e00);
328 phy_write(phy, 0x04, 0x01e1);
329 phy_write(phy, 0x00, 0x9140);
330 phy_write(phy, 0x00, 0x1140);
331
332 return 0;
333}
334
335static int et1011c_init(struct mii_phy *phy)
336{
337 u16 reg_short;
338
339 reg_short = (u16)(phy_read(phy, 0x16));
340 reg_short &= ~(0x7);
341 reg_short |= 0x6; /* RGMII Trace Delay*/
342 phy_write(phy, 0x16, reg_short);
343
344 reg_short = (u16)(phy_read(phy, 0x17));
345 reg_short &= ~(0x40);
346 phy_write(phy, 0x17, reg_short);
347
348 phy_write(phy, 0x1c, 0x74f0);
349 return 0;
350}
351
352static struct mii_phy_ops et1011c_phy_ops = {
353 .init = et1011c_init,
354 .setup_aneg = genmii_setup_aneg,
355 .setup_forced = genmii_setup_forced,
356 .poll_link = genmii_poll_link,
357 .read_link = genmii_read_link
358};
359
360static struct mii_phy_def et1011c_phy_def = {
361 .phy_id = 0x0282f000,
362 .phy_id_mask = 0x0fffff00,
363 .name = "ET1011C Gigabit Ethernet",
364 .ops = &et1011c_phy_ops
365};
366
367
368
369
370
371static struct mii_phy_ops m88e1111_phy_ops = {
372 .init = m88e1111_init,
373 .setup_aneg = genmii_setup_aneg,
374 .setup_forced = genmii_setup_forced,
375 .poll_link = genmii_poll_link,
376 .read_link = genmii_read_link
377};
378
379static struct mii_phy_def m88e1111_phy_def = {
380
381 .phy_id = 0x01410CC0,
382 .phy_id_mask = 0x0ffffff0,
383 .name = "Marvell 88E1111 Ethernet",
384 .ops = &m88e1111_phy_ops,
385};
386
309static struct mii_phy_def *mii_phy_table[] = { 387static struct mii_phy_def *mii_phy_table[] = {
388 &et1011c_phy_def,
310 &cis8201_phy_def, 389 &cis8201_phy_def,
390 &bcm5248_phy_def,
391 &m88e1111_phy_def,
311 &genmii_phy_def, 392 &genmii_phy_def,
312 NULL 393 NULL
313}; 394};