1 // SPDX-License-Identifier: GPL-2.0+
3 * drivers/net/phy/broadcom.c
5 * Broadcom BCM5411, BCM5421 and BCM5461 Gigabit Ethernet
8 * Copyright (c) 2006 Maciej W. Rozycki
10 * Inspired by code written by Amy Fong.
13 #include "bcm-phy-lib.h"
14 #include <linux/module.h>
15 #include <linux/phy.h>
16 #include <linux/brcmphy.h>
19 #define BRCM_PHY_MODEL(phydev) \
20 ((phydev)->drv->phy_id & (phydev)->drv->phy_id_mask)
22 #define BRCM_PHY_REV(phydev) \
23 ((phydev)->drv->phy_id & ~((phydev)->drv->phy_id_mask))
25 MODULE_DESCRIPTION("Broadcom PHY driver");
26 MODULE_AUTHOR("Maciej W. Rozycki");
27 MODULE_LICENSE("GPL");
29 static int bcm54xx_config_clock_delay(struct phy_device *phydev);
31 static int bcm54210e_config_init(struct phy_device *phydev)
35 bcm54xx_config_clock_delay(phydev);
37 if (phydev->dev_flags & PHY_BRCM_EN_MASTER_MODE) {
38 val = phy_read(phydev, MII_CTRL1000);
39 val |= CTL1000_AS_MASTER | CTL1000_ENABLE_MASTER;
40 phy_write(phydev, MII_CTRL1000, val);
46 static int bcm54612e_config_init(struct phy_device *phydev)
50 bcm54xx_config_clock_delay(phydev);
52 /* Enable CLK125 MUX on LED4 if ref clock is enabled. */
53 if (!(phydev->dev_flags & PHY_BRCM_RX_REFCLK_UNUSED)) {
56 reg = bcm_phy_read_exp(phydev, BCM54612E_EXP_SPARE0);
57 err = bcm_phy_write_exp(phydev, BCM54612E_EXP_SPARE0,
58 BCM54612E_LED4_CLK125OUT_EN | reg);
67 static int bcm54xx_config_clock_delay(struct phy_device *phydev)
71 /* handling PHY's internal RX clock delay */
72 val = bcm54xx_auxctl_read(phydev, MII_BCM54XX_AUXCTL_SHDWSEL_MISC);
73 val |= MII_BCM54XX_AUXCTL_MISC_WREN;
74 if (phydev->interface == PHY_INTERFACE_MODE_RGMII ||
75 phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID) {
76 /* Disable RGMII RXC-RXD skew */
77 val &= ~MII_BCM54XX_AUXCTL_SHDWSEL_MISC_RGMII_SKEW_EN;
79 if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID ||
80 phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID) {
81 /* Enable RGMII RXC-RXD skew */
82 val |= MII_BCM54XX_AUXCTL_SHDWSEL_MISC_RGMII_SKEW_EN;
84 rc = bcm54xx_auxctl_write(phydev, MII_BCM54XX_AUXCTL_SHDWSEL_MISC,
89 /* handling PHY's internal TX clock delay */
90 val = bcm_phy_read_shadow(phydev, BCM54810_SHD_CLK_CTL);
91 if (phydev->interface == PHY_INTERFACE_MODE_RGMII ||
92 phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID) {
93 /* Disable internal TX clock delay */
94 val &= ~BCM54810_SHD_CLK_CTL_GTXCLK_EN;
96 if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID ||
97 phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID) {
98 /* Enable internal TX clock delay */
99 val |= BCM54810_SHD_CLK_CTL_GTXCLK_EN;
101 rc = bcm_phy_write_shadow(phydev, BCM54810_SHD_CLK_CTL, val);
108 /* Needs SMDSP clock enabled via bcm54xx_phydsp_config() */
109 static int bcm50610_a0_workaround(struct phy_device *phydev)
113 err = bcm_phy_write_exp(phydev, MII_BCM54XX_EXP_AADJ1CH0,
114 MII_BCM54XX_EXP_AADJ1CH0_SWP_ABCD_OEN |
115 MII_BCM54XX_EXP_AADJ1CH0_SWSEL_THPF);
119 err = bcm_phy_write_exp(phydev, MII_BCM54XX_EXP_AADJ1CH3,
120 MII_BCM54XX_EXP_AADJ1CH3_ADCCKADJ);
124 err = bcm_phy_write_exp(phydev, MII_BCM54XX_EXP_EXP75,
125 MII_BCM54XX_EXP_EXP75_VDACCTRL);
129 err = bcm_phy_write_exp(phydev, MII_BCM54XX_EXP_EXP96,
130 MII_BCM54XX_EXP_EXP96_MYST);
134 err = bcm_phy_write_exp(phydev, MII_BCM54XX_EXP_EXP97,
135 MII_BCM54XX_EXP_EXP97_MYST);
140 static int bcm54xx_phydsp_config(struct phy_device *phydev)
144 /* Enable the SMDSP clock */
145 err = bcm54xx_auxctl_write(phydev,
146 MII_BCM54XX_AUXCTL_SHDWSEL_AUXCTL,
147 MII_BCM54XX_AUXCTL_ACTL_SMDSP_ENA |
148 MII_BCM54XX_AUXCTL_ACTL_TX_6DB);
152 if (BRCM_PHY_MODEL(phydev) == PHY_ID_BCM50610 ||
153 BRCM_PHY_MODEL(phydev) == PHY_ID_BCM50610M) {
154 /* Clear bit 9 to fix a phy interop issue. */
155 err = bcm_phy_write_exp(phydev, MII_BCM54XX_EXP_EXP08,
156 MII_BCM54XX_EXP_EXP08_RJCT_2MHZ);
160 if (phydev->drv->phy_id == PHY_ID_BCM50610) {
161 err = bcm50610_a0_workaround(phydev);
167 if (BRCM_PHY_MODEL(phydev) == PHY_ID_BCM57780) {
170 val = bcm_phy_read_exp(phydev, MII_BCM54XX_EXP_EXP75);
174 val |= MII_BCM54XX_EXP_EXP75_CM_OSC;
175 err = bcm_phy_write_exp(phydev, MII_BCM54XX_EXP_EXP75, val);
179 /* Disable the SMDSP clock */
180 err2 = bcm54xx_auxctl_write(phydev,
181 MII_BCM54XX_AUXCTL_SHDWSEL_AUXCTL,
182 MII_BCM54XX_AUXCTL_ACTL_TX_6DB);
184 /* Return the first error reported. */
185 return err ? err : err2;
188 static void bcm54xx_adjust_rxrefclk(struct phy_device *phydev)
192 bool clk125en = true;
194 /* Abort if we are using an untested phy. */
195 if (BRCM_PHY_MODEL(phydev) != PHY_ID_BCM57780 &&
196 BRCM_PHY_MODEL(phydev) != PHY_ID_BCM50610 &&
197 BRCM_PHY_MODEL(phydev) != PHY_ID_BCM50610M &&
198 BRCM_PHY_MODEL(phydev) != PHY_ID_BCM54810 &&
199 BRCM_PHY_MODEL(phydev) != PHY_ID_BCM54811)
202 val = bcm_phy_read_shadow(phydev, BCM54XX_SHD_SCR3);
208 if ((BRCM_PHY_MODEL(phydev) == PHY_ID_BCM50610 ||
209 BRCM_PHY_MODEL(phydev) == PHY_ID_BCM50610M) &&
210 BRCM_PHY_REV(phydev) >= 0x3) {
212 * Here, bit 0 _disables_ CLK125 when set.
213 * This bit is set by default.
217 if (phydev->dev_flags & PHY_BRCM_RX_REFCLK_UNUSED) {
218 if (BRCM_PHY_MODEL(phydev) != PHY_ID_BCM54811) {
219 /* Here, bit 0 _enables_ CLK125 when set */
220 val &= ~BCM54XX_SHD_SCR3_DEF_CLK125;
226 if (!clk125en || (phydev->dev_flags & PHY_BRCM_AUTO_PWRDWN_ENABLE))
227 val &= ~BCM54XX_SHD_SCR3_DLLAPD_DIS;
229 val |= BCM54XX_SHD_SCR3_DLLAPD_DIS;
231 if (phydev->dev_flags & PHY_BRCM_DIS_TXCRXC_NOENRGY) {
232 if (BRCM_PHY_MODEL(phydev) == PHY_ID_BCM54810 ||
233 BRCM_PHY_MODEL(phydev) == PHY_ID_BCM54811)
234 val |= BCM54810_SHD_SCR3_TRDDAPD;
236 val |= BCM54XX_SHD_SCR3_TRDDAPD;
240 bcm_phy_write_shadow(phydev, BCM54XX_SHD_SCR3, val);
242 val = bcm_phy_read_shadow(phydev, BCM54XX_SHD_APD);
248 if (!clk125en || (phydev->dev_flags & PHY_BRCM_AUTO_PWRDWN_ENABLE))
249 val |= BCM54XX_SHD_APD_EN;
251 val &= ~BCM54XX_SHD_APD_EN;
254 bcm_phy_write_shadow(phydev, BCM54XX_SHD_APD, val);
257 static int bcm54xx_config_init(struct phy_device *phydev)
261 reg = phy_read(phydev, MII_BCM54XX_ECR);
265 /* Mask interrupts globally. */
266 reg |= MII_BCM54XX_ECR_IM;
267 err = phy_write(phydev, MII_BCM54XX_ECR, reg);
271 /* Unmask events we are interested in. */
272 reg = ~(MII_BCM54XX_INT_DUPLEX |
273 MII_BCM54XX_INT_SPEED |
274 MII_BCM54XX_INT_LINK);
275 err = phy_write(phydev, MII_BCM54XX_IMR, reg);
279 if ((BRCM_PHY_MODEL(phydev) == PHY_ID_BCM50610 ||
280 BRCM_PHY_MODEL(phydev) == PHY_ID_BCM50610M) &&
281 (phydev->dev_flags & PHY_BRCM_CLEAR_RGMII_MODE))
282 bcm_phy_write_shadow(phydev, BCM54XX_SHD_RGMII_MODE, 0);
284 bcm54xx_adjust_rxrefclk(phydev);
286 if (BRCM_PHY_MODEL(phydev) == PHY_ID_BCM54210E) {
287 err = bcm54210e_config_init(phydev);
290 } else if (BRCM_PHY_MODEL(phydev) == PHY_ID_BCM54612E) {
291 err = bcm54612e_config_init(phydev);
294 } else if (BRCM_PHY_MODEL(phydev) == PHY_ID_BCM54810) {
295 /* For BCM54810, we need to disable BroadR-Reach function */
296 val = bcm_phy_read_exp(phydev,
297 BCM54810_EXP_BROADREACH_LRE_MISC_CTL);
298 val &= ~BCM54810_EXP_BROADREACH_LRE_MISC_CTL_EN;
299 err = bcm_phy_write_exp(phydev,
300 BCM54810_EXP_BROADREACH_LRE_MISC_CTL,
306 bcm54xx_phydsp_config(phydev);
308 /* Encode link speed into LED1 and LED3 pair (green/amber).
309 * Also flash these two LEDs on activity. This means configuring
310 * them for MULTICOLOR and encoding link/activity into them.
312 val = BCM5482_SHD_LEDS1_LED1(BCM_LED_SRC_MULTICOLOR1) |
313 BCM5482_SHD_LEDS1_LED3(BCM_LED_SRC_MULTICOLOR1);
314 bcm_phy_write_shadow(phydev, BCM5482_SHD_LEDS1, val);
316 val = BCM_LED_MULTICOLOR_IN_PHASE |
317 BCM5482_SHD_LEDS1_LED1(BCM_LED_MULTICOLOR_LINK_ACT) |
318 BCM5482_SHD_LEDS1_LED3(BCM_LED_MULTICOLOR_LINK_ACT);
319 bcm_phy_write_exp(phydev, BCM_EXP_MULTICOLOR, val);
324 static int bcm54xx_resume(struct phy_device *phydev)
328 /* Writes to register other than BMCR would be ignored
329 * unless we clear the PDOWN bit first
331 ret = genphy_resume(phydev);
335 return bcm54xx_config_init(phydev);
338 static int bcm54811_config_init(struct phy_device *phydev)
342 /* Disable BroadR-Reach function. */
343 reg = bcm_phy_read_exp(phydev, BCM54810_EXP_BROADREACH_LRE_MISC_CTL);
344 reg &= ~BCM54810_EXP_BROADREACH_LRE_MISC_CTL_EN;
345 err = bcm_phy_write_exp(phydev, BCM54810_EXP_BROADREACH_LRE_MISC_CTL,
350 err = bcm54xx_config_init(phydev);
352 /* Enable CLK125 MUX on LED4 if ref clock is enabled. */
353 if (!(phydev->dev_flags & PHY_BRCM_RX_REFCLK_UNUSED)) {
354 reg = bcm_phy_read_exp(phydev, BCM54612E_EXP_SPARE0);
355 err = bcm_phy_write_exp(phydev, BCM54612E_EXP_SPARE0,
356 BCM54612E_LED4_CLK125OUT_EN | reg);
364 static int bcm5482_config_init(struct phy_device *phydev)
368 err = bcm54xx_config_init(phydev);
370 if (phydev->dev_flags & PHY_BCM_FLAGS_MODE_1000BX) {
372 * Enable secondary SerDes and its use as an LED source
374 reg = bcm_phy_read_shadow(phydev, BCM5482_SHD_SSD);
375 bcm_phy_write_shadow(phydev, BCM5482_SHD_SSD,
377 BCM5482_SHD_SSD_LEDM |
381 * Enable SGMII slave mode and auto-detection
383 reg = BCM5482_SSD_SGMII_SLAVE | MII_BCM54XX_EXP_SEL_SSD;
384 err = bcm_phy_read_exp(phydev, reg);
387 err = bcm_phy_write_exp(phydev, reg, err |
388 BCM5482_SSD_SGMII_SLAVE_EN |
389 BCM5482_SSD_SGMII_SLAVE_AD);
394 * Disable secondary SerDes powerdown
396 reg = BCM5482_SSD_1000BX_CTL | MII_BCM54XX_EXP_SEL_SSD;
397 err = bcm_phy_read_exp(phydev, reg);
400 err = bcm_phy_write_exp(phydev, reg,
401 err & ~BCM5482_SSD_1000BX_CTL_PWRDOWN);
406 * Select 1000BASE-X register set (primary SerDes)
408 reg = bcm_phy_read_shadow(phydev, BCM54XX_SHD_MODE);
409 bcm_phy_write_shadow(phydev, BCM54XX_SHD_MODE,
410 reg | BCM54XX_SHD_MODE_1000BX);
413 * LED1=ACTIVITYLED, LED3=LINKSPD[2]
414 * (Use LED1 as secondary SerDes ACTIVITY LED)
416 bcm_phy_write_shadow(phydev, BCM5482_SHD_LEDS1,
417 BCM5482_SHD_LEDS1_LED1(BCM_LED_SRC_ACTIVITYLED) |
418 BCM5482_SHD_LEDS1_LED3(BCM_LED_SRC_LINKSPD2));
421 * Auto-negotiation doesn't seem to work quite right
422 * in this mode, so we disable it and force it to the
423 * right speed/duplex setting. Only 'link status'
426 phydev->autoneg = AUTONEG_DISABLE;
427 phydev->speed = SPEED_1000;
428 phydev->duplex = DUPLEX_FULL;
434 static int bcm5482_read_status(struct phy_device *phydev)
438 err = genphy_read_status(phydev);
440 if (phydev->dev_flags & PHY_BCM_FLAGS_MODE_1000BX) {
442 * Only link status matters for 1000Base-X mode, so force
443 * 1000 Mbit/s full-duplex status
446 phydev->speed = SPEED_1000;
447 phydev->duplex = DUPLEX_FULL;
454 static int bcm5481_config_aneg(struct phy_device *phydev)
456 struct device_node *np = phydev->mdio.dev.of_node;
460 ret = genphy_config_aneg(phydev);
462 /* Then we can set up the delay. */
463 bcm54xx_config_clock_delay(phydev);
465 if (of_property_read_bool(np, "enet-phy-lane-swap")) {
466 /* Lane Swap - Undocumented register...magic! */
467 ret = bcm_phy_write_exp(phydev, MII_BCM54XX_EXP_SEL_ER + 0x9,
476 static int bcm54616s_probe(struct phy_device *phydev)
480 val = bcm_phy_read_shadow(phydev, BCM54XX_SHD_MODE);
484 /* The PHY is strapped in RGMII-fiber mode when INTERF_SEL[1:0]
485 * is 01b, and the link between PHY and its link partner can be
486 * either 1000Base-X or 100Base-FX.
487 * RGMII-1000Base-X is properly supported, but RGMII-100Base-FX
488 * support is still missing as of now.
490 intf_sel = (val & BCM54XX_SHD_INTF_SEL_MASK) >> 1;
492 val = bcm_phy_read_shadow(phydev, BCM54616S_SHD_100FX_CTRL);
496 /* Bit 0 of the SerDes 100-FX Control register, when set
497 * to 1, sets the MII/RGMII -> 100BASE-FX configuration.
498 * When this bit is set to 0, it sets the GMII/RGMII ->
499 * 1000BASE-X configuration.
501 if (!(val & BCM54616S_100FX_MODE))
502 phydev->dev_flags |= PHY_BCM_FLAGS_MODE_1000BX;
508 static int bcm54616s_config_aneg(struct phy_device *phydev)
513 if (phydev->dev_flags & PHY_BCM_FLAGS_MODE_1000BX)
514 ret = genphy_c37_config_aneg(phydev);
516 ret = genphy_config_aneg(phydev);
518 /* Then we can set up the delay. */
519 bcm54xx_config_clock_delay(phydev);
524 static int bcm54616s_read_status(struct phy_device *phydev)
528 if (phydev->dev_flags & PHY_BCM_FLAGS_MODE_1000BX)
529 err = genphy_c37_read_status(phydev);
531 err = genphy_read_status(phydev);
536 static int brcm_phy_setbits(struct phy_device *phydev, int reg, int set)
540 val = phy_read(phydev, reg);
544 return phy_write(phydev, reg, val | set);
547 static int brcm_fet_config_init(struct phy_device *phydev)
549 int reg, err, err2, brcmtest;
551 /* Reset the PHY to bring it to a known state. */
552 err = phy_write(phydev, MII_BMCR, BMCR_RESET);
556 reg = phy_read(phydev, MII_BRCM_FET_INTREG);
560 /* Unmask events we are interested in and mask interrupts globally. */
561 reg = MII_BRCM_FET_IR_DUPLEX_EN |
562 MII_BRCM_FET_IR_SPEED_EN |
563 MII_BRCM_FET_IR_LINK_EN |
564 MII_BRCM_FET_IR_ENABLE |
565 MII_BRCM_FET_IR_MASK;
567 err = phy_write(phydev, MII_BRCM_FET_INTREG, reg);
571 /* Enable shadow register access */
572 brcmtest = phy_read(phydev, MII_BRCM_FET_BRCMTEST);
576 reg = brcmtest | MII_BRCM_FET_BT_SRE;
578 err = phy_write(phydev, MII_BRCM_FET_BRCMTEST, reg);
582 /* Set the LED mode */
583 reg = phy_read(phydev, MII_BRCM_FET_SHDW_AUXMODE4);
589 reg &= ~MII_BRCM_FET_SHDW_AM4_LED_MASK;
590 reg |= MII_BRCM_FET_SHDW_AM4_LED_MODE1;
592 err = phy_write(phydev, MII_BRCM_FET_SHDW_AUXMODE4, reg);
596 /* Enable auto MDIX */
597 err = brcm_phy_setbits(phydev, MII_BRCM_FET_SHDW_MISCCTRL,
598 MII_BRCM_FET_SHDW_MC_FAME);
602 if (phydev->dev_flags & PHY_BRCM_AUTO_PWRDWN_ENABLE) {
603 /* Enable auto power down */
604 err = brcm_phy_setbits(phydev, MII_BRCM_FET_SHDW_AUXSTAT2,
605 MII_BRCM_FET_SHDW_AS2_APDE);
609 /* Disable shadow register access */
610 err2 = phy_write(phydev, MII_BRCM_FET_BRCMTEST, brcmtest);
617 static int brcm_fet_ack_interrupt(struct phy_device *phydev)
621 /* Clear pending interrupts. */
622 reg = phy_read(phydev, MII_BRCM_FET_INTREG);
629 static int brcm_fet_config_intr(struct phy_device *phydev)
633 reg = phy_read(phydev, MII_BRCM_FET_INTREG);
637 if (phydev->interrupts == PHY_INTERRUPT_ENABLED)
638 reg &= ~MII_BRCM_FET_IR_MASK;
640 reg |= MII_BRCM_FET_IR_MASK;
642 err = phy_write(phydev, MII_BRCM_FET_INTREG, reg);
646 struct bcm53xx_phy_priv {
650 static int bcm53xx_phy_probe(struct phy_device *phydev)
652 struct bcm53xx_phy_priv *priv;
654 priv = devm_kzalloc(&phydev->mdio.dev, sizeof(*priv), GFP_KERNEL);
660 priv->stats = devm_kcalloc(&phydev->mdio.dev,
661 bcm_phy_get_sset_count(phydev), sizeof(u64),
669 static void bcm53xx_phy_get_stats(struct phy_device *phydev,
670 struct ethtool_stats *stats, u64 *data)
672 struct bcm53xx_phy_priv *priv = phydev->priv;
674 bcm_phy_get_stats(phydev, priv->stats, stats, data);
677 static struct phy_driver broadcom_drivers[] = {
679 .phy_id = PHY_ID_BCM5411,
680 .phy_id_mask = 0xfffffff0,
681 .name = "Broadcom BCM5411",
682 /* PHY_GBIT_FEATURES */
683 .config_init = bcm54xx_config_init,
684 .ack_interrupt = bcm_phy_ack_intr,
685 .config_intr = bcm_phy_config_intr,
687 .phy_id = PHY_ID_BCM5421,
688 .phy_id_mask = 0xfffffff0,
689 .name = "Broadcom BCM5421",
690 /* PHY_GBIT_FEATURES */
691 .config_init = bcm54xx_config_init,
692 .ack_interrupt = bcm_phy_ack_intr,
693 .config_intr = bcm_phy_config_intr,
695 .phy_id = PHY_ID_BCM54210E,
696 .phy_id_mask = 0xfffffff0,
697 .name = "Broadcom BCM54210E",
698 /* PHY_GBIT_FEATURES */
699 .config_init = bcm54xx_config_init,
700 .ack_interrupt = bcm_phy_ack_intr,
701 .config_intr = bcm_phy_config_intr,
703 .phy_id = PHY_ID_BCM5461,
704 .phy_id_mask = 0xfffffff0,
705 .name = "Broadcom BCM5461",
706 /* PHY_GBIT_FEATURES */
707 .config_init = bcm54xx_config_init,
708 .ack_interrupt = bcm_phy_ack_intr,
709 .config_intr = bcm_phy_config_intr,
711 .phy_id = PHY_ID_BCM54612E,
712 .phy_id_mask = 0xfffffff0,
713 .name = "Broadcom BCM54612E",
714 /* PHY_GBIT_FEATURES */
715 .config_init = bcm54xx_config_init,
716 .ack_interrupt = bcm_phy_ack_intr,
717 .config_intr = bcm_phy_config_intr,
719 .phy_id = PHY_ID_BCM54616S,
720 .phy_id_mask = 0xfffffff0,
721 .name = "Broadcom BCM54616S",
722 /* PHY_GBIT_FEATURES */
723 .config_init = bcm54xx_config_init,
724 .config_aneg = bcm54616s_config_aneg,
725 .ack_interrupt = bcm_phy_ack_intr,
726 .config_intr = bcm_phy_config_intr,
727 .read_status = bcm54616s_read_status,
728 .probe = bcm54616s_probe,
730 .phy_id = PHY_ID_BCM5464,
731 .phy_id_mask = 0xfffffff0,
732 .name = "Broadcom BCM5464",
733 /* PHY_GBIT_FEATURES */
734 .config_init = bcm54xx_config_init,
735 .ack_interrupt = bcm_phy_ack_intr,
736 .config_intr = bcm_phy_config_intr,
737 .suspend = genphy_suspend,
738 .resume = genphy_resume,
740 .phy_id = PHY_ID_BCM5481,
741 .phy_id_mask = 0xfffffff0,
742 .name = "Broadcom BCM5481",
743 /* PHY_GBIT_FEATURES */
744 .config_init = bcm54xx_config_init,
745 .config_aneg = bcm5481_config_aneg,
746 .ack_interrupt = bcm_phy_ack_intr,
747 .config_intr = bcm_phy_config_intr,
749 .phy_id = PHY_ID_BCM54810,
750 .phy_id_mask = 0xfffffff0,
751 .name = "Broadcom BCM54810",
752 /* PHY_GBIT_FEATURES */
753 .config_init = bcm54xx_config_init,
754 .config_aneg = bcm5481_config_aneg,
755 .ack_interrupt = bcm_phy_ack_intr,
756 .config_intr = bcm_phy_config_intr,
757 .suspend = genphy_suspend,
758 .resume = bcm54xx_resume,
760 .phy_id = PHY_ID_BCM54811,
761 .phy_id_mask = 0xfffffff0,
762 .name = "Broadcom BCM54811",
763 /* PHY_GBIT_FEATURES */
764 .config_init = bcm54811_config_init,
765 .config_aneg = bcm5481_config_aneg,
766 .ack_interrupt = bcm_phy_ack_intr,
767 .config_intr = bcm_phy_config_intr,
768 .suspend = genphy_suspend,
769 .resume = bcm54xx_resume,
771 .phy_id = PHY_ID_BCM5482,
772 .phy_id_mask = 0xfffffff0,
773 .name = "Broadcom BCM5482",
774 /* PHY_GBIT_FEATURES */
775 .config_init = bcm5482_config_init,
776 .read_status = bcm5482_read_status,
777 .ack_interrupt = bcm_phy_ack_intr,
778 .config_intr = bcm_phy_config_intr,
780 .phy_id = PHY_ID_BCM50610,
781 .phy_id_mask = 0xfffffff0,
782 .name = "Broadcom BCM50610",
783 /* PHY_GBIT_FEATURES */
784 .config_init = bcm54xx_config_init,
785 .ack_interrupt = bcm_phy_ack_intr,
786 .config_intr = bcm_phy_config_intr,
788 .phy_id = PHY_ID_BCM50610M,
789 .phy_id_mask = 0xfffffff0,
790 .name = "Broadcom BCM50610M",
791 /* PHY_GBIT_FEATURES */
792 .config_init = bcm54xx_config_init,
793 .ack_interrupt = bcm_phy_ack_intr,
794 .config_intr = bcm_phy_config_intr,
796 .phy_id = PHY_ID_BCM57780,
797 .phy_id_mask = 0xfffffff0,
798 .name = "Broadcom BCM57780",
799 /* PHY_GBIT_FEATURES */
800 .config_init = bcm54xx_config_init,
801 .ack_interrupt = bcm_phy_ack_intr,
802 .config_intr = bcm_phy_config_intr,
804 .phy_id = PHY_ID_BCMAC131,
805 .phy_id_mask = 0xfffffff0,
806 .name = "Broadcom BCMAC131",
807 /* PHY_BASIC_FEATURES */
808 .config_init = brcm_fet_config_init,
809 .ack_interrupt = brcm_fet_ack_interrupt,
810 .config_intr = brcm_fet_config_intr,
812 .phy_id = PHY_ID_BCM5241,
813 .phy_id_mask = 0xfffffff0,
814 .name = "Broadcom BCM5241",
815 /* PHY_BASIC_FEATURES */
816 .config_init = brcm_fet_config_init,
817 .ack_interrupt = brcm_fet_ack_interrupt,
818 .config_intr = brcm_fet_config_intr,
820 .phy_id = PHY_ID_BCM5395,
821 .phy_id_mask = 0xfffffff0,
822 .name = "Broadcom BCM5395",
823 .flags = PHY_IS_INTERNAL,
824 /* PHY_GBIT_FEATURES */
825 .get_sset_count = bcm_phy_get_sset_count,
826 .get_strings = bcm_phy_get_strings,
827 .get_stats = bcm53xx_phy_get_stats,
828 .probe = bcm53xx_phy_probe,
830 .phy_id = PHY_ID_BCM53125,
831 .phy_id_mask = 0xfffffff0,
832 .name = "Broadcom BCM53125",
833 .flags = PHY_IS_INTERNAL,
834 /* PHY_GBIT_FEATURES */
835 .get_sset_count = bcm_phy_get_sset_count,
836 .get_strings = bcm_phy_get_strings,
837 .get_stats = bcm53xx_phy_get_stats,
838 .probe = bcm53xx_phy_probe,
839 .config_init = bcm54xx_config_init,
840 .ack_interrupt = bcm_phy_ack_intr,
841 .config_intr = bcm_phy_config_intr,
843 .phy_id = PHY_ID_BCM89610,
844 .phy_id_mask = 0xfffffff0,
845 .name = "Broadcom BCM89610",
846 /* PHY_GBIT_FEATURES */
847 .config_init = bcm54xx_config_init,
848 .ack_interrupt = bcm_phy_ack_intr,
849 .config_intr = bcm_phy_config_intr,
852 module_phy_driver(broadcom_drivers);
854 static struct mdio_device_id __maybe_unused broadcom_tbl[] = {
855 { PHY_ID_BCM5411, 0xfffffff0 },
856 { PHY_ID_BCM5421, 0xfffffff0 },
857 { PHY_ID_BCM54210E, 0xfffffff0 },
858 { PHY_ID_BCM5461, 0xfffffff0 },
859 { PHY_ID_BCM54612E, 0xfffffff0 },
860 { PHY_ID_BCM54616S, 0xfffffff0 },
861 { PHY_ID_BCM5464, 0xfffffff0 },
862 { PHY_ID_BCM5481, 0xfffffff0 },
863 { PHY_ID_BCM54810, 0xfffffff0 },
864 { PHY_ID_BCM54811, 0xfffffff0 },
865 { PHY_ID_BCM5482, 0xfffffff0 },
866 { PHY_ID_BCM50610, 0xfffffff0 },
867 { PHY_ID_BCM50610M, 0xfffffff0 },
868 { PHY_ID_BCM57780, 0xfffffff0 },
869 { PHY_ID_BCMAC131, 0xfffffff0 },
870 { PHY_ID_BCM5241, 0xfffffff0 },
871 { PHY_ID_BCM5395, 0xfffffff0 },
872 { PHY_ID_BCM53125, 0xfffffff0 },
873 { PHY_ID_BCM89610, 0xfffffff0 },
877 MODULE_DEVICE_TABLE(mdio, broadcom_tbl);