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)
33 /* handling PHY's internal RX clock delay */
34 val = bcm54xx_auxctl_read(phydev, MII_BCM54XX_AUXCTL_SHDWSEL_MISC);
35 val |= MII_BCM54XX_AUXCTL_MISC_WREN;
36 if (phydev->interface == PHY_INTERFACE_MODE_RGMII ||
37 phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID) {
38 /* Disable RGMII RXC-RXD skew */
39 val &= ~MII_BCM54XX_AUXCTL_SHDWSEL_MISC_RGMII_SKEW_EN;
41 if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID ||
42 phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID) {
43 /* Enable RGMII RXC-RXD skew */
44 val |= MII_BCM54XX_AUXCTL_SHDWSEL_MISC_RGMII_SKEW_EN;
46 rc = bcm54xx_auxctl_write(phydev, MII_BCM54XX_AUXCTL_SHDWSEL_MISC,
51 /* handling PHY's internal TX clock delay */
52 val = bcm_phy_read_shadow(phydev, BCM54810_SHD_CLK_CTL);
53 if (phydev->interface == PHY_INTERFACE_MODE_RGMII ||
54 phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID) {
55 /* Disable internal TX clock delay */
56 val &= ~BCM54810_SHD_CLK_CTL_GTXCLK_EN;
58 if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID ||
59 phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID) {
60 /* Enable internal TX clock delay */
61 val |= BCM54810_SHD_CLK_CTL_GTXCLK_EN;
63 rc = bcm_phy_write_shadow(phydev, BCM54810_SHD_CLK_CTL, val);
70 static int bcm54210e_config_init(struct phy_device *phydev)
74 bcm54xx_config_clock_delay(phydev);
76 if (phydev->dev_flags & PHY_BRCM_EN_MASTER_MODE) {
77 val = phy_read(phydev, MII_CTRL1000);
78 val |= CTL1000_AS_MASTER | CTL1000_ENABLE_MASTER;
79 phy_write(phydev, MII_CTRL1000, val);
85 static int bcm54612e_config_init(struct phy_device *phydev)
89 bcm54xx_config_clock_delay(phydev);
91 /* Enable CLK125 MUX on LED4 if ref clock is enabled. */
92 if (!(phydev->dev_flags & PHY_BRCM_RX_REFCLK_UNUSED)) {
95 reg = bcm_phy_read_exp(phydev, BCM54612E_EXP_SPARE0);
96 err = bcm_phy_write_exp(phydev, BCM54612E_EXP_SPARE0,
97 BCM54612E_LED4_CLK125OUT_EN | reg);
106 static int bcm54616s_config_init(struct phy_device *phydev)
110 if (phydev->interface != PHY_INTERFACE_MODE_SGMII &&
111 phydev->interface != PHY_INTERFACE_MODE_1000BASEX)
114 /* Ensure proper interface mode is selected. */
115 /* Disable RGMII mode */
116 val = bcm54xx_auxctl_read(phydev, MII_BCM54XX_AUXCTL_SHDWSEL_MISC);
119 val &= ~MII_BCM54XX_AUXCTL_SHDWSEL_MISC_RGMII_EN;
120 val |= MII_BCM54XX_AUXCTL_MISC_WREN;
121 rc = bcm54xx_auxctl_write(phydev, MII_BCM54XX_AUXCTL_SHDWSEL_MISC,
126 /* Select 1000BASE-X register set (primary SerDes) */
127 val = bcm_phy_read_shadow(phydev, BCM54XX_SHD_MODE);
130 val |= BCM54XX_SHD_MODE_1000BX;
131 rc = bcm_phy_write_shadow(phydev, BCM54XX_SHD_MODE, val);
135 /* Power down SerDes interface */
136 rc = phy_set_bits(phydev, MII_BMCR, BMCR_PDOWN);
140 /* Select proper interface mode */
141 val &= ~BCM54XX_SHD_INTF_SEL_MASK;
142 val |= phydev->interface == PHY_INTERFACE_MODE_SGMII ?
143 BCM54XX_SHD_INTF_SEL_SGMII :
144 BCM54XX_SHD_INTF_SEL_GBIC;
145 rc = bcm_phy_write_shadow(phydev, BCM54XX_SHD_MODE, val);
149 /* Power up SerDes interface */
150 rc = phy_clear_bits(phydev, MII_BMCR, BMCR_PDOWN);
154 /* Select copper register set */
155 val &= ~BCM54XX_SHD_MODE_1000BX;
156 rc = bcm_phy_write_shadow(phydev, BCM54XX_SHD_MODE, val);
160 /* Power up copper interface */
161 return phy_clear_bits(phydev, MII_BMCR, BMCR_PDOWN);
164 /* Needs SMDSP clock enabled via bcm54xx_phydsp_config() */
165 static int bcm50610_a0_workaround(struct phy_device *phydev)
169 err = bcm_phy_write_exp(phydev, MII_BCM54XX_EXP_AADJ1CH0,
170 MII_BCM54XX_EXP_AADJ1CH0_SWP_ABCD_OEN |
171 MII_BCM54XX_EXP_AADJ1CH0_SWSEL_THPF);
175 err = bcm_phy_write_exp(phydev, MII_BCM54XX_EXP_AADJ1CH3,
176 MII_BCM54XX_EXP_AADJ1CH3_ADCCKADJ);
180 err = bcm_phy_write_exp(phydev, MII_BCM54XX_EXP_EXP75,
181 MII_BCM54XX_EXP_EXP75_VDACCTRL);
185 err = bcm_phy_write_exp(phydev, MII_BCM54XX_EXP_EXP96,
186 MII_BCM54XX_EXP_EXP96_MYST);
190 err = bcm_phy_write_exp(phydev, MII_BCM54XX_EXP_EXP97,
191 MII_BCM54XX_EXP_EXP97_MYST);
196 static int bcm54xx_phydsp_config(struct phy_device *phydev)
200 /* Enable the SMDSP clock */
201 err = bcm54xx_auxctl_write(phydev,
202 MII_BCM54XX_AUXCTL_SHDWSEL_AUXCTL,
203 MII_BCM54XX_AUXCTL_ACTL_SMDSP_ENA |
204 MII_BCM54XX_AUXCTL_ACTL_TX_6DB);
208 if (BRCM_PHY_MODEL(phydev) == PHY_ID_BCM50610 ||
209 BRCM_PHY_MODEL(phydev) == PHY_ID_BCM50610M) {
210 /* Clear bit 9 to fix a phy interop issue. */
211 err = bcm_phy_write_exp(phydev, MII_BCM54XX_EXP_EXP08,
212 MII_BCM54XX_EXP_EXP08_RJCT_2MHZ);
216 if (phydev->drv->phy_id == PHY_ID_BCM50610) {
217 err = bcm50610_a0_workaround(phydev);
223 if (BRCM_PHY_MODEL(phydev) == PHY_ID_BCM57780) {
226 val = bcm_phy_read_exp(phydev, MII_BCM54XX_EXP_EXP75);
230 val |= MII_BCM54XX_EXP_EXP75_CM_OSC;
231 err = bcm_phy_write_exp(phydev, MII_BCM54XX_EXP_EXP75, val);
235 /* Disable the SMDSP clock */
236 err2 = bcm54xx_auxctl_write(phydev,
237 MII_BCM54XX_AUXCTL_SHDWSEL_AUXCTL,
238 MII_BCM54XX_AUXCTL_ACTL_TX_6DB);
240 /* Return the first error reported. */
241 return err ? err : err2;
244 static void bcm54xx_adjust_rxrefclk(struct phy_device *phydev)
248 bool clk125en = true;
250 /* Abort if we are using an untested phy. */
251 if (BRCM_PHY_MODEL(phydev) != PHY_ID_BCM57780 &&
252 BRCM_PHY_MODEL(phydev) != PHY_ID_BCM50610 &&
253 BRCM_PHY_MODEL(phydev) != PHY_ID_BCM50610M &&
254 BRCM_PHY_MODEL(phydev) != PHY_ID_BCM54210E &&
255 BRCM_PHY_MODEL(phydev) != PHY_ID_BCM54810 &&
256 BRCM_PHY_MODEL(phydev) != PHY_ID_BCM54811)
259 val = bcm_phy_read_shadow(phydev, BCM54XX_SHD_SCR3);
265 if ((BRCM_PHY_MODEL(phydev) == PHY_ID_BCM50610 ||
266 BRCM_PHY_MODEL(phydev) == PHY_ID_BCM50610M) &&
267 BRCM_PHY_REV(phydev) >= 0x3) {
269 * Here, bit 0 _disables_ CLK125 when set.
270 * This bit is set by default.
274 if (phydev->dev_flags & PHY_BRCM_RX_REFCLK_UNUSED) {
275 if (BRCM_PHY_MODEL(phydev) != PHY_ID_BCM54811) {
276 /* Here, bit 0 _enables_ CLK125 when set */
277 val &= ~BCM54XX_SHD_SCR3_DEF_CLK125;
283 if (!clk125en || (phydev->dev_flags & PHY_BRCM_AUTO_PWRDWN_ENABLE))
284 val &= ~BCM54XX_SHD_SCR3_DLLAPD_DIS;
286 val |= BCM54XX_SHD_SCR3_DLLAPD_DIS;
288 if (phydev->dev_flags & PHY_BRCM_DIS_TXCRXC_NOENRGY) {
289 if (BRCM_PHY_MODEL(phydev) == PHY_ID_BCM54210E ||
290 BRCM_PHY_MODEL(phydev) == PHY_ID_BCM54810 ||
291 BRCM_PHY_MODEL(phydev) == PHY_ID_BCM54210E)
292 val |= BCM54XX_SHD_SCR3_RXCTXC_DIS;
294 val |= BCM54XX_SHD_SCR3_TRDDAPD;
298 bcm_phy_write_shadow(phydev, BCM54XX_SHD_SCR3, val);
300 val = bcm_phy_read_shadow(phydev, BCM54XX_SHD_APD);
306 if (!clk125en || (phydev->dev_flags & PHY_BRCM_AUTO_PWRDWN_ENABLE))
307 val |= BCM54XX_SHD_APD_EN;
309 val &= ~BCM54XX_SHD_APD_EN;
312 bcm_phy_write_shadow(phydev, BCM54XX_SHD_APD, val);
315 static int bcm54xx_config_init(struct phy_device *phydev)
319 reg = phy_read(phydev, MII_BCM54XX_ECR);
323 /* Mask interrupts globally. */
324 reg |= MII_BCM54XX_ECR_IM;
325 err = phy_write(phydev, MII_BCM54XX_ECR, reg);
329 /* Unmask events we are interested in. */
330 reg = ~(MII_BCM54XX_INT_DUPLEX |
331 MII_BCM54XX_INT_SPEED |
332 MII_BCM54XX_INT_LINK);
333 err = phy_write(phydev, MII_BCM54XX_IMR, reg);
337 if ((BRCM_PHY_MODEL(phydev) == PHY_ID_BCM50610 ||
338 BRCM_PHY_MODEL(phydev) == PHY_ID_BCM50610M) &&
339 (phydev->dev_flags & PHY_BRCM_CLEAR_RGMII_MODE))
340 bcm_phy_write_shadow(phydev, BCM54XX_SHD_RGMII_MODE, 0);
342 bcm54xx_adjust_rxrefclk(phydev);
344 switch (BRCM_PHY_MODEL(phydev)) {
345 case PHY_ID_BCM50610:
346 case PHY_ID_BCM50610M:
347 err = bcm54xx_config_clock_delay(phydev);
349 case PHY_ID_BCM54210E:
350 err = bcm54210e_config_init(phydev);
352 case PHY_ID_BCM54612E:
353 err = bcm54612e_config_init(phydev);
355 case PHY_ID_BCM54616S:
356 err = bcm54616s_config_init(phydev);
358 case PHY_ID_BCM54810:
359 /* For BCM54810, we need to disable BroadR-Reach function */
360 val = bcm_phy_read_exp(phydev,
361 BCM54810_EXP_BROADREACH_LRE_MISC_CTL);
362 val &= ~BCM54810_EXP_BROADREACH_LRE_MISC_CTL_EN;
363 err = bcm_phy_write_exp(phydev,
364 BCM54810_EXP_BROADREACH_LRE_MISC_CTL,
371 bcm54xx_phydsp_config(phydev);
373 /* For non-SFP setups, encode link speed into LED1 and LED3 pair
375 * Also flash these two LEDs on activity. This means configuring
376 * them for MULTICOLOR and encoding link/activity into them.
377 * Don't do this for devices on an SFP module, since some of these
378 * use the LED outputs to control the SFP LOS signal, and changing
379 * these settings will cause LOS to malfunction.
381 if (!phy_on_sfp(phydev)) {
382 val = BCM5482_SHD_LEDS1_LED1(BCM_LED_SRC_MULTICOLOR1) |
383 BCM5482_SHD_LEDS1_LED3(BCM_LED_SRC_MULTICOLOR1);
384 bcm_phy_write_shadow(phydev, BCM5482_SHD_LEDS1, val);
386 val = BCM_LED_MULTICOLOR_IN_PHASE |
387 BCM5482_SHD_LEDS1_LED1(BCM_LED_MULTICOLOR_LINK_ACT) |
388 BCM5482_SHD_LEDS1_LED3(BCM_LED_MULTICOLOR_LINK_ACT);
389 bcm_phy_write_exp(phydev, BCM_EXP_MULTICOLOR, val);
395 static int bcm54xx_resume(struct phy_device *phydev)
399 /* Writes to register other than BMCR would be ignored
400 * unless we clear the PDOWN bit first
402 ret = genphy_resume(phydev);
406 /* Upon exiting power down, the PHY remains in an internal reset state
411 return bcm54xx_config_init(phydev);
414 static int bcm54811_config_init(struct phy_device *phydev)
418 /* Disable BroadR-Reach function. */
419 reg = bcm_phy_read_exp(phydev, BCM54810_EXP_BROADREACH_LRE_MISC_CTL);
420 reg &= ~BCM54810_EXP_BROADREACH_LRE_MISC_CTL_EN;
421 err = bcm_phy_write_exp(phydev, BCM54810_EXP_BROADREACH_LRE_MISC_CTL,
426 err = bcm54xx_config_init(phydev);
428 /* Enable CLK125 MUX on LED4 if ref clock is enabled. */
429 if (!(phydev->dev_flags & PHY_BRCM_RX_REFCLK_UNUSED)) {
430 reg = bcm_phy_read_exp(phydev, BCM54612E_EXP_SPARE0);
431 err = bcm_phy_write_exp(phydev, BCM54612E_EXP_SPARE0,
432 BCM54612E_LED4_CLK125OUT_EN | reg);
440 static int bcm5481_config_aneg(struct phy_device *phydev)
442 struct device_node *np = phydev->mdio.dev.of_node;
446 ret = genphy_config_aneg(phydev);
448 /* Then we can set up the delay. */
449 bcm54xx_config_clock_delay(phydev);
451 if (of_property_read_bool(np, "enet-phy-lane-swap")) {
452 /* Lane Swap - Undocumented register...magic! */
453 ret = bcm_phy_write_exp(phydev, MII_BCM54XX_EXP_SEL_ER + 0x9,
462 struct bcm54616s_phy_priv {
466 static int bcm54616s_probe(struct phy_device *phydev)
468 struct bcm54616s_phy_priv *priv;
471 priv = devm_kzalloc(&phydev->mdio.dev, sizeof(*priv), GFP_KERNEL);
477 val = bcm_phy_read_shadow(phydev, BCM54XX_SHD_MODE);
481 /* The PHY is strapped in RGMII-fiber mode when INTERF_SEL[1:0]
482 * is 01b, and the link between PHY and its link partner can be
483 * either 1000Base-X or 100Base-FX.
484 * RGMII-1000Base-X is properly supported, but RGMII-100Base-FX
485 * support is still missing as of now.
487 if ((val & BCM54XX_SHD_INTF_SEL_MASK) == BCM54XX_SHD_INTF_SEL_RGMII) {
488 val = bcm_phy_read_shadow(phydev, BCM54616S_SHD_100FX_CTRL);
492 /* Bit 0 of the SerDes 100-FX Control register, when set
493 * to 1, sets the MII/RGMII -> 100BASE-FX configuration.
494 * When this bit is set to 0, it sets the GMII/RGMII ->
495 * 1000BASE-X configuration.
497 if (!(val & BCM54616S_100FX_MODE))
498 priv->mode_1000bx_en = true;
500 phydev->port = PORT_FIBRE;
506 static int bcm54616s_config_aneg(struct phy_device *phydev)
508 struct bcm54616s_phy_priv *priv = phydev->priv;
512 if (priv->mode_1000bx_en)
513 ret = genphy_c37_config_aneg(phydev);
515 ret = genphy_config_aneg(phydev);
517 /* Then we can set up the delay. */
518 bcm54xx_config_clock_delay(phydev);
523 static int bcm54616s_read_status(struct phy_device *phydev)
525 struct bcm54616s_phy_priv *priv = phydev->priv;
528 if (priv->mode_1000bx_en)
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 err = brcm_fet_ack_interrupt(phydev);
642 reg &= ~MII_BRCM_FET_IR_MASK;
643 err = phy_write(phydev, MII_BRCM_FET_INTREG, reg);
645 reg |= MII_BRCM_FET_IR_MASK;
646 err = phy_write(phydev, MII_BRCM_FET_INTREG, reg);
650 err = brcm_fet_ack_interrupt(phydev);
656 static irqreturn_t brcm_fet_handle_interrupt(struct phy_device *phydev)
660 irq_status = phy_read(phydev, MII_BRCM_FET_INTREG);
661 if (irq_status < 0) {
669 phy_trigger_machine(phydev);
674 struct bcm54xx_phy_priv {
678 static int bcm54xx_phy_probe(struct phy_device *phydev)
680 struct bcm54xx_phy_priv *priv;
682 priv = devm_kzalloc(&phydev->mdio.dev, sizeof(*priv), GFP_KERNEL);
688 priv->stats = devm_kcalloc(&phydev->mdio.dev,
689 bcm_phy_get_sset_count(phydev), sizeof(u64),
697 static void bcm54xx_get_stats(struct phy_device *phydev,
698 struct ethtool_stats *stats, u64 *data)
700 struct bcm54xx_phy_priv *priv = phydev->priv;
702 bcm_phy_get_stats(phydev, priv->stats, stats, data);
705 static struct phy_driver broadcom_drivers[] = {
707 .phy_id = PHY_ID_BCM5411,
708 .phy_id_mask = 0xfffffff0,
709 .name = "Broadcom BCM5411",
710 /* PHY_GBIT_FEATURES */
711 .get_sset_count = bcm_phy_get_sset_count,
712 .get_strings = bcm_phy_get_strings,
713 .get_stats = bcm54xx_get_stats,
714 .probe = bcm54xx_phy_probe,
715 .config_init = bcm54xx_config_init,
716 .config_intr = bcm_phy_config_intr,
717 .handle_interrupt = bcm_phy_handle_interrupt,
719 .phy_id = PHY_ID_BCM5421,
720 .phy_id_mask = 0xfffffff0,
721 .name = "Broadcom BCM5421",
722 /* PHY_GBIT_FEATURES */
723 .get_sset_count = bcm_phy_get_sset_count,
724 .get_strings = bcm_phy_get_strings,
725 .get_stats = bcm54xx_get_stats,
726 .probe = bcm54xx_phy_probe,
727 .config_init = bcm54xx_config_init,
728 .config_intr = bcm_phy_config_intr,
729 .handle_interrupt = bcm_phy_handle_interrupt,
731 .phy_id = PHY_ID_BCM54210E,
732 .phy_id_mask = 0xfffffff0,
733 .name = "Broadcom BCM54210E",
734 /* PHY_GBIT_FEATURES */
735 .get_sset_count = bcm_phy_get_sset_count,
736 .get_strings = bcm_phy_get_strings,
737 .get_stats = bcm54xx_get_stats,
738 .probe = bcm54xx_phy_probe,
739 .config_init = bcm54xx_config_init,
740 .config_intr = bcm_phy_config_intr,
741 .handle_interrupt = bcm_phy_handle_interrupt,
743 .phy_id = PHY_ID_BCM5461,
744 .phy_id_mask = 0xfffffff0,
745 .name = "Broadcom BCM5461",
746 /* PHY_GBIT_FEATURES */
747 .get_sset_count = bcm_phy_get_sset_count,
748 .get_strings = bcm_phy_get_strings,
749 .get_stats = bcm54xx_get_stats,
750 .probe = bcm54xx_phy_probe,
751 .config_init = bcm54xx_config_init,
752 .config_intr = bcm_phy_config_intr,
753 .handle_interrupt = bcm_phy_handle_interrupt,
755 .phy_id = PHY_ID_BCM54612E,
756 .phy_id_mask = 0xfffffff0,
757 .name = "Broadcom BCM54612E",
758 /* PHY_GBIT_FEATURES */
759 .get_sset_count = bcm_phy_get_sset_count,
760 .get_strings = bcm_phy_get_strings,
761 .get_stats = bcm54xx_get_stats,
762 .probe = bcm54xx_phy_probe,
763 .config_init = bcm54xx_config_init,
764 .config_intr = bcm_phy_config_intr,
765 .handle_interrupt = bcm_phy_handle_interrupt,
767 .phy_id = PHY_ID_BCM54616S,
768 .phy_id_mask = 0xfffffff0,
769 .name = "Broadcom BCM54616S",
770 /* PHY_GBIT_FEATURES */
771 .config_init = bcm54xx_config_init,
772 .config_aneg = bcm54616s_config_aneg,
773 .config_intr = bcm_phy_config_intr,
774 .handle_interrupt = bcm_phy_handle_interrupt,
775 .read_status = bcm54616s_read_status,
776 .probe = bcm54616s_probe,
778 .phy_id = PHY_ID_BCM5464,
779 .phy_id_mask = 0xfffffff0,
780 .name = "Broadcom BCM5464",
781 /* PHY_GBIT_FEATURES */
782 .get_sset_count = bcm_phy_get_sset_count,
783 .get_strings = bcm_phy_get_strings,
784 .get_stats = bcm54xx_get_stats,
785 .probe = bcm54xx_phy_probe,
786 .config_init = bcm54xx_config_init,
787 .config_intr = bcm_phy_config_intr,
788 .handle_interrupt = bcm_phy_handle_interrupt,
789 .suspend = genphy_suspend,
790 .resume = genphy_resume,
792 .phy_id = PHY_ID_BCM5481,
793 .phy_id_mask = 0xfffffff0,
794 .name = "Broadcom BCM5481",
795 /* PHY_GBIT_FEATURES */
796 .get_sset_count = bcm_phy_get_sset_count,
797 .get_strings = bcm_phy_get_strings,
798 .get_stats = bcm54xx_get_stats,
799 .probe = bcm54xx_phy_probe,
800 .config_init = bcm54xx_config_init,
801 .config_aneg = bcm5481_config_aneg,
802 .config_intr = bcm_phy_config_intr,
803 .handle_interrupt = bcm_phy_handle_interrupt,
805 .phy_id = PHY_ID_BCM54810,
806 .phy_id_mask = 0xfffffff0,
807 .name = "Broadcom BCM54810",
808 /* PHY_GBIT_FEATURES */
809 .get_sset_count = bcm_phy_get_sset_count,
810 .get_strings = bcm_phy_get_strings,
811 .get_stats = bcm54xx_get_stats,
812 .probe = bcm54xx_phy_probe,
813 .config_init = bcm54xx_config_init,
814 .config_aneg = bcm5481_config_aneg,
815 .config_intr = bcm_phy_config_intr,
816 .handle_interrupt = bcm_phy_handle_interrupt,
817 .suspend = genphy_suspend,
818 .resume = bcm54xx_resume,
820 .phy_id = PHY_ID_BCM54811,
821 .phy_id_mask = 0xfffffff0,
822 .name = "Broadcom BCM54811",
823 /* PHY_GBIT_FEATURES */
824 .get_sset_count = bcm_phy_get_sset_count,
825 .get_strings = bcm_phy_get_strings,
826 .get_stats = bcm54xx_get_stats,
827 .probe = bcm54xx_phy_probe,
828 .config_init = bcm54811_config_init,
829 .config_aneg = bcm5481_config_aneg,
830 .config_intr = bcm_phy_config_intr,
831 .handle_interrupt = bcm_phy_handle_interrupt,
832 .suspend = genphy_suspend,
833 .resume = bcm54xx_resume,
835 .phy_id = PHY_ID_BCM5482,
836 .phy_id_mask = 0xfffffff0,
837 .name = "Broadcom BCM5482",
838 /* PHY_GBIT_FEATURES */
839 .get_sset_count = bcm_phy_get_sset_count,
840 .get_strings = bcm_phy_get_strings,
841 .get_stats = bcm54xx_get_stats,
842 .probe = bcm54xx_phy_probe,
843 .config_init = bcm54xx_config_init,
844 .config_intr = bcm_phy_config_intr,
845 .handle_interrupt = bcm_phy_handle_interrupt,
847 .phy_id = PHY_ID_BCM50610,
848 .phy_id_mask = 0xfffffff0,
849 .name = "Broadcom BCM50610",
850 /* PHY_GBIT_FEATURES */
851 .get_sset_count = bcm_phy_get_sset_count,
852 .get_strings = bcm_phy_get_strings,
853 .get_stats = bcm54xx_get_stats,
854 .probe = bcm54xx_phy_probe,
855 .config_init = bcm54xx_config_init,
856 .config_intr = bcm_phy_config_intr,
857 .handle_interrupt = bcm_phy_handle_interrupt,
859 .phy_id = PHY_ID_BCM50610M,
860 .phy_id_mask = 0xfffffff0,
861 .name = "Broadcom BCM50610M",
862 /* PHY_GBIT_FEATURES */
863 .get_sset_count = bcm_phy_get_sset_count,
864 .get_strings = bcm_phy_get_strings,
865 .get_stats = bcm54xx_get_stats,
866 .probe = bcm54xx_phy_probe,
867 .config_init = bcm54xx_config_init,
868 .config_intr = bcm_phy_config_intr,
869 .handle_interrupt = bcm_phy_handle_interrupt,
871 .phy_id = PHY_ID_BCM57780,
872 .phy_id_mask = 0xfffffff0,
873 .name = "Broadcom BCM57780",
874 /* PHY_GBIT_FEATURES */
875 .get_sset_count = bcm_phy_get_sset_count,
876 .get_strings = bcm_phy_get_strings,
877 .get_stats = bcm54xx_get_stats,
878 .probe = bcm54xx_phy_probe,
879 .config_init = bcm54xx_config_init,
880 .config_intr = bcm_phy_config_intr,
881 .handle_interrupt = bcm_phy_handle_interrupt,
883 .phy_id = PHY_ID_BCMAC131,
884 .phy_id_mask = 0xfffffff0,
885 .name = "Broadcom BCMAC131",
886 /* PHY_BASIC_FEATURES */
887 .config_init = brcm_fet_config_init,
888 .config_intr = brcm_fet_config_intr,
889 .handle_interrupt = brcm_fet_handle_interrupt,
891 .phy_id = PHY_ID_BCM5241,
892 .phy_id_mask = 0xfffffff0,
893 .name = "Broadcom BCM5241",
894 /* PHY_BASIC_FEATURES */
895 .config_init = brcm_fet_config_init,
896 .config_intr = brcm_fet_config_intr,
897 .handle_interrupt = brcm_fet_handle_interrupt,
899 .phy_id = PHY_ID_BCM5395,
900 .phy_id_mask = 0xfffffff0,
901 .name = "Broadcom BCM5395",
902 .flags = PHY_IS_INTERNAL,
903 /* PHY_GBIT_FEATURES */
904 .get_sset_count = bcm_phy_get_sset_count,
905 .get_strings = bcm_phy_get_strings,
906 .get_stats = bcm54xx_get_stats,
907 .probe = bcm54xx_phy_probe,
909 .phy_id = PHY_ID_BCM53125,
910 .phy_id_mask = 0xfffffff0,
911 .name = "Broadcom BCM53125",
912 .flags = PHY_IS_INTERNAL,
913 /* PHY_GBIT_FEATURES */
914 .get_sset_count = bcm_phy_get_sset_count,
915 .get_strings = bcm_phy_get_strings,
916 .get_stats = bcm54xx_get_stats,
917 .probe = bcm54xx_phy_probe,
918 .config_init = bcm54xx_config_init,
919 .config_intr = bcm_phy_config_intr,
920 .handle_interrupt = bcm_phy_handle_interrupt,
922 .phy_id = PHY_ID_BCM89610,
923 .phy_id_mask = 0xfffffff0,
924 .name = "Broadcom BCM89610",
925 /* PHY_GBIT_FEATURES */
926 .get_sset_count = bcm_phy_get_sset_count,
927 .get_strings = bcm_phy_get_strings,
928 .get_stats = bcm54xx_get_stats,
929 .probe = bcm54xx_phy_probe,
930 .config_init = bcm54xx_config_init,
931 .config_intr = bcm_phy_config_intr,
932 .handle_interrupt = bcm_phy_handle_interrupt,
935 module_phy_driver(broadcom_drivers);
937 static struct mdio_device_id __maybe_unused broadcom_tbl[] = {
938 { PHY_ID_BCM5411, 0xfffffff0 },
939 { PHY_ID_BCM5421, 0xfffffff0 },
940 { PHY_ID_BCM54210E, 0xfffffff0 },
941 { PHY_ID_BCM5461, 0xfffffff0 },
942 { PHY_ID_BCM54612E, 0xfffffff0 },
943 { PHY_ID_BCM54616S, 0xfffffff0 },
944 { PHY_ID_BCM5464, 0xfffffff0 },
945 { PHY_ID_BCM5481, 0xfffffff0 },
946 { PHY_ID_BCM54810, 0xfffffff0 },
947 { PHY_ID_BCM54811, 0xfffffff0 },
948 { PHY_ID_BCM5482, 0xfffffff0 },
949 { PHY_ID_BCM50610, 0xfffffff0 },
950 { PHY_ID_BCM50610M, 0xfffffff0 },
951 { PHY_ID_BCM57780, 0xfffffff0 },
952 { PHY_ID_BCMAC131, 0xfffffff0 },
953 { PHY_ID_BCM5241, 0xfffffff0 },
954 { PHY_ID_BCM5395, 0xfffffff0 },
955 { PHY_ID_BCM53125, 0xfffffff0 },
956 { PHY_ID_BCM89610, 0xfffffff0 },
960 MODULE_DEVICE_TABLE(mdio, broadcom_tbl);