blob: 70453701045371e9d2b64cd3f65e070c4b20faeb [file] [log] [blame]
Maciej W. Rozyckic4b41c92006-10-03 16:18:13 +01001/*
2 * drivers/net/phy/broadcom.c
3 *
4 * Broadcom BCM5411, BCM5421 and BCM5461 Gigabit Ethernet
5 * transceivers.
6 *
7 * Copyright (c) 2006 Maciej W. Rozycki
8 *
9 * Inspired by code written by Amy Fong.
10 *
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.
15 */
16
Arun Parameswarana1cba562015-10-06 12:25:48 -070017#include "bcm-phy-lib.h"
Maciej W. Rozyckic4b41c92006-10-03 16:18:13 +010018#include <linux/module.h>
19#include <linux/phy.h>
Matt Carlson8649f132009-11-02 14:30:00 +000020#include <linux/brcmphy.h>
Jon Masonb14995a2016-11-04 01:10:58 -040021#include <linux/of.h>
Matt Carlsond9221e62009-08-25 10:11:26 +000022
23#define BRCM_PHY_MODEL(phydev) \
24 ((phydev)->drv->phy_id & (phydev)->drv->phy_id_mask)
25
Matt Carlson32e5a8d2009-11-02 14:31:39 +000026#define BRCM_PHY_REV(phydev) \
27 ((phydev)->drv->phy_id & ~((phydev)->drv->phy_id_mask))
28
Maciej W. Rozyckic4b41c92006-10-03 16:18:13 +010029MODULE_DESCRIPTION("Broadcom PHY driver");
30MODULE_AUTHOR("Maciej W. Rozycki");
31MODULE_LICENSE("GPL");
32
Rafał Miłecki0fc9ae12017-01-27 14:07:01 +010033static int bcm54210e_config_init(struct phy_device *phydev)
34{
35 int val;
36
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);
41
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);
45
Rafał Miłecki2355a652017-10-12 10:21:25 +020046 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);
50 }
51
Rafał Miłecki0fc9ae12017-01-27 14:07:01 +010052 return 0;
53}
54
Rafał Miłecki62e13092017-01-31 22:54:54 +010055static int bcm54612e_config_init(struct phy_device *phydev)
56{
Kun Yi69e2ecc2018-06-04 13:17:04 -070057 int reg;
58
Rafał Miłecki62e13092017-01-31 22:54:54 +010059 /* 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);
65 }
66
67 /* Clear RX internal delay unless requested. */
68 if ((phydev->interface != PHY_INTERFACE_MODE_RGMII_ID) &&
69 (phydev->interface != PHY_INTERFACE_MODE_RGMII_RXID)) {
Rafał Miłecki62e13092017-01-31 22:54:54 +010070 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);
78 }
79
Kun Yi69e2ecc2018-06-04 13:17:04 -070080 /* Enable CLK125 MUX on LED4 if ref clock is enabled. */
81 if (!(phydev->dev_flags & PHY_BRCM_RX_REFCLK_UNUSED)) {
82 int err;
83
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);
87
88 if (err < 0)
89 return err;
90 }
91
Rafał Miłecki62e13092017-01-31 22:54:54 +010092 return 0;
93}
94
Tao Ren042cb562018-11-05 14:35:40 -080095static int bcm54xx_config_clock_delay(struct phy_device *phydev)
Jon Masonb14995a2016-11-04 01:10:58 -040096{
97 int rc, val;
98
Abhishek Shah73333622017-04-30 11:04:21 +053099 /* handling PHY's internal RX clock delay */
Jon Masonb14995a2016-11-04 01:10:58 -0400100 val = bcm54xx_auxctl_read(phydev, MII_BCM54XX_AUXCTL_SHDWSEL_MISC);
Jon Masonb14995a2016-11-04 01:10:58 -0400101 val |= MII_BCM54XX_AUXCTL_MISC_WREN;
Abhishek Shah73333622017-04-30 11:04:21 +0530102 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;
106 }
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;
111 }
Jon Masonb14995a2016-11-04 01:10:58 -0400112 rc = bcm54xx_auxctl_write(phydev, MII_BCM54XX_AUXCTL_SHDWSEL_MISC,
113 val);
114 if (rc < 0)
115 return rc;
116
Abhishek Shah73333622017-04-30 11:04:21 +0530117 /* handling PHY's internal TX clock delay */
Jon Masonb14995a2016-11-04 01:10:58 -0400118 val = bcm_phy_read_shadow(phydev, BCM54810_SHD_CLK_CTL);
Abhishek Shah73333622017-04-30 11:04:21 +0530119 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;
123 }
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;
128 }
Jon Masonb14995a2016-11-04 01:10:58 -0400129 rc = bcm_phy_write_shadow(phydev, BCM54810_SHD_CLK_CTL, val);
130 if (rc < 0)
131 return rc;
132
133 return 0;
134}
135
Matt Carlson47b1b532009-11-02 14:28:04 +0000136/* Needs SMDSP clock enabled via bcm54xx_phydsp_config() */
Matt Carlson772638b2008-11-03 16:56:51 -0800137static int bcm50610_a0_workaround(struct phy_device *phydev)
138{
139 int err;
140
Arun Parameswarana1cba562015-10-06 12:25:48 -0700141 err = bcm_phy_write_exp(phydev, MII_BCM54XX_EXP_AADJ1CH0,
Matt Carlson47b1b532009-11-02 14:28:04 +0000142 MII_BCM54XX_EXP_AADJ1CH0_SWP_ABCD_OEN |
143 MII_BCM54XX_EXP_AADJ1CH0_SWSEL_THPF);
144 if (err < 0)
145 return err;
146
Arun Parameswarana1cba562015-10-06 12:25:48 -0700147 err = bcm_phy_write_exp(phydev, MII_BCM54XX_EXP_AADJ1CH3,
148 MII_BCM54XX_EXP_AADJ1CH3_ADCCKADJ);
Matt Carlson47b1b532009-11-02 14:28:04 +0000149 if (err < 0)
150 return err;
151
Arun Parameswarana1cba562015-10-06 12:25:48 -0700152 err = bcm_phy_write_exp(phydev, MII_BCM54XX_EXP_EXP75,
Matt Carlson47b1b532009-11-02 14:28:04 +0000153 MII_BCM54XX_EXP_EXP75_VDACCTRL);
154 if (err < 0)
155 return err;
156
Arun Parameswarana1cba562015-10-06 12:25:48 -0700157 err = bcm_phy_write_exp(phydev, MII_BCM54XX_EXP_EXP96,
Matt Carlson47b1b532009-11-02 14:28:04 +0000158 MII_BCM54XX_EXP_EXP96_MYST);
159 if (err < 0)
160 return err;
161
Arun Parameswarana1cba562015-10-06 12:25:48 -0700162 err = bcm_phy_write_exp(phydev, MII_BCM54XX_EXP_EXP97,
Matt Carlson47b1b532009-11-02 14:28:04 +0000163 MII_BCM54XX_EXP_EXP97_MYST);
164
165 return err;
166}
167
168static int bcm54xx_phydsp_config(struct phy_device *phydev)
169{
170 int err, err2;
171
172 /* Enable the SMDSP clock */
Matt Carlson772638b2008-11-03 16:56:51 -0800173 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);
177 if (err < 0)
178 return err;
179
Matt Carlson219c6ef2009-11-02 14:28:33 +0000180 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. */
Arun Parameswarana1cba562015-10-06 12:25:48 -0700183 err = bcm_phy_write_exp(phydev, MII_BCM54XX_EXP_EXP08,
Matt Carlson219c6ef2009-11-02 14:28:33 +0000184 MII_BCM54XX_EXP_EXP08_RJCT_2MHZ);
185 if (err < 0)
186 goto error;
187
188 if (phydev->drv->phy_id == PHY_ID_BCM50610) {
189 err = bcm50610_a0_workaround(phydev);
190 if (err < 0)
191 goto error;
192 }
193 }
Matt Carlson772638b2008-11-03 16:56:51 -0800194
Matt Carlson47b1b532009-11-02 14:28:04 +0000195 if (BRCM_PHY_MODEL(phydev) == PHY_ID_BCM57780) {
196 int val;
Matt Carlson772638b2008-11-03 16:56:51 -0800197
Arun Parameswarana1cba562015-10-06 12:25:48 -0700198 val = bcm_phy_read_exp(phydev, MII_BCM54XX_EXP_EXP75);
Matt Carlson47b1b532009-11-02 14:28:04 +0000199 if (val < 0)
200 goto error;
Matt Carlson772638b2008-11-03 16:56:51 -0800201
Matt Carlson47b1b532009-11-02 14:28:04 +0000202 val |= MII_BCM54XX_EXP_EXP75_CM_OSC;
Arun Parameswarana1cba562015-10-06 12:25:48 -0700203 err = bcm_phy_write_exp(phydev, MII_BCM54XX_EXP_EXP75, val);
Matt Carlson47b1b532009-11-02 14:28:04 +0000204 }
Matt Carlson772638b2008-11-03 16:56:51 -0800205
206error:
Matt Carlson47b1b532009-11-02 14:28:04 +0000207 /* Disable the SMDSP clock */
208 err2 = bcm54xx_auxctl_write(phydev,
209 MII_BCM54XX_AUXCTL_SHDWSEL_AUXCTL,
210 MII_BCM54XX_AUXCTL_ACTL_TX_6DB);
Matt Carlson772638b2008-11-03 16:56:51 -0800211
Matt Carlson47b1b532009-11-02 14:28:04 +0000212 /* Return the first error reported. */
213 return err ? err : err2;
Matt Carlson772638b2008-11-03 16:56:51 -0800214}
215
Matt Carlson32e5a8d2009-11-02 14:31:39 +0000216static void bcm54xx_adjust_rxrefclk(struct phy_device *phydev)
217{
Roel Kluin5ee6f6a2009-12-18 20:16:10 -0800218 u32 orig;
219 int val;
Matt Carlsonc704dc22009-11-02 14:32:12 +0000220 bool clk125en = true;
Matt Carlson32e5a8d2009-11-02 14:31:39 +0000221
222 /* Abort if we are using an untested phy. */
roel kluin7ec4e7d2009-12-30 06:43:06 +0000223 if (BRCM_PHY_MODEL(phydev) != PHY_ID_BCM57780 &&
224 BRCM_PHY_MODEL(phydev) != PHY_ID_BCM50610 &&
Matt Carlson32e5a8d2009-11-02 14:31:39 +0000225 BRCM_PHY_MODEL(phydev) != PHY_ID_BCM50610M)
226 return;
227
Arun Parameswarana1cba562015-10-06 12:25:48 -0700228 val = bcm_phy_read_shadow(phydev, BCM54XX_SHD_SCR3);
Matt Carlson32e5a8d2009-11-02 14:31:39 +0000229 if (val < 0)
230 return;
231
232 orig = val;
233
Matt Carlsonc704dc22009-11-02 14:32:12 +0000234 if ((BRCM_PHY_MODEL(phydev) == PHY_ID_BCM50610 ||
235 BRCM_PHY_MODEL(phydev) == PHY_ID_BCM50610M) &&
236 BRCM_PHY_REV(phydev) >= 0x3) {
237 /*
238 * Here, bit 0 _disables_ CLK125 when set.
239 * This bit is set by default.
240 */
241 clk125en = false;
242 } else {
243 if (phydev->dev_flags & PHY_BRCM_RX_REFCLK_UNUSED) {
Matt Carlson32e5a8d2009-11-02 14:31:39 +0000244 /* Here, bit 0 _enables_ CLK125 when set */
245 val &= ~BCM54XX_SHD_SCR3_DEF_CLK125;
Matt Carlsonc704dc22009-11-02 14:32:12 +0000246 clk125en = false;
Matt Carlson32e5a8d2009-11-02 14:31:39 +0000247 }
248 }
249
Joe Perches23677ce2012-02-09 11:17:23 +0000250 if (!clk125en || (phydev->dev_flags & PHY_BRCM_AUTO_PWRDWN_ENABLE))
Matt Carlsonc704dc22009-11-02 14:32:12 +0000251 val &= ~BCM54XX_SHD_SCR3_DLLAPD_DIS;
252 else
253 val |= BCM54XX_SHD_SCR3_DLLAPD_DIS;
254
Matt Carlson52fae082009-11-02 14:32:38 +0000255 if (phydev->dev_flags & PHY_BRCM_DIS_TXCRXC_NOENRGY)
256 val |= BCM54XX_SHD_SCR3_TRDDAPD;
257
Matt Carlson32e5a8d2009-11-02 14:31:39 +0000258 if (orig != val)
Arun Parameswarana1cba562015-10-06 12:25:48 -0700259 bcm_phy_write_shadow(phydev, BCM54XX_SHD_SCR3, val);
Matt Carlsonc704dc22009-11-02 14:32:12 +0000260
Arun Parameswarana1cba562015-10-06 12:25:48 -0700261 val = bcm_phy_read_shadow(phydev, BCM54XX_SHD_APD);
Matt Carlsonc704dc22009-11-02 14:32:12 +0000262 if (val < 0)
263 return;
264
265 orig = val;
266
Joe Perches23677ce2012-02-09 11:17:23 +0000267 if (!clk125en || (phydev->dev_flags & PHY_BRCM_AUTO_PWRDWN_ENABLE))
Matt Carlsonc704dc22009-11-02 14:32:12 +0000268 val |= BCM54XX_SHD_APD_EN;
269 else
270 val &= ~BCM54XX_SHD_APD_EN;
271
272 if (orig != val)
Arun Parameswarana1cba562015-10-06 12:25:48 -0700273 bcm_phy_write_shadow(phydev, BCM54XX_SHD_APD, val);
Matt Carlson32e5a8d2009-11-02 14:31:39 +0000274}
275
Maciej W. Rozyckic4b41c92006-10-03 16:18:13 +0100276static int bcm54xx_config_init(struct phy_device *phydev)
277{
Abhishek Shah73333622017-04-30 11:04:21 +0530278 int reg, err, val;
Maciej W. Rozyckic4b41c92006-10-03 16:18:13 +0100279
280 reg = phy_read(phydev, MII_BCM54XX_ECR);
281 if (reg < 0)
282 return reg;
283
284 /* Mask interrupts globally. */
285 reg |= MII_BCM54XX_ECR_IM;
286 err = phy_write(phydev, MII_BCM54XX_ECR, reg);
287 if (err < 0)
288 return err;
289
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);
295 if (err < 0)
296 return err;
Matt Carlson772638b2008-11-03 16:56:51 -0800297
Matt Carlson63a14ce2009-11-02 14:30:40 +0000298 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))
Arun Parameswarana1cba562015-10-06 12:25:48 -0700301 bcm_phy_write_shadow(phydev, BCM54XX_SHD_RGMII_MODE, 0);
Matt Carlson63a14ce2009-11-02 14:30:40 +0000302
Matt Carlsonc704dc22009-11-02 14:32:12 +0000303 if ((phydev->dev_flags & PHY_BRCM_RX_REFCLK_UNUSED) ||
Matt Carlson52fae082009-11-02 14:32:38 +0000304 (phydev->dev_flags & PHY_BRCM_DIS_TXCRXC_NOENRGY) ||
Matt Carlsonc704dc22009-11-02 14:32:12 +0000305 (phydev->dev_flags & PHY_BRCM_AUTO_PWRDWN_ENABLE))
Matt Carlson32e5a8d2009-11-02 14:31:39 +0000306 bcm54xx_adjust_rxrefclk(phydev);
307
Rafał Miłecki0fc9ae12017-01-27 14:07:01 +0100308 if (BRCM_PHY_MODEL(phydev) == PHY_ID_BCM54210E) {
309 err = bcm54210e_config_init(phydev);
310 if (err)
311 return err;
Rafał Miłecki62e13092017-01-31 22:54:54 +0100312 } else if (BRCM_PHY_MODEL(phydev) == PHY_ID_BCM54612E) {
313 err = bcm54612e_config_init(phydev);
314 if (err)
315 return err;
Rafał Miłecki0fc9ae12017-01-27 14:07:01 +0100316 } else if (BRCM_PHY_MODEL(phydev) == PHY_ID_BCM54810) {
Abhishek Shah73333622017-04-30 11:04:21 +0530317 /* 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,
323 val);
324 if (err < 0)
Jon Masonb14995a2016-11-04 01:10:58 -0400325 return err;
326 }
327
Matt Carlson47b1b532009-11-02 14:28:04 +0000328 bcm54xx_phydsp_config(phydev);
Matt Carlsond9221e62009-08-25 10:11:26 +0000329
Maciej W. Rozyckic4b41c92006-10-03 16:18:13 +0100330 return 0;
331}
332
Nate Casecd9af3d2008-05-17 06:40:39 +0100333static int bcm5482_config_init(struct phy_device *phydev)
334{
335 int err, reg;
336
337 err = bcm54xx_config_init(phydev);
338
339 if (phydev->dev_flags & PHY_BCM_FLAGS_MODE_1000BX) {
340 /*
341 * Enable secondary SerDes and its use as an LED source
342 */
Arun Parameswarana1cba562015-10-06 12:25:48 -0700343 reg = bcm_phy_read_shadow(phydev, BCM5482_SHD_SSD);
344 bcm_phy_write_shadow(phydev, BCM5482_SHD_SSD,
Nate Casecd9af3d2008-05-17 06:40:39 +0100345 reg |
346 BCM5482_SHD_SSD_LEDM |
347 BCM5482_SHD_SSD_EN);
348
349 /*
350 * Enable SGMII slave mode and auto-detection
351 */
Matt Carlson042a75b2008-11-03 16:56:29 -0800352 reg = BCM5482_SSD_SGMII_SLAVE | MII_BCM54XX_EXP_SEL_SSD;
Arun Parameswarana1cba562015-10-06 12:25:48 -0700353 err = bcm_phy_read_exp(phydev, reg);
Matt Carlson042a75b2008-11-03 16:56:29 -0800354 if (err < 0)
355 return err;
Arun Parameswarana1cba562015-10-06 12:25:48 -0700356 err = bcm_phy_write_exp(phydev, reg, err |
Matt Carlson042a75b2008-11-03 16:56:29 -0800357 BCM5482_SSD_SGMII_SLAVE_EN |
358 BCM5482_SSD_SGMII_SLAVE_AD);
359 if (err < 0)
360 return err;
Nate Casecd9af3d2008-05-17 06:40:39 +0100361
362 /*
363 * Disable secondary SerDes powerdown
364 */
Matt Carlson042a75b2008-11-03 16:56:29 -0800365 reg = BCM5482_SSD_1000BX_CTL | MII_BCM54XX_EXP_SEL_SSD;
Arun Parameswarana1cba562015-10-06 12:25:48 -0700366 err = bcm_phy_read_exp(phydev, reg);
Matt Carlson042a75b2008-11-03 16:56:29 -0800367 if (err < 0)
368 return err;
Arun Parameswarana1cba562015-10-06 12:25:48 -0700369 err = bcm_phy_write_exp(phydev, reg,
Matt Carlson042a75b2008-11-03 16:56:29 -0800370 err & ~BCM5482_SSD_1000BX_CTL_PWRDOWN);
371 if (err < 0)
372 return err;
Nate Casecd9af3d2008-05-17 06:40:39 +0100373
374 /*
375 * Select 1000BASE-X register set (primary SerDes)
376 */
Arun Parameswarana1cba562015-10-06 12:25:48 -0700377 reg = bcm_phy_read_shadow(phydev, BCM5482_SHD_MODE);
378 bcm_phy_write_shadow(phydev, BCM5482_SHD_MODE,
Nate Casecd9af3d2008-05-17 06:40:39 +0100379 reg | BCM5482_SHD_MODE_1000BX);
380
381 /*
382 * LED1=ACTIVITYLED, LED3=LINKSPD[2]
383 * (Use LED1 as secondary SerDes ACTIVITY LED)
384 */
Arun Parameswarana1cba562015-10-06 12:25:48 -0700385 bcm_phy_write_shadow(phydev, BCM5482_SHD_LEDS1,
Nate Casecd9af3d2008-05-17 06:40:39 +0100386 BCM5482_SHD_LEDS1_LED1(BCM_LED_SRC_ACTIVITYLED) |
387 BCM5482_SHD_LEDS1_LED3(BCM_LED_SRC_LINKSPD2));
388
389 /*
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'
393 * is important.
394 */
395 phydev->autoneg = AUTONEG_DISABLE;
396 phydev->speed = SPEED_1000;
397 phydev->duplex = DUPLEX_FULL;
398 }
399
400 return err;
401}
402
403static int bcm5482_read_status(struct phy_device *phydev)
404{
405 int err;
406
407 err = genphy_read_status(phydev);
408
409 if (phydev->dev_flags & PHY_BCM_FLAGS_MODE_1000BX) {
410 /*
411 * Only link status matters for 1000Base-X mode, so force
412 * 1000 Mbit/s full-duplex status
413 */
414 if (phydev->link) {
415 phydev->speed = SPEED_1000;
416 phydev->duplex = DUPLEX_FULL;
417 }
418 }
419
420 return err;
421}
422
Anton Vorontsov57bb7e22008-03-04 19:41:32 +0300423static int bcm5481_config_aneg(struct phy_device *phydev)
424{
Jon Masonb14995a2016-11-04 01:10:58 -0400425 struct device_node *np = phydev->mdio.dev.of_node;
Anton Vorontsov57bb7e22008-03-04 19:41:32 +0300426 int ret;
427
428 /* Aneg firsly. */
429 ret = genphy_config_aneg(phydev);
430
431 /* Then we can set up the delay. */
Tao Ren042cb562018-11-05 14:35:40 -0800432 bcm54xx_config_clock_delay(phydev);
Anton Vorontsov57bb7e22008-03-04 19:41:32 +0300433
Jon Masonb14995a2016-11-04 01:10:58 -0400434 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,
437 0x11B);
438 if (ret < 0)
439 return ret;
440 }
441
Anton Vorontsov57bb7e22008-03-04 19:41:32 +0300442 return ret;
443}
444
Tao Ren042cb562018-11-05 14:35:40 -0800445static int bcm54616s_config_aneg(struct phy_device *phydev)
446{
447 int ret;
448
449 /* Aneg firsly. */
450 ret = genphy_config_aneg(phydev);
451
452 /* Then we can set up the delay. */
453 bcm54xx_config_clock_delay(phydev);
454
455 return ret;
456}
457
Matt Carlsond7a2ed92009-08-25 10:10:58 +0000458static int brcm_phy_setbits(struct phy_device *phydev, int reg, int set)
459{
460 int val;
461
462 val = phy_read(phydev, reg);
463 if (val < 0)
464 return val;
465
466 return phy_write(phydev, reg, val | set);
467}
468
469static int brcm_fet_config_init(struct phy_device *phydev)
470{
471 int reg, err, err2, brcmtest;
472
473 /* Reset the PHY to bring it to a known state. */
474 err = phy_write(phydev, MII_BMCR, BMCR_RESET);
475 if (err < 0)
476 return err;
477
478 reg = phy_read(phydev, MII_BRCM_FET_INTREG);
479 if (reg < 0)
480 return reg;
481
482 /* Unmask events we are interested in and mask interrupts globally. */
483 reg = MII_BRCM_FET_IR_DUPLEX_EN |
484 MII_BRCM_FET_IR_SPEED_EN |
485 MII_BRCM_FET_IR_LINK_EN |
486 MII_BRCM_FET_IR_ENABLE |
487 MII_BRCM_FET_IR_MASK;
488
489 err = phy_write(phydev, MII_BRCM_FET_INTREG, reg);
490 if (err < 0)
491 return err;
492
493 /* Enable shadow register access */
494 brcmtest = phy_read(phydev, MII_BRCM_FET_BRCMTEST);
495 if (brcmtest < 0)
496 return brcmtest;
497
498 reg = brcmtest | MII_BRCM_FET_BT_SRE;
499
500 err = phy_write(phydev, MII_BRCM_FET_BRCMTEST, reg);
501 if (err < 0)
502 return err;
503
504 /* Set the LED mode */
505 reg = phy_read(phydev, MII_BRCM_FET_SHDW_AUXMODE4);
506 if (reg < 0) {
507 err = reg;
508 goto done;
509 }
510
511 reg &= ~MII_BRCM_FET_SHDW_AM4_LED_MASK;
512 reg |= MII_BRCM_FET_SHDW_AM4_LED_MODE1;
513
514 err = phy_write(phydev, MII_BRCM_FET_SHDW_AUXMODE4, reg);
515 if (err < 0)
516 goto done;
517
518 /* Enable auto MDIX */
519 err = brcm_phy_setbits(phydev, MII_BRCM_FET_SHDW_MISCCTRL,
520 MII_BRCM_FET_SHDW_MC_FAME);
521 if (err < 0)
522 goto done;
523
Matt Carlsoncdd4e09d2009-11-02 14:31:11 +0000524 if (phydev->dev_flags & PHY_BRCM_AUTO_PWRDWN_ENABLE) {
525 /* Enable auto power down */
526 err = brcm_phy_setbits(phydev, MII_BRCM_FET_SHDW_AUXSTAT2,
527 MII_BRCM_FET_SHDW_AS2_APDE);
528 }
Matt Carlsond7a2ed92009-08-25 10:10:58 +0000529
530done:
531 /* Disable shadow register access */
532 err2 = phy_write(phydev, MII_BRCM_FET_BRCMTEST, brcmtest);
533 if (!err)
534 err = err2;
535
536 return err;
537}
538
539static int brcm_fet_ack_interrupt(struct phy_device *phydev)
540{
541 int reg;
542
543 /* Clear pending interrupts. */
544 reg = phy_read(phydev, MII_BRCM_FET_INTREG);
545 if (reg < 0)
546 return reg;
547
548 return 0;
549}
550
551static int brcm_fet_config_intr(struct phy_device *phydev)
552{
553 int reg, err;
554
555 reg = phy_read(phydev, MII_BRCM_FET_INTREG);
556 if (reg < 0)
557 return reg;
558
559 if (phydev->interrupts == PHY_INTERRUPT_ENABLED)
560 reg &= ~MII_BRCM_FET_IR_MASK;
561 else
562 reg |= MII_BRCM_FET_IR_MASK;
563
564 err = phy_write(phydev, MII_BRCM_FET_INTREG, reg);
565 return err;
566}
567
Florian Fainelli28dc4c82017-12-14 17:48:16 -0800568struct bcm53xx_phy_priv {
569 u64 *stats;
570};
571
572static int bcm53xx_phy_probe(struct phy_device *phydev)
573{
574 struct bcm53xx_phy_priv *priv;
575
576 priv = devm_kzalloc(&phydev->mdio.dev, sizeof(*priv), GFP_KERNEL);
577 if (!priv)
578 return -ENOMEM;
579
580 phydev->priv = priv;
581
582 priv->stats = devm_kcalloc(&phydev->mdio.dev,
583 bcm_phy_get_sset_count(phydev), sizeof(u64),
584 GFP_KERNEL);
585 if (!priv->stats)
586 return -ENOMEM;
587
588 return 0;
589}
590
591static void bcm53xx_phy_get_stats(struct phy_device *phydev,
592 struct ethtool_stats *stats, u64 *data)
593{
594 struct bcm53xx_phy_priv *priv = phydev->priv;
595
596 bcm_phy_get_stats(phydev, priv->stats, stats, data);
597}
598
Christian Hohnstaedtd5bf9072012-07-04 05:44:34 +0000599static struct phy_driver broadcom_drivers[] = {
600{
Dmitry Baryshkovfcb26ec2010-06-16 23:02:23 +0000601 .phy_id = PHY_ID_BCM5411,
Maciej W. Rozyckic4b41c92006-10-03 16:18:13 +0100602 .phy_id_mask = 0xfffffff0,
603 .name = "Broadcom BCM5411",
Timur Tabi529ed122016-12-07 13:20:51 -0600604 .features = PHY_GBIT_FEATURES,
Andrew Lunn1b86f702017-05-16 18:29:11 +0200605 .flags = PHY_HAS_INTERRUPT,
Maciej W. Rozyckic4b41c92006-10-03 16:18:13 +0100606 .config_init = bcm54xx_config_init,
Arun Parameswarana1cba562015-10-06 12:25:48 -0700607 .ack_interrupt = bcm_phy_ack_intr,
608 .config_intr = bcm_phy_config_intr,
Christian Hohnstaedtd5bf9072012-07-04 05:44:34 +0000609}, {
Dmitry Baryshkovfcb26ec2010-06-16 23:02:23 +0000610 .phy_id = PHY_ID_BCM5421,
Maciej W. Rozyckic4b41c92006-10-03 16:18:13 +0100611 .phy_id_mask = 0xfffffff0,
612 .name = "Broadcom BCM5421",
Timur Tabi529ed122016-12-07 13:20:51 -0600613 .features = PHY_GBIT_FEATURES,
Andrew Lunn1b86f702017-05-16 18:29:11 +0200614 .flags = PHY_HAS_INTERRUPT,
Maciej W. Rozyckic4b41c92006-10-03 16:18:13 +0100615 .config_init = bcm54xx_config_init,
Arun Parameswarana1cba562015-10-06 12:25:48 -0700616 .ack_interrupt = bcm_phy_ack_intr,
617 .config_intr = bcm_phy_config_intr,
Christian Hohnstaedtd5bf9072012-07-04 05:44:34 +0000618}, {
Rafał Miłecki0fc9ae12017-01-27 14:07:01 +0100619 .phy_id = PHY_ID_BCM54210E,
620 .phy_id_mask = 0xfffffff0,
621 .name = "Broadcom BCM54210E",
622 .features = PHY_GBIT_FEATURES,
Andrew Lunn1b86f702017-05-16 18:29:11 +0200623 .flags = PHY_HAS_INTERRUPT,
Rafał Miłecki0fc9ae12017-01-27 14:07:01 +0100624 .config_init = bcm54xx_config_init,
Rafał Miłecki0fc9ae12017-01-27 14:07:01 +0100625 .ack_interrupt = bcm_phy_ack_intr,
626 .config_intr = bcm_phy_config_intr,
627}, {
Dmitry Baryshkovfcb26ec2010-06-16 23:02:23 +0000628 .phy_id = PHY_ID_BCM5461,
Maciej W. Rozyckic4b41c92006-10-03 16:18:13 +0100629 .phy_id_mask = 0xfffffff0,
630 .name = "Broadcom BCM5461",
Timur Tabi529ed122016-12-07 13:20:51 -0600631 .features = PHY_GBIT_FEATURES,
Andrew Lunn1b86f702017-05-16 18:29:11 +0200632 .flags = PHY_HAS_INTERRUPT,
Maciej W. Rozyckic4b41c92006-10-03 16:18:13 +0100633 .config_init = bcm54xx_config_init,
Arun Parameswarana1cba562015-10-06 12:25:48 -0700634 .ack_interrupt = bcm_phy_ack_intr,
635 .config_intr = bcm_phy_config_intr,
Christian Hohnstaedtd5bf9072012-07-04 05:44:34 +0000636}, {
Xo Wangd92ead12016-10-21 10:20:13 -0700637 .phy_id = PHY_ID_BCM54612E,
638 .phy_id_mask = 0xfffffff0,
639 .name = "Broadcom BCM54612E",
Timur Tabi529ed122016-12-07 13:20:51 -0600640 .features = PHY_GBIT_FEATURES,
Andrew Lunn1b86f702017-05-16 18:29:11 +0200641 .flags = PHY_HAS_INTERRUPT,
Xo Wangd92ead12016-10-21 10:20:13 -0700642 .config_init = bcm54xx_config_init,
Xo Wangd92ead12016-10-21 10:20:13 -0700643 .ack_interrupt = bcm_phy_ack_intr,
644 .config_intr = bcm_phy_config_intr,
645}, {
Alessio Igor Bogani3bca4cf62015-04-08 12:15:18 +0200646 .phy_id = PHY_ID_BCM54616S,
647 .phy_id_mask = 0xfffffff0,
648 .name = "Broadcom BCM54616S",
Timur Tabi529ed122016-12-07 13:20:51 -0600649 .features = PHY_GBIT_FEATURES,
Andrew Lunn1b86f702017-05-16 18:29:11 +0200650 .flags = PHY_HAS_INTERRUPT,
Alessio Igor Bogani3bca4cf62015-04-08 12:15:18 +0200651 .config_init = bcm54xx_config_init,
Tao Ren042cb562018-11-05 14:35:40 -0800652 .config_aneg = bcm54616s_config_aneg,
Arun Parameswarana1cba562015-10-06 12:25:48 -0700653 .ack_interrupt = bcm_phy_ack_intr,
654 .config_intr = bcm_phy_config_intr,
Alessio Igor Bogani3bca4cf62015-04-08 12:15:18 +0200655}, {
Dmitry Baryshkovfcb26ec2010-06-16 23:02:23 +0000656 .phy_id = PHY_ID_BCM5464,
Paul Gortmakerb1394f92008-04-14 23:35:41 -0400657 .phy_id_mask = 0xfffffff0,
658 .name = "Broadcom BCM5464",
Timur Tabi529ed122016-12-07 13:20:51 -0600659 .features = PHY_GBIT_FEATURES,
Andrew Lunn1b86f702017-05-16 18:29:11 +0200660 .flags = PHY_HAS_INTERRUPT,
Paul Gortmakerb1394f92008-04-14 23:35:41 -0400661 .config_init = bcm54xx_config_init,
Arun Parameswarana1cba562015-10-06 12:25:48 -0700662 .ack_interrupt = bcm_phy_ack_intr,
663 .config_intr = bcm_phy_config_intr,
Christian Hohnstaedtd5bf9072012-07-04 05:44:34 +0000664}, {
Dmitry Baryshkovfcb26ec2010-06-16 23:02:23 +0000665 .phy_id = PHY_ID_BCM5481,
Anton Vorontsov57bb7e22008-03-04 19:41:32 +0300666 .phy_id_mask = 0xfffffff0,
667 .name = "Broadcom BCM5481",
Timur Tabi529ed122016-12-07 13:20:51 -0600668 .features = PHY_GBIT_FEATURES,
Andrew Lunn1b86f702017-05-16 18:29:11 +0200669 .flags = PHY_HAS_INTERRUPT,
Anton Vorontsov57bb7e22008-03-04 19:41:32 +0300670 .config_init = bcm54xx_config_init,
Heiner Kallweit9753c212017-12-02 10:50:37 +0100671 .config_aneg = bcm5481_config_aneg,
Arun Parameswarana1cba562015-10-06 12:25:48 -0700672 .ack_interrupt = bcm_phy_ack_intr,
673 .config_intr = bcm_phy_config_intr,
Christian Hohnstaedtd5bf9072012-07-04 05:44:34 +0000674}, {
Jon Masonb14995a2016-11-04 01:10:58 -0400675 .phy_id = PHY_ID_BCM54810,
676 .phy_id_mask = 0xfffffff0,
677 .name = "Broadcom BCM54810",
Timur Tabi529ed122016-12-07 13:20:51 -0600678 .features = PHY_GBIT_FEATURES,
Andrew Lunn1b86f702017-05-16 18:29:11 +0200679 .flags = PHY_HAS_INTERRUPT,
Jon Masonb14995a2016-11-04 01:10:58 -0400680 .config_init = bcm54xx_config_init,
Heiner Kallweit9753c212017-12-02 10:50:37 +0100681 .config_aneg = bcm5481_config_aneg,
Jon Masonb14995a2016-11-04 01:10:58 -0400682 .ack_interrupt = bcm_phy_ack_intr,
683 .config_intr = bcm_phy_config_intr,
684}, {
Dmitry Baryshkovfcb26ec2010-06-16 23:02:23 +0000685 .phy_id = PHY_ID_BCM5482,
Nate Case03157ac2008-01-29 10:19:00 -0600686 .phy_id_mask = 0xfffffff0,
687 .name = "Broadcom BCM5482",
Timur Tabi529ed122016-12-07 13:20:51 -0600688 .features = PHY_GBIT_FEATURES,
Andrew Lunn1b86f702017-05-16 18:29:11 +0200689 .flags = PHY_HAS_INTERRUPT,
Nate Casecd9af3d2008-05-17 06:40:39 +0100690 .config_init = bcm5482_config_init,
Heiner Kallweit9753c212017-12-02 10:50:37 +0100691 .read_status = bcm5482_read_status,
Arun Parameswarana1cba562015-10-06 12:25:48 -0700692 .ack_interrupt = bcm_phy_ack_intr,
693 .config_intr = bcm_phy_config_intr,
Christian Hohnstaedtd5bf9072012-07-04 05:44:34 +0000694}, {
Matt Carlson772638b2008-11-03 16:56:51 -0800695 .phy_id = PHY_ID_BCM50610,
696 .phy_id_mask = 0xfffffff0,
697 .name = "Broadcom BCM50610",
Timur Tabi529ed122016-12-07 13:20:51 -0600698 .features = PHY_GBIT_FEATURES,
Andrew Lunn1b86f702017-05-16 18:29:11 +0200699 .flags = PHY_HAS_INTERRUPT,
Matt Carlson772638b2008-11-03 16:56:51 -0800700 .config_init = bcm54xx_config_init,
Arun Parameswarana1cba562015-10-06 12:25:48 -0700701 .ack_interrupt = bcm_phy_ack_intr,
702 .config_intr = bcm_phy_config_intr,
Christian Hohnstaedtd5bf9072012-07-04 05:44:34 +0000703}, {
Matt Carlson4f4598f2009-08-25 10:10:30 +0000704 .phy_id = PHY_ID_BCM50610M,
705 .phy_id_mask = 0xfffffff0,
706 .name = "Broadcom BCM50610M",
Timur Tabi529ed122016-12-07 13:20:51 -0600707 .features = PHY_GBIT_FEATURES,
Andrew Lunn1b86f702017-05-16 18:29:11 +0200708 .flags = PHY_HAS_INTERRUPT,
Matt Carlson4f4598f2009-08-25 10:10:30 +0000709 .config_init = bcm54xx_config_init,
Arun Parameswarana1cba562015-10-06 12:25:48 -0700710 .ack_interrupt = bcm_phy_ack_intr,
711 .config_intr = bcm_phy_config_intr,
Christian Hohnstaedtd5bf9072012-07-04 05:44:34 +0000712}, {
Matt Carlsond9221e62009-08-25 10:11:26 +0000713 .phy_id = PHY_ID_BCM57780,
Matt Carlson2fbb69a2008-11-21 17:22:53 -0800714 .phy_id_mask = 0xfffffff0,
715 .name = "Broadcom BCM57780",
Timur Tabi529ed122016-12-07 13:20:51 -0600716 .features = PHY_GBIT_FEATURES,
Andrew Lunn1b86f702017-05-16 18:29:11 +0200717 .flags = PHY_HAS_INTERRUPT,
Matt Carlson2fbb69a2008-11-21 17:22:53 -0800718 .config_init = bcm54xx_config_init,
Arun Parameswarana1cba562015-10-06 12:25:48 -0700719 .ack_interrupt = bcm_phy_ack_intr,
720 .config_intr = bcm_phy_config_intr,
Christian Hohnstaedtd5bf9072012-07-04 05:44:34 +0000721}, {
Matt Carlson6a443a02010-02-17 15:17:04 +0000722 .phy_id = PHY_ID_BCMAC131,
Matt Carlsond7a2ed92009-08-25 10:10:58 +0000723 .phy_id_mask = 0xfffffff0,
724 .name = "Broadcom BCMAC131",
Timur Tabi529ed122016-12-07 13:20:51 -0600725 .features = PHY_BASIC_FEATURES,
Andrew Lunn1b86f702017-05-16 18:29:11 +0200726 .flags = PHY_HAS_INTERRUPT,
Matt Carlsond7a2ed92009-08-25 10:10:58 +0000727 .config_init = brcm_fet_config_init,
Matt Carlsond7a2ed92009-08-25 10:10:58 +0000728 .ack_interrupt = brcm_fet_ack_interrupt,
729 .config_intr = brcm_fet_config_intr,
Christian Hohnstaedtd5bf9072012-07-04 05:44:34 +0000730}, {
Dmitry Baryshkov7a938f82010-06-16 23:02:24 +0000731 .phy_id = PHY_ID_BCM5241,
732 .phy_id_mask = 0xfffffff0,
733 .name = "Broadcom BCM5241",
Timur Tabi529ed122016-12-07 13:20:51 -0600734 .features = PHY_BASIC_FEATURES,
Andrew Lunn1b86f702017-05-16 18:29:11 +0200735 .flags = PHY_HAS_INTERRUPT,
Dmitry Baryshkov7a938f82010-06-16 23:02:24 +0000736 .config_init = brcm_fet_config_init,
Dmitry Baryshkov7a938f82010-06-16 23:02:24 +0000737 .ack_interrupt = brcm_fet_ack_interrupt,
738 .config_intr = brcm_fet_config_intr,
Florian Fainelli28dc4c82017-12-14 17:48:16 -0800739}, {
740 .phy_id = PHY_ID_BCM5395,
741 .phy_id_mask = 0xfffffff0,
742 .name = "Broadcom BCM5395",
743 .flags = PHY_IS_INTERNAL,
744 .features = PHY_GBIT_FEATURES,
745 .get_sset_count = bcm_phy_get_sset_count,
746 .get_strings = bcm_phy_get_strings,
747 .get_stats = bcm53xx_phy_get_stats,
748 .probe = bcm53xx_phy_probe,
Bhadram Varka23b83922018-05-02 20:43:58 +0530749}, {
750 .phy_id = PHY_ID_BCM89610,
751 .phy_id_mask = 0xfffffff0,
752 .name = "Broadcom BCM89610",
753 .features = PHY_GBIT_FEATURES,
754 .flags = PHY_HAS_INTERRUPT,
755 .config_init = bcm54xx_config_init,
756 .ack_interrupt = bcm_phy_ack_intr,
757 .config_intr = bcm_phy_config_intr,
Christian Hohnstaedtd5bf9072012-07-04 05:44:34 +0000758} };
Dmitry Baryshkov7a938f82010-06-16 23:02:24 +0000759
Johan Hovold50fd7152014-11-11 19:45:59 +0100760module_phy_driver(broadcom_drivers);
David Woodhouse4e4f10f2010-04-02 01:05:56 +0000761
Uwe Kleine-Königcf93c942010-10-03 23:43:32 +0000762static struct mdio_device_id __maybe_unused broadcom_tbl[] = {
Dmitry Baryshkovfcb26ec2010-06-16 23:02:23 +0000763 { PHY_ID_BCM5411, 0xfffffff0 },
764 { PHY_ID_BCM5421, 0xfffffff0 },
Rafał Miłecki0fc9ae12017-01-27 14:07:01 +0100765 { PHY_ID_BCM54210E, 0xfffffff0 },
Dmitry Baryshkovfcb26ec2010-06-16 23:02:23 +0000766 { PHY_ID_BCM5461, 0xfffffff0 },
Xo Wangd92ead12016-10-21 10:20:13 -0700767 { PHY_ID_BCM54612E, 0xfffffff0 },
Alessio Igor Bogani3bca4cf62015-04-08 12:15:18 +0200768 { PHY_ID_BCM54616S, 0xfffffff0 },
Dmitry Baryshkovfcb26ec2010-06-16 23:02:23 +0000769 { PHY_ID_BCM5464, 0xfffffff0 },
Aaro Koskinen3c25a862015-11-22 01:08:54 +0200770 { PHY_ID_BCM5481, 0xfffffff0 },
Jon Masonb14995a2016-11-04 01:10:58 -0400771 { PHY_ID_BCM54810, 0xfffffff0 },
Dmitry Baryshkovfcb26ec2010-06-16 23:02:23 +0000772 { PHY_ID_BCM5482, 0xfffffff0 },
David Woodhouse4e4f10f2010-04-02 01:05:56 +0000773 { PHY_ID_BCM50610, 0xfffffff0 },
774 { PHY_ID_BCM50610M, 0xfffffff0 },
775 { PHY_ID_BCM57780, 0xfffffff0 },
776 { PHY_ID_BCMAC131, 0xfffffff0 },
Dmitry Baryshkov7a938f82010-06-16 23:02:24 +0000777 { PHY_ID_BCM5241, 0xfffffff0 },
Florian Fainelli28dc4c82017-12-14 17:48:16 -0800778 { PHY_ID_BCM5395, 0xfffffff0 },
Bhadram Varka23b83922018-05-02 20:43:58 +0530779 { PHY_ID_BCM89610, 0xfffffff0 },
David Woodhouse4e4f10f2010-04-02 01:05:56 +0000780 { }
781};
782
783MODULE_DEVICE_TABLE(mdio, broadcom_tbl);