Lines Matching +full:- +full:phy
1 // SPDX-License-Identifier: GPL-2.0-only
3 * PHY drivers for the sungem ethernet driver.
7 * (c) 2002-2007, Benjamin Herrenscmidt (benh@kernel.crashing.org)
10 * - Add support for PHYs that provide an IRQ line
11 * - Eventually moved the entire polling state machine in
14 * - On LXT971 & BCM5201, Apple uses some chip specific regs
17 * - Apple has some additional power management code for some
35 /* Link modes of the BCM5400 PHY */
47 static inline int __sungem_phy_read(struct mii_phy* phy, int id, int reg) in __sungem_phy_read() argument
49 return phy->mdio_read(phy->dev, id, reg); in __sungem_phy_read()
52 static inline void __sungem_phy_write(struct mii_phy* phy, int id, int reg, int val) in __sungem_phy_write() argument
54 phy->mdio_write(phy->dev, id, reg, val); in __sungem_phy_write()
57 static inline int sungem_phy_read(struct mii_phy* phy, int reg) in sungem_phy_read() argument
59 return phy->mdio_read(phy->dev, phy->mii_id, reg); in sungem_phy_read()
62 static inline void sungem_phy_write(struct mii_phy* phy, int reg, int val) in sungem_phy_write() argument
64 phy->mdio_write(phy->dev, phy->mii_id, reg, val); in sungem_phy_write()
67 static int reset_one_mii_phy(struct mii_phy* phy, int phy_id) in reset_one_mii_phy() argument
72 val = __sungem_phy_read(phy, phy_id, MII_BMCR); in reset_one_mii_phy()
75 __sungem_phy_write(phy, phy_id, MII_BMCR, val); in reset_one_mii_phy()
79 while (--limit) { in reset_one_mii_phy()
80 val = __sungem_phy_read(phy, phy_id, MII_BMCR); in reset_one_mii_phy()
86 __sungem_phy_write(phy, phy_id, MII_BMCR, val & ~BMCR_ISOLATE); in reset_one_mii_phy()
91 static int bcm5201_init(struct mii_phy* phy) in bcm5201_init() argument
95 data = sungem_phy_read(phy, MII_BCM5201_MULTIPHY); in bcm5201_init()
97 sungem_phy_write(phy, MII_BCM5201_MULTIPHY, data); in bcm5201_init()
99 sungem_phy_write(phy, MII_BCM5201_INTERRUPT, 0); in bcm5201_init()
104 static int bcm5201_suspend(struct mii_phy* phy) in bcm5201_suspend() argument
106 sungem_phy_write(phy, MII_BCM5201_INTERRUPT, 0); in bcm5201_suspend()
107 sungem_phy_write(phy, MII_BCM5201_MULTIPHY, MII_BCM5201_MULTIPHY_SUPERISOLATE); in bcm5201_suspend()
112 static int bcm5221_init(struct mii_phy* phy) in bcm5221_init() argument
116 data = sungem_phy_read(phy, MII_BCM5221_TEST); in bcm5221_init()
117 sungem_phy_write(phy, MII_BCM5221_TEST, in bcm5221_init()
120 data = sungem_phy_read(phy, MII_BCM5221_SHDOW_AUX_STAT2); in bcm5221_init()
121 sungem_phy_write(phy, MII_BCM5221_SHDOW_AUX_STAT2, in bcm5221_init()
124 data = sungem_phy_read(phy, MII_BCM5221_SHDOW_AUX_MODE4); in bcm5221_init()
125 sungem_phy_write(phy, MII_BCM5221_SHDOW_AUX_MODE4, in bcm5221_init()
128 data = sungem_phy_read(phy, MII_BCM5221_TEST); in bcm5221_init()
129 sungem_phy_write(phy, MII_BCM5221_TEST, in bcm5221_init()
135 static int bcm5221_suspend(struct mii_phy* phy) in bcm5221_suspend() argument
139 data = sungem_phy_read(phy, MII_BCM5221_TEST); in bcm5221_suspend()
140 sungem_phy_write(phy, MII_BCM5221_TEST, in bcm5221_suspend()
143 data = sungem_phy_read(phy, MII_BCM5221_SHDOW_AUX_MODE4); in bcm5221_suspend()
144 sungem_phy_write(phy, MII_BCM5221_SHDOW_AUX_MODE4, in bcm5221_suspend()
150 static int bcm5241_init(struct mii_phy* phy) in bcm5241_init() argument
154 data = sungem_phy_read(phy, MII_BCM5221_TEST); in bcm5241_init()
155 sungem_phy_write(phy, MII_BCM5221_TEST, in bcm5241_init()
158 data = sungem_phy_read(phy, MII_BCM5221_SHDOW_AUX_STAT2); in bcm5241_init()
159 sungem_phy_write(phy, MII_BCM5221_SHDOW_AUX_STAT2, in bcm5241_init()
162 data = sungem_phy_read(phy, MII_BCM5221_SHDOW_AUX_MODE4); in bcm5241_init()
163 sungem_phy_write(phy, MII_BCM5221_SHDOW_AUX_MODE4, in bcm5241_init()
166 data = sungem_phy_read(phy, MII_BCM5221_TEST); in bcm5241_init()
167 sungem_phy_write(phy, MII_BCM5221_TEST, in bcm5241_init()
173 static int bcm5241_suspend(struct mii_phy* phy) in bcm5241_suspend() argument
177 data = sungem_phy_read(phy, MII_BCM5221_TEST); in bcm5241_suspend()
178 sungem_phy_write(phy, MII_BCM5221_TEST, in bcm5241_suspend()
181 data = sungem_phy_read(phy, MII_BCM5221_SHDOW_AUX_MODE4); in bcm5241_suspend()
182 sungem_phy_write(phy, MII_BCM5221_SHDOW_AUX_MODE4, in bcm5241_suspend()
188 static int bcm5400_init(struct mii_phy* phy) in bcm5400_init() argument
193 data = sungem_phy_read(phy, MII_BCM5400_AUXCONTROL); in bcm5400_init()
195 sungem_phy_write(phy, MII_BCM5400_AUXCONTROL, data); in bcm5400_init()
197 data = sungem_phy_read(phy, MII_BCM5400_GB_CONTROL); in bcm5400_init()
199 sungem_phy_write(phy, MII_BCM5400_GB_CONTROL, data); in bcm5400_init()
203 /* Reset and configure cascaded 10/100 PHY */ in bcm5400_init()
204 (void)reset_one_mii_phy(phy, 0x1f); in bcm5400_init()
206 data = __sungem_phy_read(phy, 0x1f, MII_BCM5201_MULTIPHY); in bcm5400_init()
208 __sungem_phy_write(phy, 0x1f, MII_BCM5201_MULTIPHY, data); in bcm5400_init()
210 data = sungem_phy_read(phy, MII_BCM5400_AUXCONTROL); in bcm5400_init()
212 sungem_phy_write(phy, MII_BCM5400_AUXCONTROL, data); in bcm5400_init()
217 static int bcm5400_suspend(struct mii_phy* phy) in bcm5400_suspend() argument
220 sungem_phy_write(phy, MII_BMCR, BMCR_PDOWN); in bcm5400_suspend()
225 static int bcm5401_init(struct mii_phy* phy) in bcm5401_init() argument
230 rev = sungem_phy_read(phy, MII_PHYSID2) & 0x000f; in bcm5401_init()
241 * in the tg3.c driver. -DaveM in bcm5401_init()
243 sungem_phy_write(phy, 0x18, 0x0c20); in bcm5401_init()
244 sungem_phy_write(phy, 0x17, 0x0012); in bcm5401_init()
245 sungem_phy_write(phy, 0x15, 0x1804); in bcm5401_init()
246 sungem_phy_write(phy, 0x17, 0x0013); in bcm5401_init()
247 sungem_phy_write(phy, 0x15, 0x1204); in bcm5401_init()
248 sungem_phy_write(phy, 0x17, 0x8006); in bcm5401_init()
249 sungem_phy_write(phy, 0x15, 0x0132); in bcm5401_init()
250 sungem_phy_write(phy, 0x17, 0x8006); in bcm5401_init()
251 sungem_phy_write(phy, 0x15, 0x0232); in bcm5401_init()
252 sungem_phy_write(phy, 0x17, 0x201f); in bcm5401_init()
253 sungem_phy_write(phy, 0x15, 0x0a20); in bcm5401_init()
257 data = sungem_phy_read(phy, MII_BCM5400_GB_CONTROL); in bcm5401_init()
259 sungem_phy_write(phy, MII_BCM5400_GB_CONTROL, data); in bcm5401_init()
263 /* Reset and configure cascaded 10/100 PHY */ in bcm5401_init()
264 (void)reset_one_mii_phy(phy, 0x1f); in bcm5401_init()
266 data = __sungem_phy_read(phy, 0x1f, MII_BCM5201_MULTIPHY); in bcm5401_init()
268 __sungem_phy_write(phy, 0x1f, MII_BCM5201_MULTIPHY, data); in bcm5401_init()
273 static int bcm5401_suspend(struct mii_phy* phy) in bcm5401_suspend() argument
276 sungem_phy_write(phy, MII_BMCR, BMCR_PDOWN); in bcm5401_suspend()
281 static int bcm5411_init(struct mii_phy* phy) in bcm5411_init() argument
288 sungem_phy_write(phy, 0x1c, 0x8c23); in bcm5411_init()
289 sungem_phy_write(phy, 0x1c, 0x8ca3); in bcm5411_init()
290 sungem_phy_write(phy, 0x1c, 0x8c23); in bcm5411_init()
295 sungem_phy_write(phy, MII_BMCR, BMCR_RESET); in bcm5411_init()
296 sungem_phy_write(phy, MII_BMCR, 0x1340); in bcm5411_init()
298 data = sungem_phy_read(phy, MII_BCM5400_GB_CONTROL); in bcm5411_init()
300 sungem_phy_write(phy, MII_BCM5400_GB_CONTROL, data); in bcm5411_init()
304 /* Reset and configure cascaded 10/100 PHY */ in bcm5411_init()
305 (void)reset_one_mii_phy(phy, 0x1f); in bcm5411_init()
310 static int genmii_setup_aneg(struct mii_phy *phy, u32 advertise) in genmii_setup_aneg() argument
314 phy->autoneg = 1; in genmii_setup_aneg()
315 phy->speed = SPEED_10; in genmii_setup_aneg()
316 phy->duplex = DUPLEX_HALF; in genmii_setup_aneg()
317 phy->pause = 0; in genmii_setup_aneg()
318 phy->advertising = advertise; in genmii_setup_aneg()
321 adv = sungem_phy_read(phy, MII_ADVERTISE); in genmii_setup_aneg()
331 sungem_phy_write(phy, MII_ADVERTISE, adv); in genmii_setup_aneg()
334 ctl = sungem_phy_read(phy, MII_BMCR); in genmii_setup_aneg()
336 sungem_phy_write(phy, MII_BMCR, ctl); in genmii_setup_aneg()
341 static int genmii_setup_forced(struct mii_phy *phy, int speed, int fd) in genmii_setup_forced() argument
345 phy->autoneg = 0; in genmii_setup_forced()
346 phy->speed = speed; in genmii_setup_forced()
347 phy->duplex = fd; in genmii_setup_forced()
348 phy->pause = 0; in genmii_setup_forced()
350 ctl = sungem_phy_read(phy, MII_BMCR); in genmii_setup_forced()
353 /* First reset the PHY */ in genmii_setup_forced()
354 sungem_phy_write(phy, MII_BMCR, ctl | BMCR_RESET); in genmii_setup_forced()
365 return -EINVAL; in genmii_setup_forced()
369 sungem_phy_write(phy, MII_BMCR, ctl); in genmii_setup_forced()
374 static int genmii_poll_link(struct mii_phy *phy) in genmii_poll_link() argument
378 (void)sungem_phy_read(phy, MII_BMSR); in genmii_poll_link()
379 status = sungem_phy_read(phy, MII_BMSR); in genmii_poll_link()
382 if (phy->autoneg && !(status & BMSR_ANEGCOMPLETE)) in genmii_poll_link()
387 static int genmii_read_link(struct mii_phy *phy) in genmii_read_link() argument
391 if (phy->autoneg) { in genmii_read_link()
392 lpa = sungem_phy_read(phy, MII_LPA); in genmii_read_link()
395 phy->duplex = DUPLEX_FULL; in genmii_read_link()
397 phy->duplex = DUPLEX_HALF; in genmii_read_link()
399 phy->speed = SPEED_100; in genmii_read_link()
401 phy->speed = SPEED_10; in genmii_read_link()
402 phy->pause = 0; in genmii_read_link()
404 /* On non-aneg, we assume what we put in BMCR is the speed, in genmii_read_link()
405 * though magic-aneg shouldn't prevent this case from occurring in genmii_read_link()
411 static int generic_suspend(struct mii_phy* phy) in generic_suspend() argument
413 sungem_phy_write(phy, MII_BMCR, BMCR_PDOWN); in generic_suspend()
418 static int bcm5421_init(struct mii_phy* phy) in bcm5421_init() argument
423 id = (sungem_phy_read(phy, MII_PHYSID1) << 16 | sungem_phy_read(phy, MII_PHYSID2)); in bcm5421_init()
429 sungem_phy_write(phy, 0x18, 0x1007); in bcm5421_init()
430 data = sungem_phy_read(phy, 0x18); in bcm5421_init()
431 sungem_phy_write(phy, 0x18, data | 0x0400); in bcm5421_init()
432 sungem_phy_write(phy, 0x18, 0x0007); in bcm5421_init()
433 data = sungem_phy_read(phy, 0x18); in bcm5421_init()
434 sungem_phy_write(phy, 0x18, data | 0x0800); in bcm5421_init()
435 sungem_phy_write(phy, 0x17, 0x000a); in bcm5421_init()
436 data = sungem_phy_read(phy, 0x15); in bcm5421_init()
437 sungem_phy_write(phy, 0x15, data | 0x0200); in bcm5421_init()
442 sungem_phy_write(phy, 4, 0x01e1); in bcm5421_init()
443 sungem_phy_write(phy, 9, 0x0300); in bcm5421_init()
448 if (phy->platform_data) { in bcm5421_init()
449 struct device_node *np = of_get_parent(phy->platform_data); in bcm5421_init()
451 if (np == NULL || of_get_property(np, "no-autolowpower", NULL)) in bcm5421_init()
455 /* Enable automatic low-power */ in bcm5421_init()
456 sungem_phy_write(phy, 0x1c, 0x9002); in bcm5421_init()
457 sungem_phy_write(phy, 0x1c, 0xa821); in bcm5421_init()
458 sungem_phy_write(phy, 0x1c, 0x941d); in bcm5421_init()
466 static int bcm54xx_setup_aneg(struct mii_phy *phy, u32 advertise) in bcm54xx_setup_aneg() argument
470 phy->autoneg = 1; in bcm54xx_setup_aneg()
471 phy->speed = SPEED_10; in bcm54xx_setup_aneg()
472 phy->duplex = DUPLEX_HALF; in bcm54xx_setup_aneg()
473 phy->pause = 0; in bcm54xx_setup_aneg()
474 phy->advertising = advertise; in bcm54xx_setup_aneg()
477 adv = sungem_phy_read(phy, MII_ADVERTISE); in bcm54xx_setup_aneg()
491 sungem_phy_write(phy, MII_ADVERTISE, adv); in bcm54xx_setup_aneg()
494 adv = sungem_phy_read(phy, MII_1000BASETCONTROL); in bcm54xx_setup_aneg()
500 sungem_phy_write(phy, MII_1000BASETCONTROL, adv); in bcm54xx_setup_aneg()
503 ctl = sungem_phy_read(phy, MII_BMCR); in bcm54xx_setup_aneg()
505 sungem_phy_write(phy, MII_BMCR, ctl); in bcm54xx_setup_aneg()
510 static int bcm54xx_setup_forced(struct mii_phy *phy, int speed, int fd) in bcm54xx_setup_forced() argument
514 phy->autoneg = 0; in bcm54xx_setup_forced()
515 phy->speed = speed; in bcm54xx_setup_forced()
516 phy->duplex = fd; in bcm54xx_setup_forced()
517 phy->pause = 0; in bcm54xx_setup_forced()
519 ctl = sungem_phy_read(phy, MII_BMCR); in bcm54xx_setup_forced()
522 /* First reset the PHY */ in bcm54xx_setup_forced()
523 sungem_phy_write(phy, MII_BMCR, ctl | BMCR_RESET); in bcm54xx_setup_forced()
540 sungem_phy_write(phy, MII_BMCR, ctl); in bcm54xx_setup_forced()
545 static int bcm54xx_read_link(struct mii_phy *phy) in bcm54xx_read_link() argument
550 if (phy->autoneg) { in bcm54xx_read_link()
551 val = sungem_phy_read(phy, MII_BCM5400_AUXSTATUS); in bcm54xx_read_link()
554 phy->duplex = phy_BCM5400_link_table[link_mode][0] ? in bcm54xx_read_link()
556 phy->speed = phy_BCM5400_link_table[link_mode][2] ? in bcm54xx_read_link()
560 val = sungem_phy_read(phy, MII_LPA); in bcm54xx_read_link()
561 phy->pause = (phy->duplex == DUPLEX_FULL) && in bcm54xx_read_link()
564 /* On non-aneg, we assume what we put in BMCR is the speed, in bcm54xx_read_link()
565 * though magic-aneg shouldn't prevent this case from occurring in bcm54xx_read_link()
571 static int marvell88e1111_init(struct mii_phy* phy) in marvell88e1111_init() argument
576 rev = sungem_phy_read(phy, MII_PHYSID2) & 0x000f; in marvell88e1111_init()
578 sungem_phy_write(phy, 0x1d, 0x000a); in marvell88e1111_init()
579 sungem_phy_write(phy, 0x1e, 0x0821); in marvell88e1111_init()
581 sungem_phy_write(phy, 0x1d, 0x0006); in marvell88e1111_init()
582 sungem_phy_write(phy, 0x1e, 0x8600); in marvell88e1111_init()
584 sungem_phy_write(phy, 0x1d, 0x000b); in marvell88e1111_init()
585 sungem_phy_write(phy, 0x1e, 0x0100); in marvell88e1111_init()
587 sungem_phy_write(phy, 0x1d, 0x0004); in marvell88e1111_init()
588 sungem_phy_write(phy, 0x1e, 0x4850); in marvell88e1111_init()
595 static int bcm5421_poll_link(struct mii_phy* phy) in bcm5421_poll_link() argument
601 sungem_phy_write(phy, MII_NCONFIG, 0x1000); in bcm5421_poll_link()
602 phy_reg = sungem_phy_read(phy, MII_NCONFIG); in bcm5421_poll_link()
607 return genmii_poll_link(phy); in bcm5421_poll_link()
610 sungem_phy_write(phy, MII_NCONFIG, 0x2000); in bcm5421_poll_link()
611 phy_reg = sungem_phy_read(phy, MII_NCONFIG); in bcm5421_poll_link()
619 static int bcm5421_read_link(struct mii_phy* phy) in bcm5421_read_link() argument
625 sungem_phy_write(phy, MII_NCONFIG, 0x1000); in bcm5421_read_link()
626 phy_reg = sungem_phy_read(phy, MII_NCONFIG); in bcm5421_read_link()
631 return bcm54xx_read_link(phy); in bcm5421_read_link()
633 phy->speed = SPEED_1000; in bcm5421_read_link()
635 /* find out whether we are running half- or full duplex */ in bcm5421_read_link()
636 sungem_phy_write(phy, MII_NCONFIG, 0x2000); in bcm5421_read_link()
637 phy_reg = sungem_phy_read(phy, MII_NCONFIG); in bcm5421_read_link()
640 phy->duplex |= DUPLEX_HALF; in bcm5421_read_link()
642 phy->duplex |= DUPLEX_FULL; in bcm5421_read_link()
647 static int bcm5421_enable_fiber(struct mii_phy* phy, int autoneg) in bcm5421_enable_fiber() argument
650 sungem_phy_write(phy, MII_NCONFIG, 0x9020); in bcm5421_enable_fiber()
652 sungem_phy_write(phy, MII_NCONFIG, 0x945f); in bcm5421_enable_fiber()
656 sungem_phy_write(phy, MII_NCONFIG, 0xfc01); in bcm5421_enable_fiber()
657 sungem_phy_write(phy, 0x0b, 0x0004); in bcm5421_enable_fiber()
660 phy->autoneg = autoneg; in bcm5421_enable_fiber()
668 static int bcm5461_poll_link(struct mii_phy* phy) in bcm5461_poll_link() argument
674 sungem_phy_write(phy, MII_NCONFIG, 0x7c00); in bcm5461_poll_link()
675 phy_reg = sungem_phy_read(phy, MII_NCONFIG); in bcm5461_poll_link()
680 return genmii_poll_link(phy); in bcm5461_poll_link()
683 sungem_phy_write(phy, MII_NCONFIG, 0x7000); in bcm5461_poll_link()
684 phy_reg = sungem_phy_read(phy, MII_NCONFIG); in bcm5461_poll_link()
694 static int bcm5461_read_link(struct mii_phy* phy) in bcm5461_read_link() argument
700 sungem_phy_write(phy, MII_NCONFIG, 0x7c00); in bcm5461_read_link()
701 phy_reg = sungem_phy_read(phy, MII_NCONFIG); in bcm5461_read_link()
706 return bcm54xx_read_link(phy); in bcm5461_read_link()
709 phy->speed = SPEED_1000; in bcm5461_read_link()
711 /* find out whether we are running half- or full duplex */ in bcm5461_read_link()
712 sungem_phy_write(phy, MII_NCONFIG, 0x7000); in bcm5461_read_link()
713 phy_reg = sungem_phy_read(phy, MII_NCONFIG); in bcm5461_read_link()
716 phy->duplex |= DUPLEX_FULL; in bcm5461_read_link()
718 phy->duplex |= DUPLEX_HALF; in bcm5461_read_link()
723 static int bcm5461_enable_fiber(struct mii_phy* phy, int autoneg) in bcm5461_enable_fiber() argument
725 /* select fiber mode, enable 1000 base-X registers */ in bcm5461_enable_fiber()
726 sungem_phy_write(phy, MII_NCONFIG, 0xfc0b); in bcm5461_enable_fiber()
730 sungem_phy_write(phy, MII_ADVERTISE, 0x01e0); in bcm5461_enable_fiber()
731 sungem_phy_write(phy, MII_BMCR, 0x1140); in bcm5461_enable_fiber()
734 sungem_phy_write(phy, MII_BMCR, 0x0140); in bcm5461_enable_fiber()
737 phy->autoneg = autoneg; in bcm5461_enable_fiber()
742 static int marvell_setup_aneg(struct mii_phy *phy, u32 advertise) in marvell_setup_aneg() argument
746 phy->autoneg = 1; in marvell_setup_aneg()
747 phy->speed = SPEED_10; in marvell_setup_aneg()
748 phy->duplex = DUPLEX_HALF; in marvell_setup_aneg()
749 phy->pause = 0; in marvell_setup_aneg()
750 phy->advertising = advertise; in marvell_setup_aneg()
753 adv = sungem_phy_read(phy, MII_ADVERTISE); in marvell_setup_aneg()
767 sungem_phy_write(phy, MII_ADVERTISE, adv); in marvell_setup_aneg()
775 adv = sungem_phy_read(phy, MII_M1011_PHY_SPEC_CONTROL); in marvell_setup_aneg()
783 sungem_phy_write(phy, MII_1000BASETCONTROL, adv); in marvell_setup_aneg()
786 ctl = sungem_phy_read(phy, MII_BMCR); in marvell_setup_aneg()
788 sungem_phy_write(phy, MII_BMCR, ctl); in marvell_setup_aneg()
793 static int marvell_setup_forced(struct mii_phy *phy, int speed, int fd) in marvell_setup_forced() argument
797 phy->autoneg = 0; in marvell_setup_forced()
798 phy->speed = speed; in marvell_setup_forced()
799 phy->duplex = fd; in marvell_setup_forced()
800 phy->pause = 0; in marvell_setup_forced()
802 ctl = sungem_phy_read(phy, MII_BMCR); in marvell_setup_forced()
825 ctl2 = sungem_phy_read(phy, MII_M1011_PHY_SPEC_CONTROL); in marvell_setup_forced()
834 sungem_phy_write(phy, MII_1000BASETCONTROL, ctl2); in marvell_setup_forced()
838 sungem_phy_write(phy, MII_BMCR, ctl); in marvell_setup_forced()
843 static int marvell_read_link(struct mii_phy *phy) in marvell_read_link() argument
847 if (phy->autoneg) { in marvell_read_link()
848 status = sungem_phy_read(phy, MII_M1011_PHY_SPEC_STATUS); in marvell_read_link()
850 return -EAGAIN; in marvell_read_link()
852 phy->speed = SPEED_1000; in marvell_read_link()
854 phy->speed = SPEED_100; in marvell_read_link()
856 phy->speed = SPEED_10; in marvell_read_link()
858 phy->duplex = DUPLEX_FULL; in marvell_read_link()
860 phy->duplex = DUPLEX_HALF; in marvell_read_link()
863 phy->pause = (status & pmask) == pmask; in marvell_read_link()
865 /* On non-aneg, we assume what we put in BMCR is the speed, in marvell_read_link()
866 * though magic-aneg shouldn't prevent this case from occurring in marvell_read_link()
880 * it neither. --BenH.
1020 /* Broadcom BCM 5421 built-in K2 */
1033 .name = "BCM5421-K2",
1058 /* Broadcom BCM 5462 built-in Vesta */
1071 .name = "BCM5462-Vesta",
1160 int sungem_phy_probe(struct mii_phy *phy, int mii_id) in sungem_phy_probe() argument
1168 * may re-probe the PHY regulary in sungem_phy_probe()
1170 phy->mii_id = mii_id; in sungem_phy_probe()
1172 /* Take PHY out of isloate mode and reset it. */ in sungem_phy_probe()
1173 rc = reset_one_mii_phy(phy, mii_id); in sungem_phy_probe()
1178 id = (sungem_phy_read(phy, MII_PHYSID1) << 16 | sungem_phy_read(phy, MII_PHYSID2)); in sungem_phy_probe()
1179 printk(KERN_DEBUG KBUILD_MODNAME ": " "PHY ID: %x, addr: %x\n", in sungem_phy_probe()
1182 if ((id & def->phy_id_mask) == def->phy_id) in sungem_phy_probe()
1188 phy->def = def; in sungem_phy_probe()
1192 phy->speed = 0; in sungem_phy_probe()
1193 phy->duplex = 0; in sungem_phy_probe()
1194 phy->pause = 0; in sungem_phy_probe()
1195 phy->advertising = 0; in sungem_phy_probe()
1196 return -ENODEV; in sungem_phy_probe()
1200 MODULE_DESCRIPTION("PHY drivers for the sungem Ethernet MAC driver");