2 * drivers/net/phy/marvell.c
4 * Driver for Marvell PHYs
8 * Copyright (c) 2004 Freescale Semiconductor, Inc.
10 * Copyright (c) 2013 Michael Stapelberg <michael@stapelberg.de>
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version.
18 #include <linux/kernel.h>
19 #include <linux/string.h>
20 #include <linux/errno.h>
21 #include <linux/unistd.h>
22 #include <linux/interrupt.h>
23 #include <linux/init.h>
24 #include <linux/delay.h>
25 #include <linux/netdevice.h>
26 #include <linux/etherdevice.h>
27 #include <linux/skbuff.h>
28 #include <linux/spinlock.h>
30 #include <linux/module.h>
31 #include <linux/mii.h>
32 #include <linux/ethtool.h>
33 #include <linux/phy.h>
34 #include <linux/marvell_phy.h>
39 #include <linux/uaccess.h>
41 #define MII_MARVELL_PHY_PAGE 22
43 #define MII_M1011_IEVENT 0x13
44 #define MII_M1011_IEVENT_CLEAR 0x0000
46 #define MII_M1011_IMASK 0x12
47 #define MII_M1011_IMASK_INIT 0x6400
48 #define MII_M1011_IMASK_CLEAR 0x0000
50 #define MII_M1011_PHY_SCR 0x10
51 #define MII_M1011_PHY_SCR_MDI 0x0000
52 #define MII_M1011_PHY_SCR_MDI_X 0x0020
53 #define MII_M1011_PHY_SCR_AUTO_CROSS 0x0060
55 #define MII_M1145_PHY_EXT_ADDR_PAGE 0x16
56 #define MII_M1145_PHY_EXT_SR 0x1b
57 #define MII_M1145_PHY_EXT_CR 0x14
58 #define MII_M1145_RGMII_RX_DELAY 0x0080
59 #define MII_M1145_RGMII_TX_DELAY 0x0002
60 #define MII_M1145_HWCFG_MODE_SGMII_NO_CLK 0x4
61 #define MII_M1145_HWCFG_MODE_MASK 0xf
62 #define MII_M1145_HWCFG_FIBER_COPPER_AUTO 0x8000
64 #define MII_M1145_HWCFG_MODE_SGMII_NO_CLK 0x4
65 #define MII_M1145_HWCFG_MODE_MASK 0xf
66 #define MII_M1145_HWCFG_FIBER_COPPER_AUTO 0x8000
68 #define MII_M1111_PHY_LED_CONTROL 0x18
69 #define MII_M1111_PHY_LED_DIRECT 0x4100
70 #define MII_M1111_PHY_LED_COMBINE 0x411c
71 #define MII_M1111_PHY_EXT_CR 0x14
72 #define MII_M1111_RX_DELAY 0x80
73 #define MII_M1111_TX_DELAY 0x2
74 #define MII_M1111_PHY_EXT_SR 0x1b
76 #define MII_M1111_HWCFG_MODE_MASK 0xf
77 #define MII_M1111_HWCFG_MODE_COPPER_RGMII 0xb
78 #define MII_M1111_HWCFG_MODE_FIBER_RGMII 0x3
79 #define MII_M1111_HWCFG_MODE_SGMII_NO_CLK 0x4
80 #define MII_M1111_HWCFG_MODE_COPPER_RTBI 0x9
81 #define MII_M1111_HWCFG_FIBER_COPPER_AUTO 0x8000
82 #define MII_M1111_HWCFG_FIBER_COPPER_RES 0x2000
84 #define MII_M1111_COPPER 0
85 #define MII_M1111_FIBER 1
87 #define MII_88E1121_PHY_MSCR_PAGE 2
88 #define MII_88E1121_PHY_MSCR_REG 21
89 #define MII_88E1121_PHY_MSCR_RX_DELAY BIT(5)
90 #define MII_88E1121_PHY_MSCR_TX_DELAY BIT(4)
91 #define MII_88E1121_PHY_MSCR_DELAY_MASK (~(0x3 << 4))
93 #define MII_88E1318S_PHY_MSCR1_REG 16
94 #define MII_88E1318S_PHY_MSCR1_PAD_ODD BIT(6)
96 /* Copper Specific Interrupt Enable Register */
97 #define MII_88E1318S_PHY_CSIER 0x12
98 /* WOL Event Interrupt Enable */
99 #define MII_88E1318S_PHY_CSIER_WOL_EIE BIT(7)
101 /* LED Timer Control Register */
102 #define MII_88E1318S_PHY_LED_PAGE 0x03
103 #define MII_88E1318S_PHY_LED_TCR 0x12
104 #define MII_88E1318S_PHY_LED_TCR_FORCE_INT BIT(15)
105 #define MII_88E1318S_PHY_LED_TCR_INTn_ENABLE BIT(7)
106 #define MII_88E1318S_PHY_LED_TCR_INT_ACTIVE_LOW BIT(11)
108 /* Magic Packet MAC address registers */
109 #define MII_88E1318S_PHY_MAGIC_PACKET_WORD2 0x17
110 #define MII_88E1318S_PHY_MAGIC_PACKET_WORD1 0x18
111 #define MII_88E1318S_PHY_MAGIC_PACKET_WORD0 0x19
113 #define MII_88E1318S_PHY_WOL_PAGE 0x11
114 #define MII_88E1318S_PHY_WOL_CTRL 0x10
115 #define MII_88E1318S_PHY_WOL_CTRL_CLEAR_WOL_STATUS BIT(12)
116 #define MII_88E1318S_PHY_WOL_CTRL_MAGIC_PACKET_MATCH_ENABLE BIT(14)
118 #define MII_88E1121_PHY_LED_CTRL 16
119 #define MII_88E1121_PHY_LED_PAGE 3
120 #define MII_88E1121_PHY_LED_DEF 0x0030
122 #define MII_M1011_PHY_STATUS 0x11
123 #define MII_M1011_PHY_STATUS_1000 0x8000
124 #define MII_M1011_PHY_STATUS_100 0x4000
125 #define MII_M1011_PHY_STATUS_SPD_MASK 0xc000
126 #define MII_M1011_PHY_STATUS_FULLDUPLEX 0x2000
127 #define MII_M1011_PHY_STATUS_RESOLVED 0x0800
128 #define MII_M1011_PHY_STATUS_LINK 0x0400
130 #define MII_M1116R_CONTROL_REG_MAC 21
132 #define MII_88E3016_PHY_SPEC_CTRL 0x10
133 #define MII_88E3016_DISABLE_SCRAMBLER 0x0200
134 #define MII_88E3016_AUTO_MDIX_CROSSOVER 0x0030
136 #define MII_88E1510_GEN_CTRL_REG_1 0x14
137 #define MII_88E1510_GEN_CTRL_REG_1_MODE_MASK 0x7
138 #define MII_88E1510_GEN_CTRL_REG_1_MODE_SGMII 0x1 /* SGMII to copper */
139 #define MII_88E1510_GEN_CTRL_REG_1_RESET 0x8000 /* Soft reset */
141 MODULE_DESCRIPTION("Marvell PHY driver");
142 MODULE_AUTHOR("Andy Fleming");
143 MODULE_LICENSE("GPL");
145 struct marvell_hw_stat
{
152 static struct marvell_hw_stat marvell_hw_stats
[] = {
153 { "phy_receive_errors", 0, 21, 16},
154 { "phy_idle_errors", 0, 10, 8 },
157 struct marvell_priv
{
158 u64 stats
[ARRAY_SIZE(marvell_hw_stats
)];
161 static int marvell_ack_interrupt(struct phy_device
*phydev
)
165 /* Clear the interrupts by reading the reg */
166 err
= phy_read(phydev
, MII_M1011_IEVENT
);
174 static int marvell_config_intr(struct phy_device
*phydev
)
178 if (phydev
->interrupts
== PHY_INTERRUPT_ENABLED
)
179 err
= phy_write(phydev
, MII_M1011_IMASK
, MII_M1011_IMASK_INIT
);
181 err
= phy_write(phydev
, MII_M1011_IMASK
, MII_M1011_IMASK_CLEAR
);
186 static int marvell_set_polarity(struct phy_device
*phydev
, int polarity
)
192 /* get the current settings */
193 reg
= phy_read(phydev
, MII_M1011_PHY_SCR
);
198 val
&= ~MII_M1011_PHY_SCR_AUTO_CROSS
;
201 val
|= MII_M1011_PHY_SCR_MDI
;
204 val
|= MII_M1011_PHY_SCR_MDI_X
;
206 case ETH_TP_MDI_AUTO
:
207 case ETH_TP_MDI_INVALID
:
209 val
|= MII_M1011_PHY_SCR_AUTO_CROSS
;
214 /* Set the new polarity value in the register */
215 err
= phy_write(phydev
, MII_M1011_PHY_SCR
, val
);
223 static int marvell_config_aneg(struct phy_device
*phydev
)
227 /* The Marvell PHY has an errata which requires
228 * that certain registers get written in order
229 * to restart autonegotiation */
230 err
= phy_write(phydev
, MII_BMCR
, BMCR_RESET
);
235 err
= phy_write(phydev
, 0x1d, 0x1f);
239 err
= phy_write(phydev
, 0x1e, 0x200c);
243 err
= phy_write(phydev
, 0x1d, 0x5);
247 err
= phy_write(phydev
, 0x1e, 0);
251 err
= phy_write(phydev
, 0x1e, 0x100);
255 err
= marvell_set_polarity(phydev
, phydev
->mdix
);
259 err
= phy_write(phydev
, MII_M1111_PHY_LED_CONTROL
,
260 MII_M1111_PHY_LED_DIRECT
);
264 err
= genphy_config_aneg(phydev
);
268 if (phydev
->autoneg
!= AUTONEG_ENABLE
) {
272 * A write to speed/duplex bits (that is performed by
273 * genphy_config_aneg() call above) must be followed by
274 * a software reset. Otherwise, the write has no effect.
276 bmcr
= phy_read(phydev
, MII_BMCR
);
280 err
= phy_write(phydev
, MII_BMCR
, bmcr
| BMCR_RESET
);
288 static int m88e1111_config_aneg(struct phy_device
*phydev
)
292 /* The Marvell PHY has an errata which requires
293 * that certain registers get written in order
294 * to restart autonegotiation
296 err
= phy_write(phydev
, MII_BMCR
, BMCR_RESET
);
298 err
= marvell_set_polarity(phydev
, phydev
->mdix
);
302 err
= phy_write(phydev
, MII_M1111_PHY_LED_CONTROL
,
303 MII_M1111_PHY_LED_DIRECT
);
307 err
= genphy_config_aneg(phydev
);
311 if (phydev
->autoneg
!= AUTONEG_ENABLE
) {
314 /* A write to speed/duplex bits (that is performed by
315 * genphy_config_aneg() call above) must be followed by
316 * a software reset. Otherwise, the write has no effect.
318 bmcr
= phy_read(phydev
, MII_BMCR
);
322 err
= phy_write(phydev
, MII_BMCR
, bmcr
| BMCR_RESET
);
330 #ifdef CONFIG_OF_MDIO
332 * Set and/or override some configuration registers based on the
333 * marvell,reg-init property stored in the of_node for the phydev.
335 * marvell,reg-init = <reg-page reg mask value>,...;
337 * There may be one or more sets of <reg-page reg mask value>:
339 * reg-page: which register bank to use.
341 * mask: if non-zero, ANDed with existing register value.
342 * value: ORed with the masked value and written to the regiser.
345 static int marvell_of_reg_init(struct phy_device
*phydev
)
348 int len
, i
, saved_page
, current_page
, page_changed
, ret
;
350 if (!phydev
->mdio
.dev
.of_node
)
353 paddr
= of_get_property(phydev
->mdio
.dev
.of_node
,
354 "marvell,reg-init", &len
);
355 if (!paddr
|| len
< (4 * sizeof(*paddr
)))
358 saved_page
= phy_read(phydev
, MII_MARVELL_PHY_PAGE
);
362 current_page
= saved_page
;
365 len
/= sizeof(*paddr
);
366 for (i
= 0; i
< len
- 3; i
+= 4) {
367 u16 reg_page
= be32_to_cpup(paddr
+ i
);
368 u16 reg
= be32_to_cpup(paddr
+ i
+ 1);
369 u16 mask
= be32_to_cpup(paddr
+ i
+ 2);
370 u16 val_bits
= be32_to_cpup(paddr
+ i
+ 3);
373 if (reg_page
!= current_page
) {
374 current_page
= reg_page
;
376 ret
= phy_write(phydev
, MII_MARVELL_PHY_PAGE
, reg_page
);
383 val
= phy_read(phydev
, reg
);
392 ret
= phy_write(phydev
, reg
, val
);
399 i
= phy_write(phydev
, MII_MARVELL_PHY_PAGE
, saved_page
);
406 static int marvell_of_reg_init(struct phy_device
*phydev
)
410 #endif /* CONFIG_OF_MDIO */
412 static int m88e1121_config_aneg(struct phy_device
*phydev
)
414 int err
, oldpage
, mscr
;
416 oldpage
= phy_read(phydev
, MII_MARVELL_PHY_PAGE
);
418 err
= phy_write(phydev
, MII_MARVELL_PHY_PAGE
,
419 MII_88E1121_PHY_MSCR_PAGE
);
423 if (phy_interface_is_rgmii(phydev
)) {
425 mscr
= phy_read(phydev
, MII_88E1121_PHY_MSCR_REG
) &
426 MII_88E1121_PHY_MSCR_DELAY_MASK
;
428 if (phydev
->interface
== PHY_INTERFACE_MODE_RGMII_ID
)
429 mscr
|= (MII_88E1121_PHY_MSCR_RX_DELAY
|
430 MII_88E1121_PHY_MSCR_TX_DELAY
);
431 else if (phydev
->interface
== PHY_INTERFACE_MODE_RGMII_RXID
)
432 mscr
|= MII_88E1121_PHY_MSCR_RX_DELAY
;
433 else if (phydev
->interface
== PHY_INTERFACE_MODE_RGMII_TXID
)
434 mscr
|= MII_88E1121_PHY_MSCR_TX_DELAY
;
436 err
= phy_write(phydev
, MII_88E1121_PHY_MSCR_REG
, mscr
);
441 phy_write(phydev
, MII_MARVELL_PHY_PAGE
, oldpage
);
443 err
= phy_write(phydev
, MII_BMCR
, BMCR_RESET
);
447 err
= phy_write(phydev
, MII_M1011_PHY_SCR
,
448 MII_M1011_PHY_SCR_AUTO_CROSS
);
452 return genphy_config_aneg(phydev
);
455 static int m88e1318_config_aneg(struct phy_device
*phydev
)
457 int err
, oldpage
, mscr
;
459 oldpage
= phy_read(phydev
, MII_MARVELL_PHY_PAGE
);
461 err
= phy_write(phydev
, MII_MARVELL_PHY_PAGE
,
462 MII_88E1121_PHY_MSCR_PAGE
);
466 mscr
= phy_read(phydev
, MII_88E1318S_PHY_MSCR1_REG
);
467 mscr
|= MII_88E1318S_PHY_MSCR1_PAD_ODD
;
469 err
= phy_write(phydev
, MII_88E1318S_PHY_MSCR1_REG
, mscr
);
473 err
= phy_write(phydev
, MII_MARVELL_PHY_PAGE
, oldpage
);
477 return m88e1121_config_aneg(phydev
);
480 static int m88e1510_config_aneg(struct phy_device
*phydev
)
484 err
= m88e1318_config_aneg(phydev
);
491 static int marvell_config_init(struct phy_device
*phydev
)
493 /* Set registers from marvell,reg-init DT property */
494 return marvell_of_reg_init(phydev
);
497 static int m88e1116r_config_init(struct phy_device
*phydev
)
502 temp
= phy_read(phydev
, MII_BMCR
);
504 err
= phy_write(phydev
, MII_BMCR
, temp
);
510 err
= phy_write(phydev
, MII_MARVELL_PHY_PAGE
, 0);
514 temp
= phy_read(phydev
, MII_M1011_PHY_SCR
);
515 temp
|= (7 << 12); /* max number of gigabit attempts */
516 temp
|= (1 << 11); /* enable downshift */
517 temp
|= MII_M1011_PHY_SCR_AUTO_CROSS
;
518 err
= phy_write(phydev
, MII_M1011_PHY_SCR
, temp
);
522 err
= phy_write(phydev
, MII_MARVELL_PHY_PAGE
, 2);
525 temp
= phy_read(phydev
, MII_M1116R_CONTROL_REG_MAC
);
528 err
= phy_write(phydev
, MII_M1116R_CONTROL_REG_MAC
, temp
);
531 err
= phy_write(phydev
, MII_MARVELL_PHY_PAGE
, 0);
535 temp
= phy_read(phydev
, MII_BMCR
);
537 err
= phy_write(phydev
, MII_BMCR
, temp
);
543 return marvell_config_init(phydev
);
546 static int m88e3016_config_init(struct phy_device
*phydev
)
550 /* Enable Scrambler and Auto-Crossover */
551 reg
= phy_read(phydev
, MII_88E3016_PHY_SPEC_CTRL
);
555 reg
&= ~MII_88E3016_DISABLE_SCRAMBLER
;
556 reg
|= MII_88E3016_AUTO_MDIX_CROSSOVER
;
558 reg
= phy_write(phydev
, MII_88E3016_PHY_SPEC_CTRL
, reg
);
562 return marvell_config_init(phydev
);
565 static int m88e1111_config_init(struct phy_device
*phydev
)
570 if (phy_interface_is_rgmii(phydev
)) {
572 temp
= phy_read(phydev
, MII_M1111_PHY_EXT_CR
);
576 if (phydev
->interface
== PHY_INTERFACE_MODE_RGMII_ID
) {
577 temp
|= (MII_M1111_RX_DELAY
| MII_M1111_TX_DELAY
);
578 } else if (phydev
->interface
== PHY_INTERFACE_MODE_RGMII_RXID
) {
579 temp
&= ~MII_M1111_TX_DELAY
;
580 temp
|= MII_M1111_RX_DELAY
;
581 } else if (phydev
->interface
== PHY_INTERFACE_MODE_RGMII_TXID
) {
582 temp
&= ~MII_M1111_RX_DELAY
;
583 temp
|= MII_M1111_TX_DELAY
;
586 err
= phy_write(phydev
, MII_M1111_PHY_EXT_CR
, temp
);
590 temp
= phy_read(phydev
, MII_M1111_PHY_EXT_SR
);
594 temp
&= ~(MII_M1111_HWCFG_MODE_MASK
);
596 if (temp
& MII_M1111_HWCFG_FIBER_COPPER_RES
)
597 temp
|= MII_M1111_HWCFG_MODE_FIBER_RGMII
;
599 temp
|= MII_M1111_HWCFG_MODE_COPPER_RGMII
;
601 err
= phy_write(phydev
, MII_M1111_PHY_EXT_SR
, temp
);
606 if (phydev
->interface
== PHY_INTERFACE_MODE_SGMII
) {
607 temp
= phy_read(phydev
, MII_M1111_PHY_EXT_SR
);
611 temp
&= ~(MII_M1111_HWCFG_MODE_MASK
);
612 temp
|= MII_M1111_HWCFG_MODE_SGMII_NO_CLK
;
613 temp
|= MII_M1111_HWCFG_FIBER_COPPER_AUTO
;
615 err
= phy_write(phydev
, MII_M1111_PHY_EXT_SR
, temp
);
619 /* make sure copper is selected */
620 err
= phy_read(phydev
, MII_M1145_PHY_EXT_ADDR_PAGE
);
624 err
= phy_write(phydev
, MII_M1145_PHY_EXT_ADDR_PAGE
,
630 if (phydev
->interface
== PHY_INTERFACE_MODE_RTBI
) {
631 temp
= phy_read(phydev
, MII_M1111_PHY_EXT_CR
);
634 temp
|= (MII_M1111_RX_DELAY
| MII_M1111_TX_DELAY
);
635 err
= phy_write(phydev
, MII_M1111_PHY_EXT_CR
, temp
);
639 temp
= phy_read(phydev
, MII_M1111_PHY_EXT_SR
);
642 temp
&= ~(MII_M1111_HWCFG_MODE_MASK
| MII_M1111_HWCFG_FIBER_COPPER_RES
);
643 temp
|= 0x7 | MII_M1111_HWCFG_FIBER_COPPER_AUTO
;
644 err
= phy_write(phydev
, MII_M1111_PHY_EXT_SR
, temp
);
649 err
= phy_write(phydev
, MII_BMCR
, BMCR_RESET
);
653 temp
= phy_read(phydev
, MII_BMCR
);
654 while (temp
& BMCR_RESET
);
656 temp
= phy_read(phydev
, MII_M1111_PHY_EXT_SR
);
659 temp
&= ~(MII_M1111_HWCFG_MODE_MASK
| MII_M1111_HWCFG_FIBER_COPPER_RES
);
660 temp
|= MII_M1111_HWCFG_MODE_COPPER_RTBI
| MII_M1111_HWCFG_FIBER_COPPER_AUTO
;
661 err
= phy_write(phydev
, MII_M1111_PHY_EXT_SR
, temp
);
666 err
= marvell_of_reg_init(phydev
);
670 return phy_write(phydev
, MII_BMCR
, BMCR_RESET
);
673 static int m88e1121_config_init(struct phy_device
*phydev
)
677 oldpage
= phy_read(phydev
, MII_MARVELL_PHY_PAGE
);
679 err
= phy_write(phydev
, MII_MARVELL_PHY_PAGE
, MII_88E1121_PHY_LED_PAGE
);
683 /* Default PHY LED config: LED[0] .. Link, LED[1] .. Activity */
684 err
= phy_write(phydev
, MII_88E1121_PHY_LED_CTRL
,
685 MII_88E1121_PHY_LED_DEF
);
689 phy_write(phydev
, MII_MARVELL_PHY_PAGE
, oldpage
);
691 /* Set marvell,reg-init configuration from device tree */
692 return marvell_config_init(phydev
);
695 static int m88e1510_config_init(struct phy_device
*phydev
)
700 /* SGMII-to-Copper mode initialization */
701 if (phydev
->interface
== PHY_INTERFACE_MODE_SGMII
) {
703 err
= phy_write(phydev
, MII_MARVELL_PHY_PAGE
, 18);
707 /* In reg 20, write MODE[2:0] = 0x1 (SGMII to Copper) */
708 temp
= phy_read(phydev
, MII_88E1510_GEN_CTRL_REG_1
);
709 temp
&= ~MII_88E1510_GEN_CTRL_REG_1_MODE_MASK
;
710 temp
|= MII_88E1510_GEN_CTRL_REG_1_MODE_SGMII
;
711 err
= phy_write(phydev
, MII_88E1510_GEN_CTRL_REG_1
, temp
);
715 /* PHY reset is necessary after changing MODE[2:0] */
716 temp
|= MII_88E1510_GEN_CTRL_REG_1_RESET
;
717 err
= phy_write(phydev
, MII_88E1510_GEN_CTRL_REG_1
, temp
);
721 /* Reset page selection */
722 err
= phy_write(phydev
, MII_MARVELL_PHY_PAGE
, 0);
727 return m88e1121_config_init(phydev
);
730 static int m88e1118_config_aneg(struct phy_device
*phydev
)
734 err
= phy_write(phydev
, MII_BMCR
, BMCR_RESET
);
738 err
= phy_write(phydev
, MII_M1011_PHY_SCR
,
739 MII_M1011_PHY_SCR_AUTO_CROSS
);
743 err
= genphy_config_aneg(phydev
);
747 static int m88e1118_config_init(struct phy_device
*phydev
)
752 err
= phy_write(phydev
, MII_MARVELL_PHY_PAGE
, 0x0002);
756 /* Enable 1000 Mbit */
757 err
= phy_write(phydev
, 0x15, 0x1070);
762 err
= phy_write(phydev
, MII_MARVELL_PHY_PAGE
, 0x0003);
766 /* Adjust LED Control */
767 if (phydev
->dev_flags
& MARVELL_PHY_M1118_DNS323_LEDS
)
768 err
= phy_write(phydev
, 0x10, 0x1100);
770 err
= phy_write(phydev
, 0x10, 0x021e);
774 err
= marvell_of_reg_init(phydev
);
779 err
= phy_write(phydev
, MII_MARVELL_PHY_PAGE
, 0x0);
783 return phy_write(phydev
, MII_BMCR
, BMCR_RESET
);
786 static int m88e1149_config_init(struct phy_device
*phydev
)
791 err
= phy_write(phydev
, MII_MARVELL_PHY_PAGE
, 0x0002);
795 /* Enable 1000 Mbit */
796 err
= phy_write(phydev
, 0x15, 0x1048);
800 err
= marvell_of_reg_init(phydev
);
805 err
= phy_write(phydev
, MII_MARVELL_PHY_PAGE
, 0x0);
809 return phy_write(phydev
, MII_BMCR
, BMCR_RESET
);
812 static int m88e1145_config_init(struct phy_device
*phydev
)
817 /* Take care of errata E0 & E1 */
818 err
= phy_write(phydev
, 0x1d, 0x001b);
822 err
= phy_write(phydev
, 0x1e, 0x418f);
826 err
= phy_write(phydev
, 0x1d, 0x0016);
830 err
= phy_write(phydev
, 0x1e, 0xa2da);
834 if (phydev
->interface
== PHY_INTERFACE_MODE_RGMII_ID
) {
835 int temp
= phy_read(phydev
, MII_M1145_PHY_EXT_CR
);
839 temp
|= (MII_M1145_RGMII_RX_DELAY
| MII_M1145_RGMII_TX_DELAY
);
841 err
= phy_write(phydev
, MII_M1145_PHY_EXT_CR
, temp
);
845 if (phydev
->dev_flags
& MARVELL_PHY_M1145_FLAGS_RESISTANCE
) {
846 err
= phy_write(phydev
, 0x1d, 0x0012);
850 temp
= phy_read(phydev
, 0x1e);
855 temp
|= 2 << 9; /* 36 ohm */
856 temp
|= 2 << 6; /* 39 ohm */
858 err
= phy_write(phydev
, 0x1e, temp
);
862 err
= phy_write(phydev
, 0x1d, 0x3);
866 err
= phy_write(phydev
, 0x1e, 0x8000);
872 if (phydev
->interface
== PHY_INTERFACE_MODE_SGMII
) {
873 temp
= phy_read(phydev
, MII_M1145_PHY_EXT_SR
);
877 temp
&= ~MII_M1145_HWCFG_MODE_MASK
;
878 temp
|= MII_M1145_HWCFG_MODE_SGMII_NO_CLK
;
879 temp
|= MII_M1145_HWCFG_FIBER_COPPER_AUTO
;
881 err
= phy_write(phydev
, MII_M1145_PHY_EXT_SR
, temp
);
886 err
= marvell_of_reg_init(phydev
);
893 /* marvell_read_status
895 * Generic status code does not detect Fiber correctly!
897 * Check the link, then figure out the current state
898 * by comparing what we advertise with what the link partner
899 * advertises. Start by checking the gigabit possibilities,
900 * then move on to 10/100.
902 static int marvell_read_status(struct phy_device
*phydev
)
910 /* Update the link, but return if there
912 err
= genphy_update_link(phydev
);
916 if (AUTONEG_ENABLE
== phydev
->autoneg
) {
917 status
= phy_read(phydev
, MII_M1011_PHY_STATUS
);
921 lpa
= phy_read(phydev
, MII_LPA
);
925 lpagb
= phy_read(phydev
, MII_STAT1000
);
929 adv
= phy_read(phydev
, MII_ADVERTISE
);
933 phydev
->lp_advertising
= mii_stat1000_to_ethtool_lpa_t(lpagb
) |
934 mii_lpa_to_ethtool_lpa_t(lpa
);
938 if (status
& MII_M1011_PHY_STATUS_FULLDUPLEX
)
939 phydev
->duplex
= DUPLEX_FULL
;
941 phydev
->duplex
= DUPLEX_HALF
;
943 status
= status
& MII_M1011_PHY_STATUS_SPD_MASK
;
944 phydev
->pause
= phydev
->asym_pause
= 0;
947 case MII_M1011_PHY_STATUS_1000
:
948 phydev
->speed
= SPEED_1000
;
951 case MII_M1011_PHY_STATUS_100
:
952 phydev
->speed
= SPEED_100
;
956 phydev
->speed
= SPEED_10
;
960 if (phydev
->duplex
== DUPLEX_FULL
) {
961 phydev
->pause
= lpa
& LPA_PAUSE_CAP
? 1 : 0;
962 phydev
->asym_pause
= lpa
& LPA_PAUSE_ASYM
? 1 : 0;
965 int bmcr
= phy_read(phydev
, MII_BMCR
);
970 if (bmcr
& BMCR_FULLDPLX
)
971 phydev
->duplex
= DUPLEX_FULL
;
973 phydev
->duplex
= DUPLEX_HALF
;
975 if (bmcr
& BMCR_SPEED1000
)
976 phydev
->speed
= SPEED_1000
;
977 else if (bmcr
& BMCR_SPEED100
)
978 phydev
->speed
= SPEED_100
;
980 phydev
->speed
= SPEED_10
;
982 phydev
->pause
= phydev
->asym_pause
= 0;
983 phydev
->lp_advertising
= 0;
989 static int marvell_aneg_done(struct phy_device
*phydev
)
991 int retval
= phy_read(phydev
, MII_M1011_PHY_STATUS
);
992 return (retval
< 0) ? retval
: (retval
& MII_M1011_PHY_STATUS_RESOLVED
);
995 static int m88e1121_did_interrupt(struct phy_device
*phydev
)
999 imask
= phy_read(phydev
, MII_M1011_IEVENT
);
1001 if (imask
& MII_M1011_IMASK_INIT
)
1007 static void m88e1318_get_wol(struct phy_device
*phydev
, struct ethtool_wolinfo
*wol
)
1009 wol
->supported
= WAKE_MAGIC
;
1012 if (phy_write(phydev
, MII_MARVELL_PHY_PAGE
,
1013 MII_88E1318S_PHY_WOL_PAGE
) < 0)
1016 if (phy_read(phydev
, MII_88E1318S_PHY_WOL_CTRL
) &
1017 MII_88E1318S_PHY_WOL_CTRL_MAGIC_PACKET_MATCH_ENABLE
)
1018 wol
->wolopts
|= WAKE_MAGIC
;
1020 if (phy_write(phydev
, MII_MARVELL_PHY_PAGE
, 0x00) < 0)
1024 static int m88e1318_set_wol(struct phy_device
*phydev
, struct ethtool_wolinfo
*wol
)
1026 int err
, oldpage
, temp
;
1028 oldpage
= phy_read(phydev
, MII_MARVELL_PHY_PAGE
);
1030 if (wol
->wolopts
& WAKE_MAGIC
) {
1031 /* Explicitly switch to page 0x00, just to be sure */
1032 err
= phy_write(phydev
, MII_MARVELL_PHY_PAGE
, 0x00);
1036 /* Enable the WOL interrupt */
1037 temp
= phy_read(phydev
, MII_88E1318S_PHY_CSIER
);
1038 temp
|= MII_88E1318S_PHY_CSIER_WOL_EIE
;
1039 err
= phy_write(phydev
, MII_88E1318S_PHY_CSIER
, temp
);
1043 err
= phy_write(phydev
, MII_MARVELL_PHY_PAGE
,
1044 MII_88E1318S_PHY_LED_PAGE
);
1048 /* Setup LED[2] as interrupt pin (active low) */
1049 temp
= phy_read(phydev
, MII_88E1318S_PHY_LED_TCR
);
1050 temp
&= ~MII_88E1318S_PHY_LED_TCR_FORCE_INT
;
1051 temp
|= MII_88E1318S_PHY_LED_TCR_INTn_ENABLE
;
1052 temp
|= MII_88E1318S_PHY_LED_TCR_INT_ACTIVE_LOW
;
1053 err
= phy_write(phydev
, MII_88E1318S_PHY_LED_TCR
, temp
);
1057 err
= phy_write(phydev
, MII_MARVELL_PHY_PAGE
,
1058 MII_88E1318S_PHY_WOL_PAGE
);
1062 /* Store the device address for the magic packet */
1063 err
= phy_write(phydev
, MII_88E1318S_PHY_MAGIC_PACKET_WORD2
,
1064 ((phydev
->attached_dev
->dev_addr
[5] << 8) |
1065 phydev
->attached_dev
->dev_addr
[4]));
1068 err
= phy_write(phydev
, MII_88E1318S_PHY_MAGIC_PACKET_WORD1
,
1069 ((phydev
->attached_dev
->dev_addr
[3] << 8) |
1070 phydev
->attached_dev
->dev_addr
[2]));
1073 err
= phy_write(phydev
, MII_88E1318S_PHY_MAGIC_PACKET_WORD0
,
1074 ((phydev
->attached_dev
->dev_addr
[1] << 8) |
1075 phydev
->attached_dev
->dev_addr
[0]));
1079 /* Clear WOL status and enable magic packet matching */
1080 temp
= phy_read(phydev
, MII_88E1318S_PHY_WOL_CTRL
);
1081 temp
|= MII_88E1318S_PHY_WOL_CTRL_CLEAR_WOL_STATUS
;
1082 temp
|= MII_88E1318S_PHY_WOL_CTRL_MAGIC_PACKET_MATCH_ENABLE
;
1083 err
= phy_write(phydev
, MII_88E1318S_PHY_WOL_CTRL
, temp
);
1087 err
= phy_write(phydev
, MII_MARVELL_PHY_PAGE
,
1088 MII_88E1318S_PHY_WOL_PAGE
);
1092 /* Clear WOL status and disable magic packet matching */
1093 temp
= phy_read(phydev
, MII_88E1318S_PHY_WOL_CTRL
);
1094 temp
|= MII_88E1318S_PHY_WOL_CTRL_CLEAR_WOL_STATUS
;
1095 temp
&= ~MII_88E1318S_PHY_WOL_CTRL_MAGIC_PACKET_MATCH_ENABLE
;
1096 err
= phy_write(phydev
, MII_88E1318S_PHY_WOL_CTRL
, temp
);
1101 err
= phy_write(phydev
, MII_MARVELL_PHY_PAGE
, oldpage
);
1108 static int marvell_get_sset_count(struct phy_device
*phydev
)
1110 return ARRAY_SIZE(marvell_hw_stats
);
1113 static void marvell_get_strings(struct phy_device
*phydev
, u8
*data
)
1117 for (i
= 0; i
< ARRAY_SIZE(marvell_hw_stats
); i
++) {
1118 memcpy(data
+ i
* ETH_GSTRING_LEN
,
1119 marvell_hw_stats
[i
].string
, ETH_GSTRING_LEN
);
1124 #define UINT64_MAX (u64)(~((u64)0))
1126 static u64
marvell_get_stat(struct phy_device
*phydev
, int i
)
1128 struct marvell_hw_stat stat
= marvell_hw_stats
[i
];
1129 struct marvell_priv
*priv
= phydev
->priv
;
1130 int err
, oldpage
, val
;
1133 oldpage
= phy_read(phydev
, MII_MARVELL_PHY_PAGE
);
1134 err
= phy_write(phydev
, MII_MARVELL_PHY_PAGE
,
1139 val
= phy_read(phydev
, stat
.reg
);
1143 val
= val
& ((1 << stat
.bits
) - 1);
1144 priv
->stats
[i
] += val
;
1145 ret
= priv
->stats
[i
];
1148 phy_write(phydev
, MII_MARVELL_PHY_PAGE
, oldpage
);
1153 static void marvell_get_stats(struct phy_device
*phydev
,
1154 struct ethtool_stats
*stats
, u64
*data
)
1158 for (i
= 0; i
< ARRAY_SIZE(marvell_hw_stats
); i
++)
1159 data
[i
] = marvell_get_stat(phydev
, i
);
1162 static int marvell_probe(struct phy_device
*phydev
)
1164 struct marvell_priv
*priv
;
1166 priv
= devm_kzalloc(&phydev
->mdio
.dev
, sizeof(*priv
), GFP_KERNEL
);
1170 phydev
->priv
= priv
;
1175 static struct phy_driver marvell_drivers
[] = {
1177 .phy_id
= MARVELL_PHY_ID_88E1101
,
1178 .phy_id_mask
= MARVELL_PHY_ID_MASK
,
1179 .name
= "Marvell 88E1101",
1180 .features
= PHY_GBIT_FEATURES
,
1181 .probe
= marvell_probe
,
1182 .flags
= PHY_HAS_INTERRUPT
,
1183 .config_init
= &marvell_config_init
,
1184 .config_aneg
= &marvell_config_aneg
,
1185 .read_status
= &genphy_read_status
,
1186 .ack_interrupt
= &marvell_ack_interrupt
,
1187 .config_intr
= &marvell_config_intr
,
1188 .resume
= &genphy_resume
,
1189 .suspend
= &genphy_suspend
,
1190 .get_sset_count
= marvell_get_sset_count
,
1191 .get_strings
= marvell_get_strings
,
1192 .get_stats
= marvell_get_stats
,
1195 .phy_id
= MARVELL_PHY_ID_88E1112
,
1196 .phy_id_mask
= MARVELL_PHY_ID_MASK
,
1197 .name
= "Marvell 88E1112",
1198 .features
= PHY_GBIT_FEATURES
,
1199 .flags
= PHY_HAS_INTERRUPT
,
1200 .probe
= marvell_probe
,
1201 .config_init
= &m88e1111_config_init
,
1202 .config_aneg
= &marvell_config_aneg
,
1203 .read_status
= &genphy_read_status
,
1204 .ack_interrupt
= &marvell_ack_interrupt
,
1205 .config_intr
= &marvell_config_intr
,
1206 .resume
= &genphy_resume
,
1207 .suspend
= &genphy_suspend
,
1208 .get_sset_count
= marvell_get_sset_count
,
1209 .get_strings
= marvell_get_strings
,
1210 .get_stats
= marvell_get_stats
,
1213 .phy_id
= MARVELL_PHY_ID_88E1111
,
1214 .phy_id_mask
= MARVELL_PHY_ID_MASK
,
1215 .name
= "Marvell 88E1111",
1216 .features
= PHY_GBIT_FEATURES
,
1217 .flags
= PHY_HAS_INTERRUPT
,
1218 .probe
= marvell_probe
,
1219 .config_init
= &m88e1111_config_init
,
1220 .config_aneg
= &m88e1111_config_aneg
,
1221 .read_status
= &marvell_read_status
,
1222 .ack_interrupt
= &marvell_ack_interrupt
,
1223 .config_intr
= &marvell_config_intr
,
1224 .resume
= &genphy_resume
,
1225 .suspend
= &genphy_suspend
,
1226 .get_sset_count
= marvell_get_sset_count
,
1227 .get_strings
= marvell_get_strings
,
1228 .get_stats
= marvell_get_stats
,
1231 .phy_id
= MARVELL_PHY_ID_88E1118
,
1232 .phy_id_mask
= MARVELL_PHY_ID_MASK
,
1233 .name
= "Marvell 88E1118",
1234 .features
= PHY_GBIT_FEATURES
,
1235 .flags
= PHY_HAS_INTERRUPT
,
1236 .probe
= marvell_probe
,
1237 .config_init
= &m88e1118_config_init
,
1238 .config_aneg
= &m88e1118_config_aneg
,
1239 .read_status
= &genphy_read_status
,
1240 .ack_interrupt
= &marvell_ack_interrupt
,
1241 .config_intr
= &marvell_config_intr
,
1242 .resume
= &genphy_resume
,
1243 .suspend
= &genphy_suspend
,
1244 .get_sset_count
= marvell_get_sset_count
,
1245 .get_strings
= marvell_get_strings
,
1246 .get_stats
= marvell_get_stats
,
1249 .phy_id
= MARVELL_PHY_ID_88E1121R
,
1250 .phy_id_mask
= MARVELL_PHY_ID_MASK
,
1251 .name
= "Marvell 88E1121R",
1252 .features
= PHY_GBIT_FEATURES
,
1253 .flags
= PHY_HAS_INTERRUPT
,
1254 .probe
= marvell_probe
,
1255 .config_init
= &m88e1121_config_init
,
1256 .config_aneg
= &m88e1121_config_aneg
,
1257 .read_status
= &marvell_read_status
,
1258 .ack_interrupt
= &marvell_ack_interrupt
,
1259 .config_intr
= &marvell_config_intr
,
1260 .did_interrupt
= &m88e1121_did_interrupt
,
1261 .resume
= &genphy_resume
,
1262 .suspend
= &genphy_suspend
,
1263 .get_sset_count
= marvell_get_sset_count
,
1264 .get_strings
= marvell_get_strings
,
1265 .get_stats
= marvell_get_stats
,
1268 .phy_id
= MARVELL_PHY_ID_88E1318S
,
1269 .phy_id_mask
= MARVELL_PHY_ID_MASK
,
1270 .name
= "Marvell 88E1318S",
1271 .features
= PHY_GBIT_FEATURES
,
1272 .flags
= PHY_HAS_INTERRUPT
,
1273 .probe
= marvell_probe
,
1274 .config_init
= &m88e1121_config_init
,
1275 .config_aneg
= &m88e1318_config_aneg
,
1276 .read_status
= &marvell_read_status
,
1277 .ack_interrupt
= &marvell_ack_interrupt
,
1278 .config_intr
= &marvell_config_intr
,
1279 .did_interrupt
= &m88e1121_did_interrupt
,
1280 .get_wol
= &m88e1318_get_wol
,
1281 .set_wol
= &m88e1318_set_wol
,
1282 .resume
= &genphy_resume
,
1283 .suspend
= &genphy_suspend
,
1284 .get_sset_count
= marvell_get_sset_count
,
1285 .get_strings
= marvell_get_strings
,
1286 .get_stats
= marvell_get_stats
,
1289 .phy_id
= MARVELL_PHY_ID_88E1145
,
1290 .phy_id_mask
= MARVELL_PHY_ID_MASK
,
1291 .name
= "Marvell 88E1145",
1292 .features
= PHY_GBIT_FEATURES
,
1293 .flags
= PHY_HAS_INTERRUPT
,
1294 .probe
= marvell_probe
,
1295 .config_init
= &m88e1145_config_init
,
1296 .config_aneg
= &marvell_config_aneg
,
1297 .read_status
= &genphy_read_status
,
1298 .ack_interrupt
= &marvell_ack_interrupt
,
1299 .config_intr
= &marvell_config_intr
,
1300 .resume
= &genphy_resume
,
1301 .suspend
= &genphy_suspend
,
1302 .get_sset_count
= marvell_get_sset_count
,
1303 .get_strings
= marvell_get_strings
,
1304 .get_stats
= marvell_get_stats
,
1307 .phy_id
= MARVELL_PHY_ID_88E1149R
,
1308 .phy_id_mask
= MARVELL_PHY_ID_MASK
,
1309 .name
= "Marvell 88E1149R",
1310 .features
= PHY_GBIT_FEATURES
,
1311 .flags
= PHY_HAS_INTERRUPT
,
1312 .probe
= marvell_probe
,
1313 .config_init
= &m88e1149_config_init
,
1314 .config_aneg
= &m88e1118_config_aneg
,
1315 .read_status
= &genphy_read_status
,
1316 .ack_interrupt
= &marvell_ack_interrupt
,
1317 .config_intr
= &marvell_config_intr
,
1318 .resume
= &genphy_resume
,
1319 .suspend
= &genphy_suspend
,
1320 .get_sset_count
= marvell_get_sset_count
,
1321 .get_strings
= marvell_get_strings
,
1322 .get_stats
= marvell_get_stats
,
1325 .phy_id
= MARVELL_PHY_ID_88E1240
,
1326 .phy_id_mask
= MARVELL_PHY_ID_MASK
,
1327 .name
= "Marvell 88E1240",
1328 .features
= PHY_GBIT_FEATURES
,
1329 .flags
= PHY_HAS_INTERRUPT
,
1330 .probe
= marvell_probe
,
1331 .config_init
= &m88e1111_config_init
,
1332 .config_aneg
= &marvell_config_aneg
,
1333 .read_status
= &genphy_read_status
,
1334 .ack_interrupt
= &marvell_ack_interrupt
,
1335 .config_intr
= &marvell_config_intr
,
1336 .resume
= &genphy_resume
,
1337 .suspend
= &genphy_suspend
,
1338 .get_sset_count
= marvell_get_sset_count
,
1339 .get_strings
= marvell_get_strings
,
1340 .get_stats
= marvell_get_stats
,
1343 .phy_id
= MARVELL_PHY_ID_88E1116R
,
1344 .phy_id_mask
= MARVELL_PHY_ID_MASK
,
1345 .name
= "Marvell 88E1116R",
1346 .features
= PHY_GBIT_FEATURES
,
1347 .flags
= PHY_HAS_INTERRUPT
,
1348 .probe
= marvell_probe
,
1349 .config_init
= &m88e1116r_config_init
,
1350 .config_aneg
= &genphy_config_aneg
,
1351 .read_status
= &genphy_read_status
,
1352 .ack_interrupt
= &marvell_ack_interrupt
,
1353 .config_intr
= &marvell_config_intr
,
1354 .resume
= &genphy_resume
,
1355 .suspend
= &genphy_suspend
,
1356 .get_sset_count
= marvell_get_sset_count
,
1357 .get_strings
= marvell_get_strings
,
1358 .get_stats
= marvell_get_stats
,
1361 .phy_id
= MARVELL_PHY_ID_88E1510
,
1362 .phy_id_mask
= MARVELL_PHY_ID_MASK
,
1363 .name
= "Marvell 88E1510",
1364 .features
= PHY_GBIT_FEATURES
,
1365 .flags
= PHY_HAS_INTERRUPT
,
1366 .probe
= marvell_probe
,
1367 .config_init
= &m88e1510_config_init
,
1368 .config_aneg
= &m88e1510_config_aneg
,
1369 .read_status
= &marvell_read_status
,
1370 .ack_interrupt
= &marvell_ack_interrupt
,
1371 .config_intr
= &marvell_config_intr
,
1372 .did_interrupt
= &m88e1121_did_interrupt
,
1373 .resume
= &genphy_resume
,
1374 .suspend
= &genphy_suspend
,
1375 .get_sset_count
= marvell_get_sset_count
,
1376 .get_strings
= marvell_get_strings
,
1377 .get_stats
= marvell_get_stats
,
1380 .phy_id
= MARVELL_PHY_ID_88E1540
,
1381 .phy_id_mask
= MARVELL_PHY_ID_MASK
,
1382 .name
= "Marvell 88E1540",
1383 .features
= PHY_GBIT_FEATURES
,
1384 .flags
= PHY_HAS_INTERRUPT
,
1385 .probe
= marvell_probe
,
1386 .config_init
= &marvell_config_init
,
1387 .config_aneg
= &m88e1510_config_aneg
,
1388 .read_status
= &marvell_read_status
,
1389 .ack_interrupt
= &marvell_ack_interrupt
,
1390 .config_intr
= &marvell_config_intr
,
1391 .did_interrupt
= &m88e1121_did_interrupt
,
1392 .resume
= &genphy_resume
,
1393 .suspend
= &genphy_suspend
,
1394 .get_sset_count
= marvell_get_sset_count
,
1395 .get_strings
= marvell_get_strings
,
1396 .get_stats
= marvell_get_stats
,
1399 .phy_id
= MARVELL_PHY_ID_88E3016
,
1400 .phy_id_mask
= MARVELL_PHY_ID_MASK
,
1401 .name
= "Marvell 88E3016",
1402 .features
= PHY_BASIC_FEATURES
,
1403 .flags
= PHY_HAS_INTERRUPT
,
1404 .probe
= marvell_probe
,
1405 .config_aneg
= &genphy_config_aneg
,
1406 .config_init
= &m88e3016_config_init
,
1407 .aneg_done
= &marvell_aneg_done
,
1408 .read_status
= &marvell_read_status
,
1409 .ack_interrupt
= &marvell_ack_interrupt
,
1410 .config_intr
= &marvell_config_intr
,
1411 .did_interrupt
= &m88e1121_did_interrupt
,
1412 .resume
= &genphy_resume
,
1413 .suspend
= &genphy_suspend
,
1414 .get_sset_count
= marvell_get_sset_count
,
1415 .get_strings
= marvell_get_strings
,
1416 .get_stats
= marvell_get_stats
,
1420 module_phy_driver(marvell_drivers
);
1422 static struct mdio_device_id __maybe_unused marvell_tbl
[] = {
1423 { MARVELL_PHY_ID_88E1101
, MARVELL_PHY_ID_MASK
},
1424 { MARVELL_PHY_ID_88E1112
, MARVELL_PHY_ID_MASK
},
1425 { MARVELL_PHY_ID_88E1111
, MARVELL_PHY_ID_MASK
},
1426 { MARVELL_PHY_ID_88E1118
, MARVELL_PHY_ID_MASK
},
1427 { MARVELL_PHY_ID_88E1121R
, MARVELL_PHY_ID_MASK
},
1428 { MARVELL_PHY_ID_88E1145
, MARVELL_PHY_ID_MASK
},
1429 { MARVELL_PHY_ID_88E1149R
, MARVELL_PHY_ID_MASK
},
1430 { MARVELL_PHY_ID_88E1240
, MARVELL_PHY_ID_MASK
},
1431 { MARVELL_PHY_ID_88E1318S
, MARVELL_PHY_ID_MASK
},
1432 { MARVELL_PHY_ID_88E1116R
, MARVELL_PHY_ID_MASK
},
1433 { MARVELL_PHY_ID_88E1510
, MARVELL_PHY_ID_MASK
},
1434 { MARVELL_PHY_ID_88E1540
, MARVELL_PHY_ID_MASK
},
1435 { MARVELL_PHY_ID_88E3016
, MARVELL_PHY_ID_MASK
},
1439 MODULE_DEVICE_TABLE(mdio
, marvell_tbl
);