2 * Driver for Microsemi VSC85xx PHYs
4 * Author: Nagaraju Lakkaraju
5 * License: Dual MIT/GPL
6 * Copyright (c) 2016 Microsemi Corporation
9 #include <linux/kernel.h>
10 #include <linux/module.h>
11 #include <linux/mdio.h>
12 #include <linux/mii.h>
13 #include <linux/phy.h>
15 #include <linux/netdevice.h>
16 #include <dt-bindings/net/mscc-phy-vsc8531.h>
18 enum rgmii_rx_clock_delay {
19 RGMII_RX_CLK_DELAY_0_2_NS = 0,
20 RGMII_RX_CLK_DELAY_0_8_NS = 1,
21 RGMII_RX_CLK_DELAY_1_1_NS = 2,
22 RGMII_RX_CLK_DELAY_1_7_NS = 3,
23 RGMII_RX_CLK_DELAY_2_0_NS = 4,
24 RGMII_RX_CLK_DELAY_2_3_NS = 5,
25 RGMII_RX_CLK_DELAY_2_6_NS = 6,
26 RGMII_RX_CLK_DELAY_3_4_NS = 7
29 /* Microsemi VSC85xx PHY registers */
30 /* IEEE 802. Std Registers */
31 #define MSCC_PHY_BYPASS_CONTROL 18
32 #define DISABLE_HP_AUTO_MDIX_MASK 0x0080
33 #define DISABLE_PAIR_SWAP_CORR_MASK 0x0020
34 #define DISABLE_POLARITY_CORR_MASK 0x0010
36 #define MSCC_PHY_EXT_PHY_CNTL_1 23
37 #define MAC_IF_SELECTION_MASK 0x1800
38 #define MAC_IF_SELECTION_GMII 0
39 #define MAC_IF_SELECTION_RMII 1
40 #define MAC_IF_SELECTION_RGMII 2
41 #define MAC_IF_SELECTION_POS 11
42 #define FAR_END_LOOPBACK_MODE_MASK 0x0008
44 #define MII_VSC85XX_INT_MASK 25
45 #define MII_VSC85XX_INT_MASK_MASK 0xa000
46 #define MII_VSC85XX_INT_MASK_WOL 0x0040
47 #define MII_VSC85XX_INT_STATUS 26
49 #define MSCC_PHY_WOL_MAC_CONTROL 27
50 #define EDGE_RATE_CNTL_POS 5
51 #define EDGE_RATE_CNTL_MASK 0x00E0
53 #define MSCC_PHY_DEV_AUX_CNTL 28
54 #define HP_AUTO_MDIX_X_OVER_IND_MASK 0x2000
56 #define MSCC_PHY_LED_MODE_SEL 29
57 #define LED_MODE_SEL_POS(x) ((x) * 4)
58 #define LED_MODE_SEL_MASK(x) (GENMASK(3, 0) << LED_MODE_SEL_POS(x))
59 #define LED_MODE_SEL(x, mode) (((mode) << LED_MODE_SEL_POS(x)) & LED_MODE_SEL_MASK(x))
61 #define MSCC_EXT_PAGE_ACCESS 31
62 #define MSCC_PHY_PAGE_STANDARD 0x0000 /* Standard registers */
63 #define MSCC_PHY_PAGE_EXTENDED 0x0001 /* Extended registers */
64 #define MSCC_PHY_PAGE_EXTENDED_2 0x0002 /* Extended reg - page 2 */
66 /* Extended Page 1 Registers */
67 #define MSCC_PHY_EXT_MODE_CNTL 19
68 #define FORCE_MDI_CROSSOVER_MASK 0x000C
69 #define FORCE_MDI_CROSSOVER_MDIX 0x000C
70 #define FORCE_MDI_CROSSOVER_MDI 0x0008
72 #define MSCC_PHY_ACTIPHY_CNTL 20
73 #define DOWNSHIFT_CNTL_MASK 0x001C
74 #define DOWNSHIFT_EN 0x0010
75 #define DOWNSHIFT_CNTL_POS 2
77 /* Extended Page 2 Registers */
78 #define MSCC_PHY_RGMII_CNTL 20
79 #define RGMII_RX_CLK_DELAY_MASK 0x0070
80 #define RGMII_RX_CLK_DELAY_POS 4
82 #define MSCC_PHY_WOL_LOWER_MAC_ADDR 21
83 #define MSCC_PHY_WOL_MID_MAC_ADDR 22
84 #define MSCC_PHY_WOL_UPPER_MAC_ADDR 23
85 #define MSCC_PHY_WOL_LOWER_PASSWD 24
86 #define MSCC_PHY_WOL_MID_PASSWD 25
87 #define MSCC_PHY_WOL_UPPER_PASSWD 26
89 #define MSCC_PHY_WOL_MAC_CONTROL 27
90 #define SECURE_ON_ENABLE 0x8000
91 #define SECURE_ON_PASSWD_LEN_4 0x4000
93 /* Microsemi PHY ID's */
94 #define PHY_ID_VSC8530 0x00070560
95 #define PHY_ID_VSC8531 0x00070570
96 #define PHY_ID_VSC8540 0x00070760
97 #define PHY_ID_VSC8541 0x00070770
99 #define MSCC_VDDMAC_1500 1500
100 #define MSCC_VDDMAC_1800 1800
101 #define MSCC_VDDMAC_2500 2500
102 #define MSCC_VDDMAC_3300 3300
104 #define DOWNSHIFT_COUNT_MAX 5
107 #define VSC85XX_SUPP_LED_MODES (BIT(VSC8531_LINK_ACTIVITY) | \
108 BIT(VSC8531_LINK_1000_ACTIVITY) | \
109 BIT(VSC8531_LINK_100_ACTIVITY) | \
110 BIT(VSC8531_LINK_10_ACTIVITY) | \
111 BIT(VSC8531_LINK_100_1000_ACTIVITY) | \
112 BIT(VSC8531_LINK_10_1000_ACTIVITY) | \
113 BIT(VSC8531_LINK_10_100_ACTIVITY) | \
114 BIT(VSC8531_DUPLEX_COLLISION) | \
115 BIT(VSC8531_COLLISION) | \
116 BIT(VSC8531_ACTIVITY) | \
117 BIT(VSC8531_AUTONEG_FAULT) | \
118 BIT(VSC8531_SERIAL_MODE) | \
119 BIT(VSC8531_FORCE_LED_OFF) | \
120 BIT(VSC8531_FORCE_LED_ON))
122 struct vsc8531_private {
125 u32 leds_mode[MAX_LEDS];
129 #ifdef CONFIG_OF_MDIO
130 struct vsc8531_edge_rate_table {
135 static const struct vsc8531_edge_rate_table edge_table[] = {
136 {MSCC_VDDMAC_3300, { 0, 2, 4, 7, 10, 17, 29, 53} },
137 {MSCC_VDDMAC_2500, { 0, 3, 6, 10, 14, 23, 37, 63} },
138 {MSCC_VDDMAC_1800, { 0, 5, 9, 16, 23, 35, 52, 76} },
139 {MSCC_VDDMAC_1500, { 0, 6, 14, 21, 29, 42, 58, 77} },
141 #endif /* CONFIG_OF_MDIO */
143 static int vsc85xx_phy_page_set(struct phy_device *phydev, u16 page)
147 rc = phy_write(phydev, MSCC_EXT_PAGE_ACCESS, page);
151 static int vsc85xx_led_cntl_set(struct phy_device *phydev,
158 mutex_lock(&phydev->lock);
159 reg_val = phy_read(phydev, MSCC_PHY_LED_MODE_SEL);
160 reg_val &= ~LED_MODE_SEL_MASK(led_num);
161 reg_val |= LED_MODE_SEL(led_num, (u16)mode);
162 rc = phy_write(phydev, MSCC_PHY_LED_MODE_SEL, reg_val);
163 mutex_unlock(&phydev->lock);
168 static int vsc85xx_mdix_get(struct phy_device *phydev, u8 *mdix)
172 reg_val = phy_read(phydev, MSCC_PHY_DEV_AUX_CNTL);
173 if (reg_val & HP_AUTO_MDIX_X_OVER_IND_MASK)
174 *mdix = ETH_TP_MDI_X;
181 static int vsc85xx_mdix_set(struct phy_device *phydev, u8 mdix)
186 reg_val = phy_read(phydev, MSCC_PHY_BYPASS_CONTROL);
187 if ((mdix == ETH_TP_MDI) || (mdix == ETH_TP_MDI_X)) {
188 reg_val |= (DISABLE_PAIR_SWAP_CORR_MASK |
189 DISABLE_POLARITY_CORR_MASK |
190 DISABLE_HP_AUTO_MDIX_MASK);
192 reg_val &= ~(DISABLE_PAIR_SWAP_CORR_MASK |
193 DISABLE_POLARITY_CORR_MASK |
194 DISABLE_HP_AUTO_MDIX_MASK);
196 rc = phy_write(phydev, MSCC_PHY_BYPASS_CONTROL, reg_val);
200 rc = vsc85xx_phy_page_set(phydev, MSCC_PHY_PAGE_EXTENDED);
204 reg_val = phy_read(phydev, MSCC_PHY_EXT_MODE_CNTL);
205 reg_val &= ~(FORCE_MDI_CROSSOVER_MASK);
206 if (mdix == ETH_TP_MDI)
207 reg_val |= FORCE_MDI_CROSSOVER_MDI;
208 else if (mdix == ETH_TP_MDI_X)
209 reg_val |= FORCE_MDI_CROSSOVER_MDIX;
210 rc = phy_write(phydev, MSCC_PHY_EXT_MODE_CNTL, reg_val);
214 rc = vsc85xx_phy_page_set(phydev, MSCC_PHY_PAGE_STANDARD);
218 return genphy_restart_aneg(phydev);
221 static int vsc85xx_downshift_get(struct phy_device *phydev, u8 *count)
226 rc = vsc85xx_phy_page_set(phydev, MSCC_PHY_PAGE_EXTENDED);
230 reg_val = phy_read(phydev, MSCC_PHY_ACTIPHY_CNTL);
231 reg_val &= DOWNSHIFT_CNTL_MASK;
232 if (!(reg_val & DOWNSHIFT_EN))
233 *count = DOWNSHIFT_DEV_DISABLE;
235 *count = ((reg_val & ~DOWNSHIFT_EN) >> DOWNSHIFT_CNTL_POS) + 2;
236 rc = vsc85xx_phy_page_set(phydev, MSCC_PHY_PAGE_STANDARD);
242 static int vsc85xx_downshift_set(struct phy_device *phydev, u8 count)
247 if (count == DOWNSHIFT_DEV_DEFAULT_COUNT) {
248 /* Default downshift count 3 (i.e. Bit3:2 = 0b01) */
249 count = ((1 << DOWNSHIFT_CNTL_POS) | DOWNSHIFT_EN);
250 } else if (count > DOWNSHIFT_COUNT_MAX || count == 1) {
251 phydev_err(phydev, "Downshift count should be 2,3,4 or 5\n");
254 /* Downshift count is either 2,3,4 or 5 */
255 count = (((count - 2) << DOWNSHIFT_CNTL_POS) | DOWNSHIFT_EN);
258 rc = vsc85xx_phy_page_set(phydev, MSCC_PHY_PAGE_EXTENDED);
262 reg_val = phy_read(phydev, MSCC_PHY_ACTIPHY_CNTL);
263 reg_val &= ~(DOWNSHIFT_CNTL_MASK);
265 rc = phy_write(phydev, MSCC_PHY_ACTIPHY_CNTL, reg_val);
269 rc = vsc85xx_phy_page_set(phydev, MSCC_PHY_PAGE_STANDARD);
275 static int vsc85xx_wol_set(struct phy_device *phydev,
276 struct ethtool_wolinfo *wol)
281 u16 pwd[3] = {0, 0, 0};
282 struct ethtool_wolinfo *wol_conf = wol;
283 u8 *mac_addr = phydev->attached_dev->dev_addr;
285 mutex_lock(&phydev->lock);
286 rc = vsc85xx_phy_page_set(phydev, MSCC_PHY_PAGE_EXTENDED_2);
290 if (wol->wolopts & WAKE_MAGIC) {
291 /* Store the device address for the magic packet */
292 for (i = 0; i < ARRAY_SIZE(pwd); i++)
293 pwd[i] = mac_addr[5 - (i * 2 + 1)] << 8 |
295 phy_write(phydev, MSCC_PHY_WOL_LOWER_MAC_ADDR, pwd[0]);
296 phy_write(phydev, MSCC_PHY_WOL_MID_MAC_ADDR, pwd[1]);
297 phy_write(phydev, MSCC_PHY_WOL_UPPER_MAC_ADDR, pwd[2]);
299 phy_write(phydev, MSCC_PHY_WOL_LOWER_MAC_ADDR, 0);
300 phy_write(phydev, MSCC_PHY_WOL_MID_MAC_ADDR, 0);
301 phy_write(phydev, MSCC_PHY_WOL_UPPER_MAC_ADDR, 0);
304 if (wol_conf->wolopts & WAKE_MAGICSECURE) {
305 for (i = 0; i < ARRAY_SIZE(pwd); i++)
306 pwd[i] = wol_conf->sopass[5 - (i * 2 + 1)] << 8 |
307 wol_conf->sopass[5 - i * 2];
308 phy_write(phydev, MSCC_PHY_WOL_LOWER_PASSWD, pwd[0]);
309 phy_write(phydev, MSCC_PHY_WOL_MID_PASSWD, pwd[1]);
310 phy_write(phydev, MSCC_PHY_WOL_UPPER_PASSWD, pwd[2]);
312 phy_write(phydev, MSCC_PHY_WOL_LOWER_PASSWD, 0);
313 phy_write(phydev, MSCC_PHY_WOL_MID_PASSWD, 0);
314 phy_write(phydev, MSCC_PHY_WOL_UPPER_PASSWD, 0);
317 reg_val = phy_read(phydev, MSCC_PHY_WOL_MAC_CONTROL);
318 if (wol_conf->wolopts & WAKE_MAGICSECURE)
319 reg_val |= SECURE_ON_ENABLE;
321 reg_val &= ~SECURE_ON_ENABLE;
322 phy_write(phydev, MSCC_PHY_WOL_MAC_CONTROL, reg_val);
324 rc = vsc85xx_phy_page_set(phydev, MSCC_PHY_PAGE_STANDARD);
328 if (wol->wolopts & WAKE_MAGIC) {
329 /* Enable the WOL interrupt */
330 reg_val = phy_read(phydev, MII_VSC85XX_INT_MASK);
331 reg_val |= MII_VSC85XX_INT_MASK_WOL;
332 rc = phy_write(phydev, MII_VSC85XX_INT_MASK, reg_val);
336 /* Disable the WOL interrupt */
337 reg_val = phy_read(phydev, MII_VSC85XX_INT_MASK);
338 reg_val &= (~MII_VSC85XX_INT_MASK_WOL);
339 rc = phy_write(phydev, MII_VSC85XX_INT_MASK, reg_val);
343 /* Clear WOL iterrupt status */
344 reg_val = phy_read(phydev, MII_VSC85XX_INT_STATUS);
347 mutex_unlock(&phydev->lock);
352 static void vsc85xx_wol_get(struct phy_device *phydev,
353 struct ethtool_wolinfo *wol)
358 u16 pwd[3] = {0, 0, 0};
359 struct ethtool_wolinfo *wol_conf = wol;
361 mutex_lock(&phydev->lock);
362 rc = vsc85xx_phy_page_set(phydev, MSCC_PHY_PAGE_EXTENDED_2);
366 reg_val = phy_read(phydev, MSCC_PHY_WOL_MAC_CONTROL);
367 if (reg_val & SECURE_ON_ENABLE)
368 wol_conf->wolopts |= WAKE_MAGICSECURE;
369 if (wol_conf->wolopts & WAKE_MAGICSECURE) {
370 pwd[0] = phy_read(phydev, MSCC_PHY_WOL_LOWER_PASSWD);
371 pwd[1] = phy_read(phydev, MSCC_PHY_WOL_MID_PASSWD);
372 pwd[2] = phy_read(phydev, MSCC_PHY_WOL_UPPER_PASSWD);
373 for (i = 0; i < ARRAY_SIZE(pwd); i++) {
374 wol_conf->sopass[5 - i * 2] = pwd[i] & 0x00ff;
375 wol_conf->sopass[5 - (i * 2 + 1)] = (pwd[i] & 0xff00)
380 rc = vsc85xx_phy_page_set(phydev, MSCC_PHY_PAGE_STANDARD);
383 mutex_unlock(&phydev->lock);
386 #ifdef CONFIG_OF_MDIO
387 static int vsc85xx_edge_rate_magic_get(struct phy_device *phydev)
391 struct device *dev = &phydev->mdio.dev;
392 struct device_node *of_node = dev->of_node;
393 u8 sd_array_size = ARRAY_SIZE(edge_table[0].slowdown);
398 rc = of_property_read_u32(of_node, "vsc8531,vddmac", &vdd);
400 vdd = MSCC_VDDMAC_3300;
402 rc = of_property_read_u32(of_node, "vsc8531,edge-slowdown", &sd);
406 for (i = 0; i < ARRAY_SIZE(edge_table); i++)
407 if (edge_table[i].vddmac == vdd)
408 for (j = 0; j < sd_array_size; j++)
409 if (edge_table[i].slowdown[j] == sd)
410 return (sd_array_size - j - 1);
415 static int vsc85xx_dt_led_mode_get(struct phy_device *phydev,
419 struct vsc8531_private *priv = phydev->priv;
420 struct device *dev = &phydev->mdio.dev;
421 struct device_node *of_node = dev->of_node;
428 led_mode = default_mode;
429 err = of_property_read_u32(of_node, led, &led_mode);
430 if (!err && !(BIT(led_mode) & priv->supp_led_modes)) {
431 phydev_err(phydev, "DT %s invalid\n", led);
439 static int vsc85xx_edge_rate_magic_get(struct phy_device *phydev)
444 static int vsc85xx_dt_led_mode_get(struct phy_device *phydev,
450 #endif /* CONFIG_OF_MDIO */
452 static int vsc85xx_dt_led_modes_get(struct phy_device *phydev,
455 struct vsc8531_private *priv = phydev->priv;
456 char led_dt_prop[28];
459 for (i = 0; i < priv->nleds; i++) {
460 ret = sprintf(led_dt_prop, "vsc8531,led-%d-mode", i);
464 ret = vsc85xx_dt_led_mode_get(phydev, led_dt_prop,
468 priv->leds_mode[i] = ret;
474 static int vsc85xx_edge_rate_cntl_set(struct phy_device *phydev, u8 edge_rate)
479 mutex_lock(&phydev->lock);
480 rc = vsc85xx_phy_page_set(phydev, MSCC_PHY_PAGE_EXTENDED_2);
483 reg_val = phy_read(phydev, MSCC_PHY_WOL_MAC_CONTROL);
484 reg_val &= ~(EDGE_RATE_CNTL_MASK);
485 reg_val |= (edge_rate << EDGE_RATE_CNTL_POS);
486 rc = phy_write(phydev, MSCC_PHY_WOL_MAC_CONTROL, reg_val);
489 rc = vsc85xx_phy_page_set(phydev, MSCC_PHY_PAGE_STANDARD);
492 mutex_unlock(&phydev->lock);
497 static int vsc85xx_mac_if_set(struct phy_device *phydev,
498 phy_interface_t interface)
503 mutex_lock(&phydev->lock);
504 reg_val = phy_read(phydev, MSCC_PHY_EXT_PHY_CNTL_1);
505 reg_val &= ~(MAC_IF_SELECTION_MASK);
507 case PHY_INTERFACE_MODE_RGMII:
508 reg_val |= (MAC_IF_SELECTION_RGMII << MAC_IF_SELECTION_POS);
510 case PHY_INTERFACE_MODE_RMII:
511 reg_val |= (MAC_IF_SELECTION_RMII << MAC_IF_SELECTION_POS);
513 case PHY_INTERFACE_MODE_MII:
514 case PHY_INTERFACE_MODE_GMII:
515 reg_val |= (MAC_IF_SELECTION_GMII << MAC_IF_SELECTION_POS);
521 rc = phy_write(phydev, MSCC_PHY_EXT_PHY_CNTL_1, reg_val);
525 rc = genphy_soft_reset(phydev);
528 mutex_unlock(&phydev->lock);
533 static int vsc85xx_default_config(struct phy_device *phydev)
538 phydev->mdix_ctrl = ETH_TP_MDI_AUTO;
539 mutex_lock(&phydev->lock);
540 rc = vsc85xx_phy_page_set(phydev, MSCC_PHY_PAGE_EXTENDED_2);
544 reg_val = phy_read(phydev, MSCC_PHY_RGMII_CNTL);
545 reg_val &= ~(RGMII_RX_CLK_DELAY_MASK);
546 reg_val |= (RGMII_RX_CLK_DELAY_1_1_NS << RGMII_RX_CLK_DELAY_POS);
547 phy_write(phydev, MSCC_PHY_RGMII_CNTL, reg_val);
548 rc = vsc85xx_phy_page_set(phydev, MSCC_PHY_PAGE_STANDARD);
551 mutex_unlock(&phydev->lock);
556 static int vsc85xx_get_tunable(struct phy_device *phydev,
557 struct ethtool_tunable *tuna, void *data)
560 case ETHTOOL_PHY_DOWNSHIFT:
561 return vsc85xx_downshift_get(phydev, (u8 *)data);
567 static int vsc85xx_set_tunable(struct phy_device *phydev,
568 struct ethtool_tunable *tuna,
572 case ETHTOOL_PHY_DOWNSHIFT:
573 return vsc85xx_downshift_set(phydev, *(u8 *)data);
579 static int vsc85xx_config_init(struct phy_device *phydev)
582 struct vsc8531_private *vsc8531 = phydev->priv;
584 rc = vsc85xx_default_config(phydev);
588 rc = vsc85xx_mac_if_set(phydev, phydev->interface);
592 rc = vsc85xx_edge_rate_cntl_set(phydev, vsc8531->rate_magic);
596 for (i = 0; i < vsc8531->nleds; i++) {
597 rc = vsc85xx_led_cntl_set(phydev, i, vsc8531->leds_mode[i]);
602 rc = genphy_config_init(phydev);
607 static int vsc85xx_ack_interrupt(struct phy_device *phydev)
611 if (phydev->interrupts == PHY_INTERRUPT_ENABLED)
612 rc = phy_read(phydev, MII_VSC85XX_INT_STATUS);
614 return (rc < 0) ? rc : 0;
617 static int vsc85xx_config_intr(struct phy_device *phydev)
621 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) {
622 rc = phy_write(phydev, MII_VSC85XX_INT_MASK,
623 MII_VSC85XX_INT_MASK_MASK);
625 rc = phy_write(phydev, MII_VSC85XX_INT_MASK, 0);
628 rc = phy_read(phydev, MII_VSC85XX_INT_STATUS);
634 static int vsc85xx_config_aneg(struct phy_device *phydev)
638 rc = vsc85xx_mdix_set(phydev, phydev->mdix_ctrl);
642 return genphy_config_aneg(phydev);
645 static int vsc85xx_read_status(struct phy_device *phydev)
649 rc = vsc85xx_mdix_get(phydev, &phydev->mdix);
653 return genphy_read_status(phydev);
656 static int vsc85xx_probe(struct phy_device *phydev)
658 struct vsc8531_private *vsc8531;
660 u32 default_mode[2] = {VSC8531_LINK_1000_ACTIVITY,
661 VSC8531_LINK_100_ACTIVITY};
663 rate_magic = vsc85xx_edge_rate_magic_get(phydev);
667 vsc8531 = devm_kzalloc(&phydev->mdio.dev, sizeof(*vsc8531), GFP_KERNEL);
671 phydev->priv = vsc8531;
673 vsc8531->rate_magic = rate_magic;
675 vsc8531->supp_led_modes = VSC85XX_SUPP_LED_MODES;
677 return vsc85xx_dt_led_modes_get(phydev, default_mode);
680 /* Microsemi VSC85xx PHYs */
681 static struct phy_driver vsc85xx_driver[] = {
683 .phy_id = PHY_ID_VSC8530,
684 .name = "Microsemi FE VSC8530",
685 .phy_id_mask = 0xfffffff0,
686 .features = PHY_BASIC_FEATURES,
687 .flags = PHY_HAS_INTERRUPT,
688 .soft_reset = &genphy_soft_reset,
689 .config_init = &vsc85xx_config_init,
690 .config_aneg = &vsc85xx_config_aneg,
691 .aneg_done = &genphy_aneg_done,
692 .read_status = &vsc85xx_read_status,
693 .ack_interrupt = &vsc85xx_ack_interrupt,
694 .config_intr = &vsc85xx_config_intr,
695 .suspend = &genphy_suspend,
696 .resume = &genphy_resume,
697 .probe = &vsc85xx_probe,
698 .set_wol = &vsc85xx_wol_set,
699 .get_wol = &vsc85xx_wol_get,
700 .get_tunable = &vsc85xx_get_tunable,
701 .set_tunable = &vsc85xx_set_tunable,
704 .phy_id = PHY_ID_VSC8531,
705 .name = "Microsemi VSC8531",
706 .phy_id_mask = 0xfffffff0,
707 .features = PHY_GBIT_FEATURES,
708 .flags = PHY_HAS_INTERRUPT,
709 .soft_reset = &genphy_soft_reset,
710 .config_init = &vsc85xx_config_init,
711 .config_aneg = &vsc85xx_config_aneg,
712 .aneg_done = &genphy_aneg_done,
713 .read_status = &vsc85xx_read_status,
714 .ack_interrupt = &vsc85xx_ack_interrupt,
715 .config_intr = &vsc85xx_config_intr,
716 .suspend = &genphy_suspend,
717 .resume = &genphy_resume,
718 .probe = &vsc85xx_probe,
719 .set_wol = &vsc85xx_wol_set,
720 .get_wol = &vsc85xx_wol_get,
721 .get_tunable = &vsc85xx_get_tunable,
722 .set_tunable = &vsc85xx_set_tunable,
725 .phy_id = PHY_ID_VSC8540,
726 .name = "Microsemi FE VSC8540 SyncE",
727 .phy_id_mask = 0xfffffff0,
728 .features = PHY_BASIC_FEATURES,
729 .flags = PHY_HAS_INTERRUPT,
730 .soft_reset = &genphy_soft_reset,
731 .config_init = &vsc85xx_config_init,
732 .config_aneg = &vsc85xx_config_aneg,
733 .aneg_done = &genphy_aneg_done,
734 .read_status = &vsc85xx_read_status,
735 .ack_interrupt = &vsc85xx_ack_interrupt,
736 .config_intr = &vsc85xx_config_intr,
737 .suspend = &genphy_suspend,
738 .resume = &genphy_resume,
739 .probe = &vsc85xx_probe,
740 .set_wol = &vsc85xx_wol_set,
741 .get_wol = &vsc85xx_wol_get,
742 .get_tunable = &vsc85xx_get_tunable,
743 .set_tunable = &vsc85xx_set_tunable,
746 .phy_id = PHY_ID_VSC8541,
747 .name = "Microsemi VSC8541 SyncE",
748 .phy_id_mask = 0xfffffff0,
749 .features = PHY_GBIT_FEATURES,
750 .flags = PHY_HAS_INTERRUPT,
751 .soft_reset = &genphy_soft_reset,
752 .config_init = &vsc85xx_config_init,
753 .config_aneg = &vsc85xx_config_aneg,
754 .aneg_done = &genphy_aneg_done,
755 .read_status = &vsc85xx_read_status,
756 .ack_interrupt = &vsc85xx_ack_interrupt,
757 .config_intr = &vsc85xx_config_intr,
758 .suspend = &genphy_suspend,
759 .resume = &genphy_resume,
760 .probe = &vsc85xx_probe,
761 .set_wol = &vsc85xx_wol_set,
762 .get_wol = &vsc85xx_wol_get,
763 .get_tunable = &vsc85xx_get_tunable,
764 .set_tunable = &vsc85xx_set_tunable,
769 module_phy_driver(vsc85xx_driver);
771 static struct mdio_device_id __maybe_unused vsc85xx_tbl[] = {
772 { PHY_ID_VSC8530, 0xfffffff0, },
773 { PHY_ID_VSC8531, 0xfffffff0, },
774 { PHY_ID_VSC8540, 0xfffffff0, },
775 { PHY_ID_VSC8541, 0xfffffff0, },
779 MODULE_DEVICE_TABLE(mdio, vsc85xx_tbl);
781 MODULE_DESCRIPTION("Microsemi VSC85xx PHY driver");
782 MODULE_AUTHOR("Nagaraju Lakkaraju");
783 MODULE_LICENSE("Dual MIT/GPL");