2 * drivers/net/phy/broadcom.c
4 * Broadcom BCM5411, BCM5421 and BCM5461 Gigabit Ethernet
7 * Copyright (c) 2006 Maciej W. Rozycki
9 * Inspired by code written by Amy Fong.
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version
14 * 2 of the License, or (at your option) any later version.
17 #include "bcm-phy-lib.h"
18 #include <linux/module.h>
19 #include <linux/phy.h>
20 #include <linux/brcmphy.h>
23 #define BRCM_PHY_MODEL(phydev) \
24 ((phydev)->drv->phy_id & (phydev)->drv->phy_id_mask)
26 #define BRCM_PHY_REV(phydev) \
27 ((phydev)->drv->phy_id & ~((phydev)->drv->phy_id_mask))
29 MODULE_DESCRIPTION("Broadcom PHY driver");
30 MODULE_AUTHOR("Maciej W. Rozycki");
31 MODULE_LICENSE("GPL");
33 static int bcm54210e_config_init(struct phy_device
*phydev
)
37 val
= bcm54xx_auxctl_read(phydev
, MII_BCM54XX_AUXCTL_SHDWSEL_MISC
);
38 val
&= ~MII_BCM54XX_AUXCTL_SHDWSEL_MISC_RGMII_SKEW_EN
;
39 val
|= MII_BCM54XX_AUXCTL_MISC_WREN
;
40 bcm54xx_auxctl_write(phydev
, MII_BCM54XX_AUXCTL_SHDWSEL_MISC
, val
);
42 val
= bcm_phy_read_shadow(phydev
, BCM54810_SHD_CLK_CTL
);
43 val
&= ~BCM54810_SHD_CLK_CTL_GTXCLK_EN
;
44 bcm_phy_write_shadow(phydev
, BCM54810_SHD_CLK_CTL
, val
);
46 if (phydev
->dev_flags
& PHY_BRCM_EN_MASTER_MODE
) {
47 val
= phy_read(phydev
, MII_CTRL1000
);
48 val
|= CTL1000_AS_MASTER
| CTL1000_ENABLE_MASTER
;
49 phy_write(phydev
, MII_CTRL1000
, val
);
55 static int bcm54612e_config_init(struct phy_device
*phydev
)
59 /* Clear TX internal delay unless requested. */
60 if ((phydev
->interface
!= PHY_INTERFACE_MODE_RGMII_ID
) &&
61 (phydev
->interface
!= PHY_INTERFACE_MODE_RGMII_TXID
)) {
62 /* Disable TXD to GTXCLK clock delay (default set) */
63 /* Bit 9 is the only field in shadow register 00011 */
64 bcm_phy_write_shadow(phydev
, 0x03, 0);
67 /* Clear RX internal delay unless requested. */
68 if ((phydev
->interface
!= PHY_INTERFACE_MODE_RGMII_ID
) &&
69 (phydev
->interface
!= PHY_INTERFACE_MODE_RGMII_RXID
)) {
70 reg
= bcm54xx_auxctl_read(phydev
,
71 MII_BCM54XX_AUXCTL_SHDWSEL_MISC
);
72 /* Disable RXD to RXC delay (default set) */
73 reg
&= ~MII_BCM54XX_AUXCTL_SHDWSEL_MISC_RGMII_SKEW_EN
;
74 /* Clear shadow selector field */
75 reg
&= ~MII_BCM54XX_AUXCTL_SHDWSEL_MASK
;
76 bcm54xx_auxctl_write(phydev
, MII_BCM54XX_AUXCTL_SHDWSEL_MISC
,
77 MII_BCM54XX_AUXCTL_MISC_WREN
| reg
);
80 /* Enable CLK125 MUX on LED4 if ref clock is enabled. */
81 if (!(phydev
->dev_flags
& PHY_BRCM_RX_REFCLK_UNUSED
)) {
84 reg
= bcm_phy_read_exp(phydev
, BCM54612E_EXP_SPARE0
);
85 err
= bcm_phy_write_exp(phydev
, BCM54612E_EXP_SPARE0
,
86 BCM54612E_LED4_CLK125OUT_EN
| reg
);
95 static int bcm5481x_config(struct phy_device
*phydev
)
99 /* handling PHY's internal RX clock delay */
100 val
= bcm54xx_auxctl_read(phydev
, MII_BCM54XX_AUXCTL_SHDWSEL_MISC
);
101 val
|= MII_BCM54XX_AUXCTL_MISC_WREN
;
102 if (phydev
->interface
== PHY_INTERFACE_MODE_RGMII
||
103 phydev
->interface
== PHY_INTERFACE_MODE_RGMII_TXID
) {
104 /* Disable RGMII RXC-RXD skew */
105 val
&= ~MII_BCM54XX_AUXCTL_SHDWSEL_MISC_RGMII_SKEW_EN
;
107 if (phydev
->interface
== PHY_INTERFACE_MODE_RGMII_ID
||
108 phydev
->interface
== PHY_INTERFACE_MODE_RGMII_RXID
) {
109 /* Enable RGMII RXC-RXD skew */
110 val
|= MII_BCM54XX_AUXCTL_SHDWSEL_MISC_RGMII_SKEW_EN
;
112 rc
= bcm54xx_auxctl_write(phydev
, MII_BCM54XX_AUXCTL_SHDWSEL_MISC
,
117 /* handling PHY's internal TX clock delay */
118 val
= bcm_phy_read_shadow(phydev
, BCM54810_SHD_CLK_CTL
);
119 if (phydev
->interface
== PHY_INTERFACE_MODE_RGMII
||
120 phydev
->interface
== PHY_INTERFACE_MODE_RGMII_RXID
) {
121 /* Disable internal TX clock delay */
122 val
&= ~BCM54810_SHD_CLK_CTL_GTXCLK_EN
;
124 if (phydev
->interface
== PHY_INTERFACE_MODE_RGMII_ID
||
125 phydev
->interface
== PHY_INTERFACE_MODE_RGMII_TXID
) {
126 /* Enable internal TX clock delay */
127 val
|= BCM54810_SHD_CLK_CTL_GTXCLK_EN
;
129 rc
= bcm_phy_write_shadow(phydev
, BCM54810_SHD_CLK_CTL
, val
);
136 /* Needs SMDSP clock enabled via bcm54xx_phydsp_config() */
137 static int bcm50610_a0_workaround(struct phy_device
*phydev
)
141 err
= bcm_phy_write_exp(phydev
, MII_BCM54XX_EXP_AADJ1CH0
,
142 MII_BCM54XX_EXP_AADJ1CH0_SWP_ABCD_OEN
|
143 MII_BCM54XX_EXP_AADJ1CH0_SWSEL_THPF
);
147 err
= bcm_phy_write_exp(phydev
, MII_BCM54XX_EXP_AADJ1CH3
,
148 MII_BCM54XX_EXP_AADJ1CH3_ADCCKADJ
);
152 err
= bcm_phy_write_exp(phydev
, MII_BCM54XX_EXP_EXP75
,
153 MII_BCM54XX_EXP_EXP75_VDACCTRL
);
157 err
= bcm_phy_write_exp(phydev
, MII_BCM54XX_EXP_EXP96
,
158 MII_BCM54XX_EXP_EXP96_MYST
);
162 err
= bcm_phy_write_exp(phydev
, MII_BCM54XX_EXP_EXP97
,
163 MII_BCM54XX_EXP_EXP97_MYST
);
168 static int bcm54xx_phydsp_config(struct phy_device
*phydev
)
172 /* Enable the SMDSP clock */
173 err
= bcm54xx_auxctl_write(phydev
,
174 MII_BCM54XX_AUXCTL_SHDWSEL_AUXCTL
,
175 MII_BCM54XX_AUXCTL_ACTL_SMDSP_ENA
|
176 MII_BCM54XX_AUXCTL_ACTL_TX_6DB
);
180 if (BRCM_PHY_MODEL(phydev
) == PHY_ID_BCM50610
||
181 BRCM_PHY_MODEL(phydev
) == PHY_ID_BCM50610M
) {
182 /* Clear bit 9 to fix a phy interop issue. */
183 err
= bcm_phy_write_exp(phydev
, MII_BCM54XX_EXP_EXP08
,
184 MII_BCM54XX_EXP_EXP08_RJCT_2MHZ
);
188 if (phydev
->drv
->phy_id
== PHY_ID_BCM50610
) {
189 err
= bcm50610_a0_workaround(phydev
);
195 if (BRCM_PHY_MODEL(phydev
) == PHY_ID_BCM57780
) {
198 val
= bcm_phy_read_exp(phydev
, MII_BCM54XX_EXP_EXP75
);
202 val
|= MII_BCM54XX_EXP_EXP75_CM_OSC
;
203 err
= bcm_phy_write_exp(phydev
, MII_BCM54XX_EXP_EXP75
, val
);
207 /* Disable the SMDSP clock */
208 err2
= bcm54xx_auxctl_write(phydev
,
209 MII_BCM54XX_AUXCTL_SHDWSEL_AUXCTL
,
210 MII_BCM54XX_AUXCTL_ACTL_TX_6DB
);
212 /* Return the first error reported. */
213 return err
? err
: err2
;
216 static void bcm54xx_adjust_rxrefclk(struct phy_device
*phydev
)
220 bool clk125en
= true;
222 /* Abort if we are using an untested phy. */
223 if (BRCM_PHY_MODEL(phydev
) != PHY_ID_BCM57780
&&
224 BRCM_PHY_MODEL(phydev
) != PHY_ID_BCM50610
&&
225 BRCM_PHY_MODEL(phydev
) != PHY_ID_BCM50610M
)
228 val
= bcm_phy_read_shadow(phydev
, BCM54XX_SHD_SCR3
);
234 if ((BRCM_PHY_MODEL(phydev
) == PHY_ID_BCM50610
||
235 BRCM_PHY_MODEL(phydev
) == PHY_ID_BCM50610M
) &&
236 BRCM_PHY_REV(phydev
) >= 0x3) {
238 * Here, bit 0 _disables_ CLK125 when set.
239 * This bit is set by default.
243 if (phydev
->dev_flags
& PHY_BRCM_RX_REFCLK_UNUSED
) {
244 /* Here, bit 0 _enables_ CLK125 when set */
245 val
&= ~BCM54XX_SHD_SCR3_DEF_CLK125
;
250 if (!clk125en
|| (phydev
->dev_flags
& PHY_BRCM_AUTO_PWRDWN_ENABLE
))
251 val
&= ~BCM54XX_SHD_SCR3_DLLAPD_DIS
;
253 val
|= BCM54XX_SHD_SCR3_DLLAPD_DIS
;
255 if (phydev
->dev_flags
& PHY_BRCM_DIS_TXCRXC_NOENRGY
)
256 val
|= BCM54XX_SHD_SCR3_TRDDAPD
;
259 bcm_phy_write_shadow(phydev
, BCM54XX_SHD_SCR3
, val
);
261 val
= bcm_phy_read_shadow(phydev
, BCM54XX_SHD_APD
);
267 if (!clk125en
|| (phydev
->dev_flags
& PHY_BRCM_AUTO_PWRDWN_ENABLE
))
268 val
|= BCM54XX_SHD_APD_EN
;
270 val
&= ~BCM54XX_SHD_APD_EN
;
273 bcm_phy_write_shadow(phydev
, BCM54XX_SHD_APD
, val
);
276 static int bcm54xx_config_init(struct phy_device
*phydev
)
280 reg
= phy_read(phydev
, MII_BCM54XX_ECR
);
284 /* Mask interrupts globally. */
285 reg
|= MII_BCM54XX_ECR_IM
;
286 err
= phy_write(phydev
, MII_BCM54XX_ECR
, reg
);
290 /* Unmask events we are interested in. */
291 reg
= ~(MII_BCM54XX_INT_DUPLEX
|
292 MII_BCM54XX_INT_SPEED
|
293 MII_BCM54XX_INT_LINK
);
294 err
= phy_write(phydev
, MII_BCM54XX_IMR
, reg
);
298 if ((BRCM_PHY_MODEL(phydev
) == PHY_ID_BCM50610
||
299 BRCM_PHY_MODEL(phydev
) == PHY_ID_BCM50610M
) &&
300 (phydev
->dev_flags
& PHY_BRCM_CLEAR_RGMII_MODE
))
301 bcm_phy_write_shadow(phydev
, BCM54XX_SHD_RGMII_MODE
, 0);
303 if ((phydev
->dev_flags
& PHY_BRCM_RX_REFCLK_UNUSED
) ||
304 (phydev
->dev_flags
& PHY_BRCM_DIS_TXCRXC_NOENRGY
) ||
305 (phydev
->dev_flags
& PHY_BRCM_AUTO_PWRDWN_ENABLE
))
306 bcm54xx_adjust_rxrefclk(phydev
);
308 if (BRCM_PHY_MODEL(phydev
) == PHY_ID_BCM54210E
) {
309 err
= bcm54210e_config_init(phydev
);
312 } else if (BRCM_PHY_MODEL(phydev
) == PHY_ID_BCM54612E
) {
313 err
= bcm54612e_config_init(phydev
);
316 } else if (BRCM_PHY_MODEL(phydev
) == PHY_ID_BCM54810
) {
317 /* For BCM54810, we need to disable BroadR-Reach function */
318 val
= bcm_phy_read_exp(phydev
,
319 BCM54810_EXP_BROADREACH_LRE_MISC_CTL
);
320 val
&= ~BCM54810_EXP_BROADREACH_LRE_MISC_CTL_EN
;
321 err
= bcm_phy_write_exp(phydev
,
322 BCM54810_EXP_BROADREACH_LRE_MISC_CTL
,
328 bcm54xx_phydsp_config(phydev
);
333 static int bcm5482_config_init(struct phy_device
*phydev
)
337 err
= bcm54xx_config_init(phydev
);
339 if (phydev
->dev_flags
& PHY_BCM_FLAGS_MODE_1000BX
) {
341 * Enable secondary SerDes and its use as an LED source
343 reg
= bcm_phy_read_shadow(phydev
, BCM5482_SHD_SSD
);
344 bcm_phy_write_shadow(phydev
, BCM5482_SHD_SSD
,
346 BCM5482_SHD_SSD_LEDM
|
350 * Enable SGMII slave mode and auto-detection
352 reg
= BCM5482_SSD_SGMII_SLAVE
| MII_BCM54XX_EXP_SEL_SSD
;
353 err
= bcm_phy_read_exp(phydev
, reg
);
356 err
= bcm_phy_write_exp(phydev
, reg
, err
|
357 BCM5482_SSD_SGMII_SLAVE_EN
|
358 BCM5482_SSD_SGMII_SLAVE_AD
);
363 * Disable secondary SerDes powerdown
365 reg
= BCM5482_SSD_1000BX_CTL
| MII_BCM54XX_EXP_SEL_SSD
;
366 err
= bcm_phy_read_exp(phydev
, reg
);
369 err
= bcm_phy_write_exp(phydev
, reg
,
370 err
& ~BCM5482_SSD_1000BX_CTL_PWRDOWN
);
375 * Select 1000BASE-X register set (primary SerDes)
377 reg
= bcm_phy_read_shadow(phydev
, BCM5482_SHD_MODE
);
378 bcm_phy_write_shadow(phydev
, BCM5482_SHD_MODE
,
379 reg
| BCM5482_SHD_MODE_1000BX
);
382 * LED1=ACTIVITYLED, LED3=LINKSPD[2]
383 * (Use LED1 as secondary SerDes ACTIVITY LED)
385 bcm_phy_write_shadow(phydev
, BCM5482_SHD_LEDS1
,
386 BCM5482_SHD_LEDS1_LED1(BCM_LED_SRC_ACTIVITYLED
) |
387 BCM5482_SHD_LEDS1_LED3(BCM_LED_SRC_LINKSPD2
));
390 * Auto-negotiation doesn't seem to work quite right
391 * in this mode, so we disable it and force it to the
392 * right speed/duplex setting. Only 'link status'
395 phydev
->autoneg
= AUTONEG_DISABLE
;
396 phydev
->speed
= SPEED_1000
;
397 phydev
->duplex
= DUPLEX_FULL
;
403 static int bcm5482_read_status(struct phy_device
*phydev
)
407 err
= genphy_read_status(phydev
);
409 if (phydev
->dev_flags
& PHY_BCM_FLAGS_MODE_1000BX
) {
411 * Only link status matters for 1000Base-X mode, so force
412 * 1000 Mbit/s full-duplex status
415 phydev
->speed
= SPEED_1000
;
416 phydev
->duplex
= DUPLEX_FULL
;
423 static int bcm5481_config_aneg(struct phy_device
*phydev
)
425 struct device_node
*np
= phydev
->mdio
.dev
.of_node
;
429 ret
= genphy_config_aneg(phydev
);
431 /* Then we can set up the delay. */
432 bcm5481x_config(phydev
);
434 if (of_property_read_bool(np
, "enet-phy-lane-swap")) {
435 /* Lane Swap - Undocumented register...magic! */
436 ret
= bcm_phy_write_exp(phydev
, MII_BCM54XX_EXP_SEL_ER
+ 0x9,
445 static int brcm_phy_setbits(struct phy_device
*phydev
, int reg
, int set
)
449 val
= phy_read(phydev
, reg
);
453 return phy_write(phydev
, reg
, val
| set
);
456 static int brcm_fet_config_init(struct phy_device
*phydev
)
458 int reg
, err
, err2
, brcmtest
;
460 /* Reset the PHY to bring it to a known state. */
461 err
= phy_write(phydev
, MII_BMCR
, BMCR_RESET
);
465 reg
= phy_read(phydev
, MII_BRCM_FET_INTREG
);
469 /* Unmask events we are interested in and mask interrupts globally. */
470 reg
= MII_BRCM_FET_IR_DUPLEX_EN
|
471 MII_BRCM_FET_IR_SPEED_EN
|
472 MII_BRCM_FET_IR_LINK_EN
|
473 MII_BRCM_FET_IR_ENABLE
|
474 MII_BRCM_FET_IR_MASK
;
476 err
= phy_write(phydev
, MII_BRCM_FET_INTREG
, reg
);
480 /* Enable shadow register access */
481 brcmtest
= phy_read(phydev
, MII_BRCM_FET_BRCMTEST
);
485 reg
= brcmtest
| MII_BRCM_FET_BT_SRE
;
487 err
= phy_write(phydev
, MII_BRCM_FET_BRCMTEST
, reg
);
491 /* Set the LED mode */
492 reg
= phy_read(phydev
, MII_BRCM_FET_SHDW_AUXMODE4
);
498 reg
&= ~MII_BRCM_FET_SHDW_AM4_LED_MASK
;
499 reg
|= MII_BRCM_FET_SHDW_AM4_LED_MODE1
;
501 err
= phy_write(phydev
, MII_BRCM_FET_SHDW_AUXMODE4
, reg
);
505 /* Enable auto MDIX */
506 err
= brcm_phy_setbits(phydev
, MII_BRCM_FET_SHDW_MISCCTRL
,
507 MII_BRCM_FET_SHDW_MC_FAME
);
511 if (phydev
->dev_flags
& PHY_BRCM_AUTO_PWRDWN_ENABLE
) {
512 /* Enable auto power down */
513 err
= brcm_phy_setbits(phydev
, MII_BRCM_FET_SHDW_AUXSTAT2
,
514 MII_BRCM_FET_SHDW_AS2_APDE
);
518 /* Disable shadow register access */
519 err2
= phy_write(phydev
, MII_BRCM_FET_BRCMTEST
, brcmtest
);
526 static int brcm_fet_ack_interrupt(struct phy_device
*phydev
)
530 /* Clear pending interrupts. */
531 reg
= phy_read(phydev
, MII_BRCM_FET_INTREG
);
538 static int brcm_fet_config_intr(struct phy_device
*phydev
)
542 reg
= phy_read(phydev
, MII_BRCM_FET_INTREG
);
546 if (phydev
->interrupts
== PHY_INTERRUPT_ENABLED
)
547 reg
&= ~MII_BRCM_FET_IR_MASK
;
549 reg
|= MII_BRCM_FET_IR_MASK
;
551 err
= phy_write(phydev
, MII_BRCM_FET_INTREG
, reg
);
555 struct bcm53xx_phy_priv
{
559 static int bcm53xx_phy_probe(struct phy_device
*phydev
)
561 struct bcm53xx_phy_priv
*priv
;
563 priv
= devm_kzalloc(&phydev
->mdio
.dev
, sizeof(*priv
), GFP_KERNEL
);
569 priv
->stats
= devm_kcalloc(&phydev
->mdio
.dev
,
570 bcm_phy_get_sset_count(phydev
), sizeof(u64
),
578 static void bcm53xx_phy_get_stats(struct phy_device
*phydev
,
579 struct ethtool_stats
*stats
, u64
*data
)
581 struct bcm53xx_phy_priv
*priv
= phydev
->priv
;
583 bcm_phy_get_stats(phydev
, priv
->stats
, stats
, data
);
586 static struct phy_driver broadcom_drivers
[] = {
588 .phy_id
= PHY_ID_BCM5411
,
589 .phy_id_mask
= 0xfffffff0,
590 .name
= "Broadcom BCM5411",
591 .features
= PHY_GBIT_FEATURES
,
592 .flags
= PHY_HAS_INTERRUPT
,
593 .config_init
= bcm54xx_config_init
,
594 .ack_interrupt
= bcm_phy_ack_intr
,
595 .config_intr
= bcm_phy_config_intr
,
597 .phy_id
= PHY_ID_BCM5421
,
598 .phy_id_mask
= 0xfffffff0,
599 .name
= "Broadcom BCM5421",
600 .features
= PHY_GBIT_FEATURES
,
601 .flags
= PHY_HAS_INTERRUPT
,
602 .config_init
= bcm54xx_config_init
,
603 .ack_interrupt
= bcm_phy_ack_intr
,
604 .config_intr
= bcm_phy_config_intr
,
606 .phy_id
= PHY_ID_BCM54210E
,
607 .phy_id_mask
= 0xfffffff0,
608 .name
= "Broadcom BCM54210E",
609 .features
= PHY_GBIT_FEATURES
,
610 .flags
= PHY_HAS_INTERRUPT
,
611 .config_init
= bcm54xx_config_init
,
612 .ack_interrupt
= bcm_phy_ack_intr
,
613 .config_intr
= bcm_phy_config_intr
,
615 .phy_id
= PHY_ID_BCM5461
,
616 .phy_id_mask
= 0xfffffff0,
617 .name
= "Broadcom BCM5461",
618 .features
= PHY_GBIT_FEATURES
,
619 .flags
= PHY_HAS_INTERRUPT
,
620 .config_init
= bcm54xx_config_init
,
621 .ack_interrupt
= bcm_phy_ack_intr
,
622 .config_intr
= bcm_phy_config_intr
,
624 .phy_id
= PHY_ID_BCM54612E
,
625 .phy_id_mask
= 0xfffffff0,
626 .name
= "Broadcom BCM54612E",
627 .features
= PHY_GBIT_FEATURES
,
628 .flags
= PHY_HAS_INTERRUPT
,
629 .config_init
= bcm54xx_config_init
,
630 .ack_interrupt
= bcm_phy_ack_intr
,
631 .config_intr
= bcm_phy_config_intr
,
633 .phy_id
= PHY_ID_BCM54616S
,
634 .phy_id_mask
= 0xfffffff0,
635 .name
= "Broadcom BCM54616S",
636 .features
= PHY_GBIT_FEATURES
,
637 .flags
= PHY_HAS_INTERRUPT
,
638 .config_init
= bcm54xx_config_init
,
639 .ack_interrupt
= bcm_phy_ack_intr
,
640 .config_intr
= bcm_phy_config_intr
,
642 .phy_id
= PHY_ID_BCM5464
,
643 .phy_id_mask
= 0xfffffff0,
644 .name
= "Broadcom BCM5464",
645 .features
= PHY_GBIT_FEATURES
,
646 .flags
= PHY_HAS_INTERRUPT
,
647 .config_init
= bcm54xx_config_init
,
648 .ack_interrupt
= bcm_phy_ack_intr
,
649 .config_intr
= bcm_phy_config_intr
,
651 .phy_id
= PHY_ID_BCM5481
,
652 .phy_id_mask
= 0xfffffff0,
653 .name
= "Broadcom BCM5481",
654 .features
= PHY_GBIT_FEATURES
,
655 .flags
= PHY_HAS_INTERRUPT
,
656 .config_init
= bcm54xx_config_init
,
657 .config_aneg
= bcm5481_config_aneg
,
658 .ack_interrupt
= bcm_phy_ack_intr
,
659 .config_intr
= bcm_phy_config_intr
,
661 .phy_id
= PHY_ID_BCM54810
,
662 .phy_id_mask
= 0xfffffff0,
663 .name
= "Broadcom BCM54810",
664 .features
= PHY_GBIT_FEATURES
,
665 .flags
= PHY_HAS_INTERRUPT
,
666 .config_init
= bcm54xx_config_init
,
667 .config_aneg
= bcm5481_config_aneg
,
668 .ack_interrupt
= bcm_phy_ack_intr
,
669 .config_intr
= bcm_phy_config_intr
,
671 .phy_id
= PHY_ID_BCM5482
,
672 .phy_id_mask
= 0xfffffff0,
673 .name
= "Broadcom BCM5482",
674 .features
= PHY_GBIT_FEATURES
,
675 .flags
= PHY_HAS_INTERRUPT
,
676 .config_init
= bcm5482_config_init
,
677 .read_status
= bcm5482_read_status
,
678 .ack_interrupt
= bcm_phy_ack_intr
,
679 .config_intr
= bcm_phy_config_intr
,
681 .phy_id
= PHY_ID_BCM50610
,
682 .phy_id_mask
= 0xfffffff0,
683 .name
= "Broadcom BCM50610",
684 .features
= PHY_GBIT_FEATURES
,
685 .flags
= PHY_HAS_INTERRUPT
,
686 .config_init
= bcm54xx_config_init
,
687 .ack_interrupt
= bcm_phy_ack_intr
,
688 .config_intr
= bcm_phy_config_intr
,
690 .phy_id
= PHY_ID_BCM50610M
,
691 .phy_id_mask
= 0xfffffff0,
692 .name
= "Broadcom BCM50610M",
693 .features
= PHY_GBIT_FEATURES
,
694 .flags
= PHY_HAS_INTERRUPT
,
695 .config_init
= bcm54xx_config_init
,
696 .ack_interrupt
= bcm_phy_ack_intr
,
697 .config_intr
= bcm_phy_config_intr
,
699 .phy_id
= PHY_ID_BCM57780
,
700 .phy_id_mask
= 0xfffffff0,
701 .name
= "Broadcom BCM57780",
702 .features
= PHY_GBIT_FEATURES
,
703 .flags
= PHY_HAS_INTERRUPT
,
704 .config_init
= bcm54xx_config_init
,
705 .ack_interrupt
= bcm_phy_ack_intr
,
706 .config_intr
= bcm_phy_config_intr
,
708 .phy_id
= PHY_ID_BCMAC131
,
709 .phy_id_mask
= 0xfffffff0,
710 .name
= "Broadcom BCMAC131",
711 .features
= PHY_BASIC_FEATURES
,
712 .flags
= PHY_HAS_INTERRUPT
,
713 .config_init
= brcm_fet_config_init
,
714 .ack_interrupt
= brcm_fet_ack_interrupt
,
715 .config_intr
= brcm_fet_config_intr
,
717 .phy_id
= PHY_ID_BCM5241
,
718 .phy_id_mask
= 0xfffffff0,
719 .name
= "Broadcom BCM5241",
720 .features
= PHY_BASIC_FEATURES
,
721 .flags
= PHY_HAS_INTERRUPT
,
722 .config_init
= brcm_fet_config_init
,
723 .ack_interrupt
= brcm_fet_ack_interrupt
,
724 .config_intr
= brcm_fet_config_intr
,
726 .phy_id
= PHY_ID_BCM5395
,
727 .phy_id_mask
= 0xfffffff0,
728 .name
= "Broadcom BCM5395",
729 .flags
= PHY_IS_INTERNAL
,
730 .features
= PHY_GBIT_FEATURES
,
731 .get_sset_count
= bcm_phy_get_sset_count
,
732 .get_strings
= bcm_phy_get_strings
,
733 .get_stats
= bcm53xx_phy_get_stats
,
734 .probe
= bcm53xx_phy_probe
,
736 .phy_id
= PHY_ID_BCM89610
,
737 .phy_id_mask
= 0xfffffff0,
738 .name
= "Broadcom BCM89610",
739 .features
= PHY_GBIT_FEATURES
,
740 .flags
= PHY_HAS_INTERRUPT
,
741 .config_init
= bcm54xx_config_init
,
742 .ack_interrupt
= bcm_phy_ack_intr
,
743 .config_intr
= bcm_phy_config_intr
,
746 module_phy_driver(broadcom_drivers
);
748 static struct mdio_device_id __maybe_unused broadcom_tbl
[] = {
749 { PHY_ID_BCM5411
, 0xfffffff0 },
750 { PHY_ID_BCM5421
, 0xfffffff0 },
751 { PHY_ID_BCM54210E
, 0xfffffff0 },
752 { PHY_ID_BCM5461
, 0xfffffff0 },
753 { PHY_ID_BCM54612E
, 0xfffffff0 },
754 { PHY_ID_BCM54616S
, 0xfffffff0 },
755 { PHY_ID_BCM5464
, 0xfffffff0 },
756 { PHY_ID_BCM5481
, 0xfffffff0 },
757 { PHY_ID_BCM54810
, 0xfffffff0 },
758 { PHY_ID_BCM5482
, 0xfffffff0 },
759 { PHY_ID_BCM50610
, 0xfffffff0 },
760 { PHY_ID_BCM50610M
, 0xfffffff0 },
761 { PHY_ID_BCM57780
, 0xfffffff0 },
762 { PHY_ID_BCMAC131
, 0xfffffff0 },
763 { PHY_ID_BCM5241
, 0xfffffff0 },
764 { PHY_ID_BCM5395
, 0xfffffff0 },
765 { PHY_ID_BCM89610
, 0xfffffff0 },
769 MODULE_DEVICE_TABLE(mdio
, broadcom_tbl
);