1 // SPDX-License-Identifier: GPL-2.0+
3 * Driver for Vitesse PHYs
5 * Author: Kriston Carson
8 #include <linux/kernel.h>
9 #include <linux/module.h>
10 #include <linux/mii.h>
11 #include <linux/ethtool.h>
12 #include <linux/phy.h>
13 #include <linux/bitfield.h>
15 /* Vitesse Extended Page Magic Register(s) */
16 #define MII_VSC73XX_EXT_PAGE_1E 0x01
17 #define MII_VSC82X4_EXT_PAGE_16E 0x10
18 #define MII_VSC82X4_EXT_PAGE_17E 0x11
19 #define MII_VSC82X4_EXT_PAGE_18E 0x12
21 /* Vitesse Extended Control Register 1 */
22 #define MII_VSC8244_EXT_CON1 0x17
23 #define MII_VSC8244_EXTCON1_INIT 0x0000
24 #define MII_VSC8244_EXTCON1_TX_SKEW_MASK 0x0c00
25 #define MII_VSC8244_EXTCON1_RX_SKEW_MASK 0x0300
26 #define MII_VSC8244_EXTCON1_TX_SKEW 0x0800
27 #define MII_VSC8244_EXTCON1_RX_SKEW 0x0200
29 /* Vitesse Interrupt Mask Register */
30 #define MII_VSC8244_IMASK 0x19
31 #define MII_VSC8244_IMASK_IEN 0x8000
32 #define MII_VSC8244_IMASK_SPEED 0x4000
33 #define MII_VSC8244_IMASK_LINK 0x2000
34 #define MII_VSC8244_IMASK_DUPLEX 0x1000
35 #define MII_VSC8244_IMASK_MASK 0xf000
37 #define MII_VSC8221_IMASK_MASK 0xa000
39 /* Vitesse Interrupt Status Register */
40 #define MII_VSC8244_ISTAT 0x1a
41 #define MII_VSC8244_ISTAT_STATUS 0x8000
42 #define MII_VSC8244_ISTAT_SPEED 0x4000
43 #define MII_VSC8244_ISTAT_LINK 0x2000
44 #define MII_VSC8244_ISTAT_DUPLEX 0x1000
45 #define MII_VSC8244_ISTAT_MASK (MII_VSC8244_ISTAT_SPEED | \
46 MII_VSC8244_ISTAT_LINK | \
47 MII_VSC8244_ISTAT_DUPLEX)
49 #define MII_VSC8221_ISTAT_MASK MII_VSC8244_ISTAT_LINK
51 /* Vitesse Auxiliary Control/Status Register */
52 #define MII_VSC8244_AUX_CONSTAT 0x1c
53 #define MII_VSC8244_AUXCONSTAT_INIT 0x0000
54 #define MII_VSC8244_AUXCONSTAT_DUPLEX 0x0020
55 #define MII_VSC8244_AUXCONSTAT_SPEED 0x0018
56 #define MII_VSC8244_AUXCONSTAT_GBIT 0x0010
57 #define MII_VSC8244_AUXCONSTAT_100 0x0008
59 #define MII_VSC8221_AUXCONSTAT_INIT 0x0004 /* need to set this bit? */
60 #define MII_VSC8221_AUXCONSTAT_RESERVED 0x0004
62 /* Vitesse Extended Page Access Register */
63 #define MII_VSC82X4_EXT_PAGE_ACCESS 0x1f
65 /* Vitesse VSC73XX Extended Control Register */
66 #define MII_VSC73XX_PHY_CTRL_EXT3 0x14
68 #define MII_VSC73XX_PHY_CTRL_EXT3_DOWNSHIFT_EN BIT(4)
69 #define MII_VSC73XX_PHY_CTRL_EXT3_DOWNSHIFT_CNT GENMASK(3, 2)
70 #define MII_VSC73XX_PHY_CTRL_EXT3_DOWNSHIFT_STA BIT(1)
71 #define MII_VSC73XX_DOWNSHIFT_MAX 5
72 #define MII_VSC73XX_DOWNSHIFT_INVAL 1
74 /* VSC73XX PHY_BYPASS_CTRL register*/
75 #define MII_VSC73XX_PHY_BYPASS_CTRL MII_DCOUNTER
76 #define MII_VSC73XX_PBC_TX_DIS BIT(15)
77 #define MII_VSC73XX_PBC_FOR_SPD_AUTO_MDIX_DIS BIT(7)
78 #define MII_VSC73XX_PBC_PAIR_SWAP_DIS BIT(5)
79 #define MII_VSC73XX_PBC_POL_INV_DIS BIT(4)
80 #define MII_VSC73XX_PBC_PARALLEL_DET_DIS BIT(3)
81 #define MII_VSC73XX_PBC_AUTO_NP_EXCHANGE_DIS BIT(1)
83 /* VSC73XX PHY_AUX_CTRL_STAT register */
84 #define MII_VSC73XX_PHY_AUX_CTRL_STAT MII_NCONFIG
85 #define MII_VSC73XX_PACS_NO_MDI_X_IND BIT(13)
87 /* Vitesse VSC8601 Extended PHY Control Register 1 */
88 #define MII_VSC8601_EPHY_CTL 0x17
89 #define MII_VSC8601_EPHY_CTL_RGMII_SKEW (1 << 8)
91 #define PHY_ID_VSC8234 0x000fc620
92 #define PHY_ID_VSC8244 0x000fc6c0
93 #define PHY_ID_VSC8572 0x000704d0
94 #define PHY_ID_VSC8601 0x00070420
95 #define PHY_ID_VSC7385 0x00070450
96 #define PHY_ID_VSC7388 0x00070480
97 #define PHY_ID_VSC7395 0x00070550
98 #define PHY_ID_VSC7398 0x00070580
99 #define PHY_ID_VSC8662 0x00070660
100 #define PHY_ID_VSC8221 0x000fc550
101 #define PHY_ID_VSC8211 0x000fc4b0
103 MODULE_DESCRIPTION("Vitesse PHY driver");
104 MODULE_AUTHOR("Kriston Carson");
105 MODULE_LICENSE("GPL");
107 static int vsc824x_add_skew(struct phy_device
*phydev
)
112 extcon
= phy_read(phydev
, MII_VSC8244_EXT_CON1
);
117 extcon
&= ~(MII_VSC8244_EXTCON1_TX_SKEW_MASK
|
118 MII_VSC8244_EXTCON1_RX_SKEW_MASK
);
120 extcon
|= (MII_VSC8244_EXTCON1_TX_SKEW
|
121 MII_VSC8244_EXTCON1_RX_SKEW
);
123 err
= phy_write(phydev
, MII_VSC8244_EXT_CON1
, extcon
);
128 static int vsc824x_config_init(struct phy_device
*phydev
)
132 err
= phy_write(phydev
, MII_VSC8244_AUX_CONSTAT
,
133 MII_VSC8244_AUXCONSTAT_INIT
);
137 if (phydev
->interface
== PHY_INTERFACE_MODE_RGMII_ID
)
138 err
= vsc824x_add_skew(phydev
);
143 #define VSC73XX_EXT_PAGE_ACCESS 0x1f
145 static int vsc73xx_read_page(struct phy_device
*phydev
)
147 return __phy_read(phydev
, VSC73XX_EXT_PAGE_ACCESS
);
150 static int vsc73xx_write_page(struct phy_device
*phydev
, int page
)
152 return __phy_write(phydev
, VSC73XX_EXT_PAGE_ACCESS
, page
);
155 static int vsc73xx_get_downshift(struct phy_device
*phydev
, u8
*data
)
157 int val
, enable
, cnt
;
159 val
= phy_read_paged(phydev
, MII_VSC73XX_EXT_PAGE_1E
,
160 MII_VSC73XX_PHY_CTRL_EXT3
);
164 enable
= FIELD_GET(MII_VSC73XX_PHY_CTRL_EXT3_DOWNSHIFT_EN
, val
);
165 cnt
= FIELD_GET(MII_VSC73XX_PHY_CTRL_EXT3_DOWNSHIFT_CNT
, val
) + 2;
167 *data
= enable
? cnt
: DOWNSHIFT_DEV_DISABLE
;
172 static int vsc73xx_set_downshift(struct phy_device
*phydev
, u8 cnt
)
177 if (cnt
> MII_VSC73XX_DOWNSHIFT_MAX
)
179 else if (cnt
== MII_VSC73XX_DOWNSHIFT_INVAL
)
182 mask
= MII_VSC73XX_PHY_CTRL_EXT3_DOWNSHIFT_EN
;
187 mask
|= MII_VSC73XX_PHY_CTRL_EXT3_DOWNSHIFT_CNT
;
188 val
= MII_VSC73XX_PHY_CTRL_EXT3_DOWNSHIFT_EN
|
189 FIELD_PREP(MII_VSC73XX_PHY_CTRL_EXT3_DOWNSHIFT_CNT
,
193 ret
= phy_modify_paged(phydev
, MII_VSC73XX_EXT_PAGE_1E
,
194 MII_VSC73XX_PHY_CTRL_EXT3
, mask
, val
);
198 return genphy_soft_reset(phydev
);
201 static int vsc73xx_get_tunable(struct phy_device
*phydev
,
202 struct ethtool_tunable
*tuna
, void *data
)
205 case ETHTOOL_PHY_DOWNSHIFT
:
206 return vsc73xx_get_downshift(phydev
, data
);
212 static int vsc73xx_set_tunable(struct phy_device
*phydev
,
213 struct ethtool_tunable
*tuna
, const void *data
)
216 case ETHTOOL_PHY_DOWNSHIFT
:
217 return vsc73xx_set_downshift(phydev
, *(const u8
*)data
);
223 static void vsc73xx_config_init(struct phy_device
*phydev
)
226 phy_write(phydev
, 0x1f, 0x2a30);
227 phy_modify(phydev
, 0x0c, 0x0300, 0x0200);
228 phy_write(phydev
, 0x1f, 0x0000);
230 /* Config LEDs 0x61 */
231 phy_modify(phydev
, MII_TPISTATUS
, 0xff00, 0x0061);
233 /* Enable downshift by default */
234 vsc73xx_set_downshift(phydev
, MII_VSC73XX_DOWNSHIFT_MAX
);
236 /* Set Auto MDI-X by default */
237 phydev
->mdix_ctrl
= ETH_TP_MDI_AUTO
;
240 static int vsc738x_config_init(struct phy_device
*phydev
)
243 /* This magic sequence appear in the application note
244 * "VSC7385/7388 PHY Configuration".
246 * Maybe one day we will get to know what it all means.
248 phy_write(phydev
, 0x1f, 0x2a30);
249 phy_modify(phydev
, 0x08, 0x0200, 0x0200);
250 phy_write(phydev
, 0x1f, 0x52b5);
251 phy_write(phydev
, 0x10, 0xb68a);
252 phy_modify(phydev
, 0x12, 0xff07, 0x0003);
253 phy_modify(phydev
, 0x11, 0x00ff, 0x00a2);
254 phy_write(phydev
, 0x10, 0x968a);
255 phy_write(phydev
, 0x1f, 0x2a30);
256 phy_modify(phydev
, 0x08, 0x0200, 0x0000);
257 phy_write(phydev
, 0x1f, 0x0000);
260 rev
= phy_read(phydev
, MII_PHYSID2
);
263 /* Special quirk for revision 0 */
265 phy_write(phydev
, 0x1f, 0x2a30);
266 phy_modify(phydev
, 0x08, 0x0200, 0x0200);
267 phy_write(phydev
, 0x1f, 0x52b5);
268 phy_write(phydev
, 0x12, 0x0000);
269 phy_write(phydev
, 0x11, 0x0689);
270 phy_write(phydev
, 0x10, 0x8f92);
271 phy_write(phydev
, 0x1f, 0x52b5);
272 phy_write(phydev
, 0x12, 0x0000);
273 phy_write(phydev
, 0x11, 0x0e35);
274 phy_write(phydev
, 0x10, 0x9786);
275 phy_write(phydev
, 0x1f, 0x2a30);
276 phy_modify(phydev
, 0x08, 0x0200, 0x0000);
277 phy_write(phydev
, 0x17, 0xff80);
278 phy_write(phydev
, 0x17, 0x0000);
281 phy_write(phydev
, 0x1f, 0x0000);
282 phy_write(phydev
, 0x12, 0x0048);
285 phy_write(phydev
, 0x1f, 0x2a30);
286 phy_write(phydev
, 0x14, 0x6600);
287 phy_write(phydev
, 0x1f, 0x0000);
288 phy_write(phydev
, 0x18, 0xa24e);
290 phy_write(phydev
, 0x1f, 0x2a30);
291 phy_modify(phydev
, 0x16, 0x0fc0, 0x0240);
292 phy_modify(phydev
, 0x14, 0x6000, 0x4000);
293 /* bits 14-15 in extended register 0x14 controls DACG amplitude
294 * 6 = -8%, 2 is hardware default
296 phy_write(phydev
, 0x1f, 0x0001);
297 phy_modify(phydev
, 0x14, 0xe000, 0x6000);
298 phy_write(phydev
, 0x1f, 0x0000);
301 vsc73xx_config_init(phydev
);
306 static int vsc739x_config_init(struct phy_device
*phydev
)
308 /* This magic sequence appears in the VSC7395 SparX-G5e application
309 * note "VSC7395/VSC7398 PHY Configuration"
311 * Maybe one day we will get to know what it all means.
313 phy_write(phydev
, 0x1f, 0x2a30);
314 phy_modify(phydev
, 0x08, 0x0200, 0x0200);
315 phy_write(phydev
, 0x1f, 0x52b5);
316 phy_write(phydev
, 0x10, 0xb68a);
317 phy_modify(phydev
, 0x12, 0xff07, 0x0003);
318 phy_modify(phydev
, 0x11, 0x00ff, 0x00a2);
319 phy_write(phydev
, 0x10, 0x968a);
320 phy_write(phydev
, 0x1f, 0x2a30);
321 phy_modify(phydev
, 0x08, 0x0200, 0x0000);
322 phy_write(phydev
, 0x1f, 0x0000);
324 phy_write(phydev
, 0x1f, 0x0000);
325 phy_write(phydev
, 0x12, 0x0048);
326 phy_write(phydev
, 0x1f, 0x2a30);
327 phy_modify(phydev
, 0x16, 0x0fc0, 0x0240);
328 phy_modify(phydev
, 0x14, 0x6000, 0x4000);
329 phy_write(phydev
, 0x1f, 0x0001);
330 phy_modify(phydev
, 0x14, 0xe000, 0x6000);
331 phy_write(phydev
, 0x1f, 0x0000);
333 vsc73xx_config_init(phydev
);
338 static int vsc73xx_mdix_set(struct phy_device
*phydev
, u8 mdix
)
343 val
= phy_read(phydev
, MII_VSC73XX_PHY_BYPASS_CTRL
);
347 val
|= MII_VSC73XX_PBC_FOR_SPD_AUTO_MDIX_DIS
|
348 MII_VSC73XX_PBC_PAIR_SWAP_DIS
|
349 MII_VSC73XX_PBC_POL_INV_DIS
;
352 /* When MDI-X auto configuration is disabled, is possible
353 * to force only MDI mode. Let's use autoconfig for forced
356 case ETH_TP_MDI_AUTO
:
357 val
&= ~(MII_VSC73XX_PBC_FOR_SPD_AUTO_MDIX_DIS
|
358 MII_VSC73XX_PBC_PAIR_SWAP_DIS
|
359 MII_VSC73XX_PBC_POL_INV_DIS
);
365 ret
= phy_write(phydev
, MII_VSC73XX_PHY_BYPASS_CTRL
, val
);
369 return genphy_restart_aneg(phydev
);
372 static int vsc73xx_config_aneg(struct phy_device
*phydev
)
376 ret
= vsc73xx_mdix_set(phydev
, phydev
->mdix_ctrl
);
380 return genphy_config_aneg(phydev
);
383 static int vsc73xx_mdix_get(struct phy_device
*phydev
, u8
*mdix
)
387 reg_val
= phy_read(phydev
, MII_VSC73XX_PHY_AUX_CTRL_STAT
);
388 if (reg_val
& MII_VSC73XX_PACS_NO_MDI_X_IND
)
391 *mdix
= ETH_TP_MDI_X
;
396 static int vsc73xx_read_status(struct phy_device
*phydev
)
400 ret
= vsc73xx_mdix_get(phydev
, &phydev
->mdix
);
404 return genphy_read_status(phydev
);
407 /* This adds a skew for both TX and RX clocks, so the skew should only be
408 * applied to "rgmii-id" interfaces. It may not work as expected
409 * on "rgmii-txid", "rgmii-rxid" or "rgmii" interfaces.
411 static int vsc8601_add_skew(struct phy_device
*phydev
)
415 ret
= phy_read(phydev
, MII_VSC8601_EPHY_CTL
);
419 ret
|= MII_VSC8601_EPHY_CTL_RGMII_SKEW
;
420 return phy_write(phydev
, MII_VSC8601_EPHY_CTL
, ret
);
423 static int vsc8601_config_init(struct phy_device
*phydev
)
427 if (phydev
->interface
== PHY_INTERFACE_MODE_RGMII_ID
)
428 ret
= vsc8601_add_skew(phydev
);
436 static int vsc82xx_config_intr(struct phy_device
*phydev
)
440 if (phydev
->interrupts
== PHY_INTERRUPT_ENABLED
)
441 /* Don't bother to ACK the interrupts since the 824x cannot
442 * clear the interrupts if they are disabled.
444 err
= phy_write(phydev
, MII_VSC8244_IMASK
,
445 (phydev
->drv
->phy_id
== PHY_ID_VSC8234
||
446 phydev
->drv
->phy_id
== PHY_ID_VSC8244
||
447 phydev
->drv
->phy_id
== PHY_ID_VSC8572
||
448 phydev
->drv
->phy_id
== PHY_ID_VSC8601
) ?
449 MII_VSC8244_IMASK_MASK
:
450 MII_VSC8221_IMASK_MASK
);
452 /* The Vitesse PHY cannot clear the interrupt
453 * once it has disabled them, so we clear them first
455 err
= phy_read(phydev
, MII_VSC8244_ISTAT
);
460 err
= phy_write(phydev
, MII_VSC8244_IMASK
, 0);
466 static irqreturn_t
vsc82xx_handle_interrupt(struct phy_device
*phydev
)
468 int irq_status
, irq_mask
;
470 if (phydev
->drv
->phy_id
== PHY_ID_VSC8244
||
471 phydev
->drv
->phy_id
== PHY_ID_VSC8572
||
472 phydev
->drv
->phy_id
== PHY_ID_VSC8601
)
473 irq_mask
= MII_VSC8244_ISTAT_MASK
;
475 irq_mask
= MII_VSC8221_ISTAT_MASK
;
477 irq_status
= phy_read(phydev
, MII_VSC8244_ISTAT
);
478 if (irq_status
< 0) {
483 if (!(irq_status
& irq_mask
))
486 phy_trigger_machine(phydev
);
491 static int vsc8221_config_init(struct phy_device
*phydev
)
495 err
= phy_write(phydev
, MII_VSC8244_AUX_CONSTAT
,
496 MII_VSC8221_AUXCONSTAT_INIT
);
499 /* Perhaps we should set EXT_CON1 based on the interface?
500 * Options are 802.3Z SerDes or SGMII
504 /* vsc82x4_config_autocross_enable - Enable auto MDI/MDI-X for forced links
505 * @phydev: target phy_device struct
507 * Enable auto MDI/MDI-X when in 10/100 forced link speeds by writing
508 * special values in the VSC8234/VSC8244 extended reserved registers
510 static int vsc82x4_config_autocross_enable(struct phy_device
*phydev
)
514 if (phydev
->autoneg
== AUTONEG_ENABLE
|| phydev
->speed
> SPEED_100
)
517 /* map extended registers set 0x10 - 0x1e */
518 ret
= phy_write(phydev
, MII_VSC82X4_EXT_PAGE_ACCESS
, 0x52b5);
520 ret
= phy_write(phydev
, MII_VSC82X4_EXT_PAGE_18E
, 0x0012);
522 ret
= phy_write(phydev
, MII_VSC82X4_EXT_PAGE_17E
, 0x2803);
524 ret
= phy_write(phydev
, MII_VSC82X4_EXT_PAGE_16E
, 0x87fa);
525 /* map standard registers set 0x10 - 0x1e */
527 ret
= phy_write(phydev
, MII_VSC82X4_EXT_PAGE_ACCESS
, 0x0000);
529 phy_write(phydev
, MII_VSC82X4_EXT_PAGE_ACCESS
, 0x0000);
534 /* vsc82x4_config_aneg - restart auto-negotiation or write BMCR
535 * @phydev: target phy_device struct
537 * Description: If auto-negotiation is enabled, we configure the
538 * advertising, and then restart auto-negotiation. If it is not
539 * enabled, then we write the BMCR and also start the auto
542 static int vsc82x4_config_aneg(struct phy_device
*phydev
)
546 /* Enable auto MDI/MDI-X when in 10/100 forced link speeds by
547 * writing special values in the VSC8234 extended reserved registers
549 if (phydev
->autoneg
!= AUTONEG_ENABLE
&& phydev
->speed
<= SPEED_100
) {
550 ret
= genphy_setup_forced(phydev
);
552 if (ret
< 0) /* error */
555 return vsc82x4_config_autocross_enable(phydev
);
558 return genphy_config_aneg(phydev
);
562 static struct phy_driver vsc82xx_driver
[] = {
564 .phy_id
= PHY_ID_VSC8234
,
565 .name
= "Vitesse VSC8234",
566 .phy_id_mask
= 0x000ffff0,
567 /* PHY_GBIT_FEATURES */
568 .config_init
= &vsc824x_config_init
,
569 .config_aneg
= &vsc82x4_config_aneg
,
570 .config_intr
= &vsc82xx_config_intr
,
571 .handle_interrupt
= &vsc82xx_handle_interrupt
,
573 .phy_id
= PHY_ID_VSC8244
,
574 .name
= "Vitesse VSC8244",
575 .phy_id_mask
= 0x000fffc0,
576 /* PHY_GBIT_FEATURES */
577 .config_init
= &vsc824x_config_init
,
578 .config_aneg
= &vsc82x4_config_aneg
,
579 .config_intr
= &vsc82xx_config_intr
,
580 .handle_interrupt
= &vsc82xx_handle_interrupt
,
582 .phy_id
= PHY_ID_VSC8572
,
583 .name
= "Vitesse VSC8572",
584 .phy_id_mask
= 0x000ffff0,
585 /* PHY_GBIT_FEATURES */
586 .config_init
= &vsc824x_config_init
,
587 .config_aneg
= &vsc82x4_config_aneg
,
588 .config_intr
= &vsc82xx_config_intr
,
589 .handle_interrupt
= &vsc82xx_handle_interrupt
,
591 .phy_id
= PHY_ID_VSC8601
,
592 .name
= "Vitesse VSC8601",
593 .phy_id_mask
= 0x000ffff0,
594 /* PHY_GBIT_FEATURES */
595 .config_init
= &vsc8601_config_init
,
596 .config_intr
= &vsc82xx_config_intr
,
597 .handle_interrupt
= &vsc82xx_handle_interrupt
,
599 .phy_id
= PHY_ID_VSC7385
,
600 .name
= "Vitesse VSC7385",
601 .phy_id_mask
= 0x000ffff0,
602 /* PHY_GBIT_FEATURES */
603 .config_init
= vsc738x_config_init
,
604 .config_aneg
= vsc73xx_config_aneg
,
605 .read_status
= vsc73xx_read_status
,
606 .read_page
= vsc73xx_read_page
,
607 .write_page
= vsc73xx_write_page
,
608 .get_tunable
= vsc73xx_get_tunable
,
609 .set_tunable
= vsc73xx_set_tunable
,
611 .phy_id
= PHY_ID_VSC7388
,
612 .name
= "Vitesse VSC7388",
613 .phy_id_mask
= 0x000ffff0,
614 /* PHY_GBIT_FEATURES */
615 .config_init
= vsc738x_config_init
,
616 .config_aneg
= vsc73xx_config_aneg
,
617 .read_status
= vsc73xx_read_status
,
618 .read_page
= vsc73xx_read_page
,
619 .write_page
= vsc73xx_write_page
,
620 .get_tunable
= vsc73xx_get_tunable
,
621 .set_tunable
= vsc73xx_set_tunable
,
623 .phy_id
= PHY_ID_VSC7395
,
624 .name
= "Vitesse VSC7395",
625 .phy_id_mask
= 0x000ffff0,
626 /* PHY_GBIT_FEATURES */
627 .config_init
= vsc739x_config_init
,
628 .config_aneg
= vsc73xx_config_aneg
,
629 .read_status
= vsc73xx_read_status
,
630 .read_page
= vsc73xx_read_page
,
631 .write_page
= vsc73xx_write_page
,
632 .get_tunable
= vsc73xx_get_tunable
,
633 .set_tunable
= vsc73xx_set_tunable
,
635 .phy_id
= PHY_ID_VSC7398
,
636 .name
= "Vitesse VSC7398",
637 .phy_id_mask
= 0x000ffff0,
638 /* PHY_GBIT_FEATURES */
639 .config_init
= vsc739x_config_init
,
640 .config_aneg
= vsc73xx_config_aneg
,
641 .read_status
= vsc73xx_read_status
,
642 .read_page
= vsc73xx_read_page
,
643 .write_page
= vsc73xx_write_page
,
644 .get_tunable
= vsc73xx_get_tunable
,
645 .set_tunable
= vsc73xx_set_tunable
,
647 .phy_id
= PHY_ID_VSC8662
,
648 .name
= "Vitesse VSC8662",
649 .phy_id_mask
= 0x000ffff0,
650 /* PHY_GBIT_FEATURES */
651 .config_init
= &vsc824x_config_init
,
652 .config_aneg
= &vsc82x4_config_aneg
,
653 .config_intr
= &vsc82xx_config_intr
,
654 .handle_interrupt
= &vsc82xx_handle_interrupt
,
657 .phy_id
= PHY_ID_VSC8221
,
658 .phy_id_mask
= 0x000ffff0,
659 .name
= "Vitesse VSC8221",
660 /* PHY_GBIT_FEATURES */
661 .config_init
= &vsc8221_config_init
,
662 .config_intr
= &vsc82xx_config_intr
,
663 .handle_interrupt
= &vsc82xx_handle_interrupt
,
666 .phy_id
= PHY_ID_VSC8211
,
667 .phy_id_mask
= 0x000ffff0,
668 .name
= "Vitesse VSC8211",
669 /* PHY_GBIT_FEATURES */
670 .config_init
= &vsc8221_config_init
,
671 .config_intr
= &vsc82xx_config_intr
,
672 .handle_interrupt
= &vsc82xx_handle_interrupt
,
675 module_phy_driver(vsc82xx_driver
);
677 static struct mdio_device_id __maybe_unused vitesse_tbl
[] = {
678 { PHY_ID_VSC8234
, 0x000ffff0 },
679 { PHY_ID_VSC8244
, 0x000fffc0 },
680 { PHY_ID_VSC8572
, 0x000ffff0 },
681 { PHY_ID_VSC7385
, 0x000ffff0 },
682 { PHY_ID_VSC7388
, 0x000ffff0 },
683 { PHY_ID_VSC7395
, 0x000ffff0 },
684 { PHY_ID_VSC7398
, 0x000ffff0 },
685 { PHY_ID_VSC8662
, 0x000ffff0 },
686 { PHY_ID_VSC8221
, 0x000ffff0 },
687 { PHY_ID_VSC8211
, 0x000ffff0 },
691 MODULE_DEVICE_TABLE(mdio
, vitesse_tbl
);