blob: 113616b92abbbdf551c1d738605210ba80bb8022 [file] [log] [blame]
Raju Lakkarajud50736a2016-08-05 17:54:21 +05301/*
2 * Driver for Microsemi VSC85xx PHYs
3 *
4 * Author: Nagaraju Lakkaraju
5 * License: Dual MIT/GPL
6 * Copyright (c) 2016 Microsemi Corporation
7 */
8
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>
Raju Lakkarajua4cc96d2016-10-03 12:53:13 +053014#include <linux/of.h>
Raju Lakkaraju0a55c122016-10-05 14:19:27 +053015#include <linux/netdevice.h>
Raju Lakkarajud50736a2016-08-05 17:54:21 +053016
17enum rgmii_rx_clock_delay {
Raju Lakkaraju4ffd03f2016-09-08 14:09:31 +053018 RGMII_RX_CLK_DELAY_0_2_NS = 0,
19 RGMII_RX_CLK_DELAY_0_8_NS = 1,
20 RGMII_RX_CLK_DELAY_1_1_NS = 2,
21 RGMII_RX_CLK_DELAY_1_7_NS = 3,
22 RGMII_RX_CLK_DELAY_2_0_NS = 4,
23 RGMII_RX_CLK_DELAY_2_3_NS = 5,
24 RGMII_RX_CLK_DELAY_2_6_NS = 6,
25 RGMII_RX_CLK_DELAY_3_4_NS = 7
Raju Lakkarajud50736a2016-08-05 17:54:21 +053026};
27
Raju Lakkaraju1a211012016-09-19 15:33:54 +053028/* Microsemi VSC85xx PHY registers */
29/* IEEE 802. Std Registers */
30#define MSCC_PHY_EXT_PHY_CNTL_1 23
31#define MAC_IF_SELECTION_MASK 0x1800
32#define MAC_IF_SELECTION_GMII 0
33#define MAC_IF_SELECTION_RMII 1
34#define MAC_IF_SELECTION_RGMII 2
35#define MAC_IF_SELECTION_POS 11
36#define FAR_END_LOOPBACK_MODE_MASK 0x0008
37
Raju Lakkaraju4ffd03f2016-09-08 14:09:31 +053038#define MII_VSC85XX_INT_MASK 25
39#define MII_VSC85XX_INT_MASK_MASK 0xa000
Raju Lakkaraju0a55c122016-10-05 14:19:27 +053040#define MII_VSC85XX_INT_MASK_WOL 0x0040
Raju Lakkaraju4ffd03f2016-09-08 14:09:31 +053041#define MII_VSC85XX_INT_STATUS 26
Raju Lakkarajud50736a2016-08-05 17:54:21 +053042
Raju Lakkarajua4cc96d2016-10-03 12:53:13 +053043#define MSCC_PHY_WOL_MAC_CONTROL 27
44#define EDGE_RATE_CNTL_POS 5
45#define EDGE_RATE_CNTL_MASK 0x00E0
46
Raju Lakkaraju4ffd03f2016-09-08 14:09:31 +053047#define MSCC_EXT_PAGE_ACCESS 31
48#define MSCC_PHY_PAGE_STANDARD 0x0000 /* Standard registers */
49#define MSCC_PHY_PAGE_EXTENDED_2 0x0002 /* Extended reg - page 2 */
Raju Lakkarajud50736a2016-08-05 17:54:21 +053050
51/* Extended Page 2 Registers */
Raju Lakkaraju4ffd03f2016-09-08 14:09:31 +053052#define MSCC_PHY_RGMII_CNTL 20
53#define RGMII_RX_CLK_DELAY_MASK 0x0070
54#define RGMII_RX_CLK_DELAY_POS 4
Raju Lakkarajud50736a2016-08-05 17:54:21 +053055
Raju Lakkaraju0a55c122016-10-05 14:19:27 +053056#define MSCC_PHY_WOL_LOWER_MAC_ADDR 21
57#define MSCC_PHY_WOL_MID_MAC_ADDR 22
58#define MSCC_PHY_WOL_UPPER_MAC_ADDR 23
59#define MSCC_PHY_WOL_LOWER_PASSWD 24
60#define MSCC_PHY_WOL_MID_PASSWD 25
61#define MSCC_PHY_WOL_UPPER_PASSWD 26
62
63#define MSCC_PHY_WOL_MAC_CONTROL 27
64#define SECURE_ON_ENABLE 0x8000
65#define SECURE_ON_PASSWD_LEN_4 0x4000
66
Raju Lakkarajud50736a2016-08-05 17:54:21 +053067/* Microsemi PHY ID's */
Raju Lakkaraju4ffd03f2016-09-08 14:09:31 +053068#define PHY_ID_VSC8531 0x00070570
69#define PHY_ID_VSC8541 0x00070770
Raju Lakkarajud50736a2016-08-05 17:54:21 +053070
Allan W. Nielsen4f58e6d2016-10-12 15:47:51 +020071#define MSCC_VDDMAC_1500 1500
72#define MSCC_VDDMAC_1800 1800
73#define MSCC_VDDMAC_2500 2500
74#define MSCC_VDDMAC_3300 3300
Raju Lakkarajua4cc96d2016-10-03 12:53:13 +053075
76struct vsc8531_private {
Allan W. Nielsen4f58e6d2016-10-12 15:47:51 +020077 int rate_magic;
Raju Lakkarajua4cc96d2016-10-03 12:53:13 +053078};
79
Allan W. Nielsen4f58e6d2016-10-12 15:47:51 +020080#ifdef CONFIG_OF_MDIO
81struct vsc8531_edge_rate_table {
82 u16 vddmac;
83 u8 slowdown[8];
84};
85
86static const struct vsc8531_edge_rate_table edge_table[] = {
87 {MSCC_VDDMAC_3300, { 0, 2, 4, 7, 10, 17, 29, 53} },
88 {MSCC_VDDMAC_2500, { 0, 3, 6, 10, 14, 23, 37, 63} },
89 {MSCC_VDDMAC_1800, { 0, 5, 9, 16, 23, 35, 52, 76} },
90 {MSCC_VDDMAC_1500, { 0, 6, 14, 21, 29, 42, 58, 77} },
91};
92#endif /* CONFIG_OF_MDIO */
93
Raju Lakkarajud50736a2016-08-05 17:54:21 +053094static int vsc85xx_phy_page_set(struct phy_device *phydev, u8 page)
95{
Raju Lakkaraju4ffd03f2016-09-08 14:09:31 +053096 int rc;
Raju Lakkarajud50736a2016-08-05 17:54:21 +053097
Raju Lakkaraju4ffd03f2016-09-08 14:09:31 +053098 rc = phy_write(phydev, MSCC_EXT_PAGE_ACCESS, page);
99 return rc;
Raju Lakkarajud50736a2016-08-05 17:54:21 +0530100}
101
Raju Lakkaraju0a55c122016-10-05 14:19:27 +0530102static int vsc85xx_wol_set(struct phy_device *phydev,
103 struct ethtool_wolinfo *wol)
104{
105 int rc;
106 u16 reg_val;
107 u8 i;
108 u16 pwd[3] = {0, 0, 0};
109 struct ethtool_wolinfo *wol_conf = wol;
110 u8 *mac_addr = phydev->attached_dev->dev_addr;
111
112 mutex_lock(&phydev->lock);
113 rc = vsc85xx_phy_page_set(phydev, MSCC_PHY_PAGE_EXTENDED_2);
114 if (rc != 0)
115 goto out_unlock;
116
117 if (wol->wolopts & WAKE_MAGIC) {
118 /* Store the device address for the magic packet */
119 for (i = 0; i < ARRAY_SIZE(pwd); i++)
120 pwd[i] = mac_addr[5 - (i * 2 + 1)] << 8 |
121 mac_addr[5 - i * 2];
122 phy_write(phydev, MSCC_PHY_WOL_LOWER_MAC_ADDR, pwd[0]);
123 phy_write(phydev, MSCC_PHY_WOL_MID_MAC_ADDR, pwd[1]);
124 phy_write(phydev, MSCC_PHY_WOL_UPPER_MAC_ADDR, pwd[2]);
125 } else {
126 phy_write(phydev, MSCC_PHY_WOL_LOWER_MAC_ADDR, 0);
127 phy_write(phydev, MSCC_PHY_WOL_MID_MAC_ADDR, 0);
128 phy_write(phydev, MSCC_PHY_WOL_UPPER_MAC_ADDR, 0);
129 }
130
131 if (wol_conf->wolopts & WAKE_MAGICSECURE) {
132 for (i = 0; i < ARRAY_SIZE(pwd); i++)
133 pwd[i] = wol_conf->sopass[5 - (i * 2 + 1)] << 8 |
134 wol_conf->sopass[5 - i * 2];
135 phy_write(phydev, MSCC_PHY_WOL_LOWER_PASSWD, pwd[0]);
136 phy_write(phydev, MSCC_PHY_WOL_MID_PASSWD, pwd[1]);
137 phy_write(phydev, MSCC_PHY_WOL_UPPER_PASSWD, pwd[2]);
138 } else {
139 phy_write(phydev, MSCC_PHY_WOL_LOWER_PASSWD, 0);
140 phy_write(phydev, MSCC_PHY_WOL_MID_PASSWD, 0);
141 phy_write(phydev, MSCC_PHY_WOL_UPPER_PASSWD, 0);
142 }
143
144 reg_val = phy_read(phydev, MSCC_PHY_WOL_MAC_CONTROL);
145 if (wol_conf->wolopts & WAKE_MAGICSECURE)
146 reg_val |= SECURE_ON_ENABLE;
147 else
148 reg_val &= ~SECURE_ON_ENABLE;
149 phy_write(phydev, MSCC_PHY_WOL_MAC_CONTROL, reg_val);
150
151 rc = vsc85xx_phy_page_set(phydev, MSCC_PHY_PAGE_STANDARD);
152 if (rc != 0)
153 goto out_unlock;
154
155 if (wol->wolopts & WAKE_MAGIC) {
156 /* Enable the WOL interrupt */
157 reg_val = phy_read(phydev, MII_VSC85XX_INT_MASK);
158 reg_val |= MII_VSC85XX_INT_MASK_WOL;
159 rc = phy_write(phydev, MII_VSC85XX_INT_MASK, reg_val);
160 if (rc != 0)
161 goto out_unlock;
162 } else {
163 /* Disable the WOL interrupt */
164 reg_val = phy_read(phydev, MII_VSC85XX_INT_MASK);
165 reg_val &= (~MII_VSC85XX_INT_MASK_WOL);
166 rc = phy_write(phydev, MII_VSC85XX_INT_MASK, reg_val);
167 if (rc != 0)
168 goto out_unlock;
169 }
170 /* Clear WOL iterrupt status */
171 reg_val = phy_read(phydev, MII_VSC85XX_INT_STATUS);
172
173out_unlock:
174 mutex_unlock(&phydev->lock);
175
176 return rc;
177}
178
179static void vsc85xx_wol_get(struct phy_device *phydev,
180 struct ethtool_wolinfo *wol)
181{
182 int rc;
183 u16 reg_val;
184 u8 i;
185 u16 pwd[3] = {0, 0, 0};
186 struct ethtool_wolinfo *wol_conf = wol;
187
188 mutex_lock(&phydev->lock);
189 rc = vsc85xx_phy_page_set(phydev, MSCC_PHY_PAGE_EXTENDED_2);
190 if (rc != 0)
191 goto out_unlock;
192
193 reg_val = phy_read(phydev, MSCC_PHY_WOL_MAC_CONTROL);
194 if (reg_val & SECURE_ON_ENABLE)
195 wol_conf->wolopts |= WAKE_MAGICSECURE;
196 if (wol_conf->wolopts & WAKE_MAGICSECURE) {
197 pwd[0] = phy_read(phydev, MSCC_PHY_WOL_LOWER_PASSWD);
198 pwd[1] = phy_read(phydev, MSCC_PHY_WOL_MID_PASSWD);
199 pwd[2] = phy_read(phydev, MSCC_PHY_WOL_UPPER_PASSWD);
200 for (i = 0; i < ARRAY_SIZE(pwd); i++) {
201 wol_conf->sopass[5 - i * 2] = pwd[i] & 0x00ff;
202 wol_conf->sopass[5 - (i * 2 + 1)] = (pwd[i] & 0xff00)
203 >> 8;
204 }
205 }
206
207 rc = vsc85xx_phy_page_set(phydev, MSCC_PHY_PAGE_STANDARD);
208
209out_unlock:
210 mutex_unlock(&phydev->lock);
211}
212
Allan W. Nielsen4f58e6d2016-10-12 15:47:51 +0200213#ifdef CONFIG_OF_MDIO
214static int vsc85xx_edge_rate_magic_get(struct phy_device *phydev)
Raju Lakkarajua4cc96d2016-10-03 12:53:13 +0530215{
Raju Lakkarajua4cc96d2016-10-03 12:53:13 +0530216 u8 sd;
Allan W. Nielsen4f58e6d2016-10-12 15:47:51 +0200217 u16 vdd;
218 int rc, i, j;
219 struct device *dev = &phydev->mdio.dev;
220 struct device_node *of_node = dev->of_node;
221 u8 sd_array_size = ARRAY_SIZE(edge_table[0].slowdown);
Raju Lakkarajua4cc96d2016-10-03 12:53:13 +0530222
Allan W. Nielsen4f58e6d2016-10-12 15:47:51 +0200223 if (!of_node)
224 return -ENODEV;
Raju Lakkarajua4cc96d2016-10-03 12:53:13 +0530225
Allan W. Nielsen4f58e6d2016-10-12 15:47:51 +0200226 rc = of_property_read_u16(of_node, "vsc8531,vddmac", &vdd);
227 if (rc != 0)
228 vdd = MSCC_VDDMAC_3300;
229
230 rc = of_property_read_u8(of_node, "vsc8531,edge-slowdown", &sd);
231 if (rc != 0)
232 sd = 0;
233
234 for (i = 0; i < ARRAY_SIZE(edge_table); i++)
235 if (edge_table[i].vddmac == vdd)
236 for (j = 0; j < sd_array_size; j++)
237 if (edge_table[i].slowdown[j] == sd)
238 return (sd_array_size - j - 1);
239
240 return -EINVAL;
Raju Lakkarajua4cc96d2016-10-03 12:53:13 +0530241}
Allan W. Nielsen4f58e6d2016-10-12 15:47:51 +0200242#else
243static int vsc85xx_edge_rate_magic_get(struct phy_device *phydev)
244{
245 return 0;
246}
247#endif /* CONFIG_OF_MDIO */
Raju Lakkarajua4cc96d2016-10-03 12:53:13 +0530248
Allan W. Nielsen4f58e6d2016-10-12 15:47:51 +0200249static int vsc85xx_edge_rate_cntl_set(struct phy_device *phydev, u8 edge_rate)
Raju Lakkarajua4cc96d2016-10-03 12:53:13 +0530250{
251 int rc;
252 u16 reg_val;
253
254 mutex_lock(&phydev->lock);
255 rc = vsc85xx_phy_page_set(phydev, MSCC_PHY_PAGE_EXTENDED_2);
256 if (rc != 0)
257 goto out_unlock;
258 reg_val = phy_read(phydev, MSCC_PHY_WOL_MAC_CONTROL);
259 reg_val &= ~(EDGE_RATE_CNTL_MASK);
260 reg_val |= (edge_rate << EDGE_RATE_CNTL_POS);
261 rc = phy_write(phydev, MSCC_PHY_WOL_MAC_CONTROL, reg_val);
262 if (rc != 0)
263 goto out_unlock;
264 rc = vsc85xx_phy_page_set(phydev, MSCC_PHY_PAGE_STANDARD);
265
266out_unlock:
267 mutex_unlock(&phydev->lock);
268
269 return rc;
270}
271
Raju Lakkaraju1a211012016-09-19 15:33:54 +0530272static int vsc85xx_mac_if_set(struct phy_device *phydev,
273 phy_interface_t interface)
274{
275 int rc;
276 u16 reg_val;
277
278 mutex_lock(&phydev->lock);
279 reg_val = phy_read(phydev, MSCC_PHY_EXT_PHY_CNTL_1);
280 reg_val &= ~(MAC_IF_SELECTION_MASK);
281 switch (interface) {
282 case PHY_INTERFACE_MODE_RGMII:
283 reg_val |= (MAC_IF_SELECTION_RGMII << MAC_IF_SELECTION_POS);
284 break;
285 case PHY_INTERFACE_MODE_RMII:
286 reg_val |= (MAC_IF_SELECTION_RMII << MAC_IF_SELECTION_POS);
287 break;
288 case PHY_INTERFACE_MODE_MII:
289 case PHY_INTERFACE_MODE_GMII:
290 reg_val |= (MAC_IF_SELECTION_GMII << MAC_IF_SELECTION_POS);
291 break;
292 default:
293 rc = -EINVAL;
294 goto out_unlock;
295 }
296 rc = phy_write(phydev, MSCC_PHY_EXT_PHY_CNTL_1, reg_val);
297 if (rc != 0)
298 goto out_unlock;
299
300 rc = genphy_soft_reset(phydev);
301
302out_unlock:
303 mutex_unlock(&phydev->lock);
304
305 return rc;
306}
307
Raju Lakkarajud50736a2016-08-05 17:54:21 +0530308static int vsc85xx_default_config(struct phy_device *phydev)
309{
Raju Lakkaraju4ffd03f2016-09-08 14:09:31 +0530310 int rc;
311 u16 reg_val;
Raju Lakkarajud50736a2016-08-05 17:54:21 +0530312
Raju Lakkaraju4ffd03f2016-09-08 14:09:31 +0530313 mutex_lock(&phydev->lock);
314 rc = vsc85xx_phy_page_set(phydev, MSCC_PHY_PAGE_EXTENDED_2);
315 if (rc != 0)
316 goto out_unlock;
Raju Lakkarajud50736a2016-08-05 17:54:21 +0530317
Raju Lakkaraju4ffd03f2016-09-08 14:09:31 +0530318 reg_val = phy_read(phydev, MSCC_PHY_RGMII_CNTL);
319 reg_val &= ~(RGMII_RX_CLK_DELAY_MASK);
320 reg_val |= (RGMII_RX_CLK_DELAY_1_1_NS << RGMII_RX_CLK_DELAY_POS);
321 phy_write(phydev, MSCC_PHY_RGMII_CNTL, reg_val);
322 rc = vsc85xx_phy_page_set(phydev, MSCC_PHY_PAGE_STANDARD);
Raju Lakkarajud50736a2016-08-05 17:54:21 +0530323
324out_unlock:
Raju Lakkaraju4ffd03f2016-09-08 14:09:31 +0530325 mutex_unlock(&phydev->lock);
Raju Lakkarajud50736a2016-08-05 17:54:21 +0530326
Raju Lakkaraju4ffd03f2016-09-08 14:09:31 +0530327 return rc;
Raju Lakkarajud50736a2016-08-05 17:54:21 +0530328}
329
330static int vsc85xx_config_init(struct phy_device *phydev)
331{
Raju Lakkaraju4ffd03f2016-09-08 14:09:31 +0530332 int rc;
Raju Lakkarajua4cc96d2016-10-03 12:53:13 +0530333 struct vsc8531_private *vsc8531 = phydev->priv;
Raju Lakkarajud50736a2016-08-05 17:54:21 +0530334
Raju Lakkaraju4ffd03f2016-09-08 14:09:31 +0530335 rc = vsc85xx_default_config(phydev);
336 if (rc)
337 return rc;
Raju Lakkaraju1a211012016-09-19 15:33:54 +0530338
339 rc = vsc85xx_mac_if_set(phydev, phydev->interface);
340 if (rc)
341 return rc;
342
Allan W. Nielsen4f58e6d2016-10-12 15:47:51 +0200343 rc = vsc85xx_edge_rate_cntl_set(phydev, vsc8531->rate_magic);
Raju Lakkarajua4cc96d2016-10-03 12:53:13 +0530344 if (rc)
345 return rc;
346
Raju Lakkaraju4ffd03f2016-09-08 14:09:31 +0530347 rc = genphy_config_init(phydev);
Raju Lakkarajud50736a2016-08-05 17:54:21 +0530348
Raju Lakkaraju4ffd03f2016-09-08 14:09:31 +0530349 return rc;
Raju Lakkarajud50736a2016-08-05 17:54:21 +0530350}
351
352static int vsc85xx_ack_interrupt(struct phy_device *phydev)
353{
Raju Lakkaraju4ffd03f2016-09-08 14:09:31 +0530354 int rc = 0;
Raju Lakkarajud50736a2016-08-05 17:54:21 +0530355
Raju Lakkaraju4ffd03f2016-09-08 14:09:31 +0530356 if (phydev->interrupts == PHY_INTERRUPT_ENABLED)
357 rc = phy_read(phydev, MII_VSC85XX_INT_STATUS);
Raju Lakkarajud50736a2016-08-05 17:54:21 +0530358
Raju Lakkaraju4ffd03f2016-09-08 14:09:31 +0530359 return (rc < 0) ? rc : 0;
Raju Lakkarajud50736a2016-08-05 17:54:21 +0530360}
361
362static int vsc85xx_config_intr(struct phy_device *phydev)
363{
Raju Lakkaraju4ffd03f2016-09-08 14:09:31 +0530364 int rc;
Raju Lakkarajud50736a2016-08-05 17:54:21 +0530365
Raju Lakkaraju4ffd03f2016-09-08 14:09:31 +0530366 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) {
367 rc = phy_write(phydev, MII_VSC85XX_INT_MASK,
368 MII_VSC85XX_INT_MASK_MASK);
369 } else {
370 rc = phy_write(phydev, MII_VSC85XX_INT_MASK, 0);
371 if (rc < 0)
372 return rc;
373 rc = phy_read(phydev, MII_VSC85XX_INT_STATUS);
374 }
Raju Lakkarajud50736a2016-08-05 17:54:21 +0530375
Raju Lakkaraju4ffd03f2016-09-08 14:09:31 +0530376 return rc;
Raju Lakkarajud50736a2016-08-05 17:54:21 +0530377}
378
Raju Lakkarajua4cc96d2016-10-03 12:53:13 +0530379static int vsc85xx_probe(struct phy_device *phydev)
380{
Allan W. Nielsen4f58e6d2016-10-12 15:47:51 +0200381 int rate_magic;
Raju Lakkarajua4cc96d2016-10-03 12:53:13 +0530382 struct vsc8531_private *vsc8531;
383
Allan W. Nielsen4f58e6d2016-10-12 15:47:51 +0200384 rate_magic = vsc85xx_edge_rate_magic_get(phydev);
385 if (rate_magic < 0)
386 return rate_magic;
387
Raju Lakkarajua4cc96d2016-10-03 12:53:13 +0530388 vsc8531 = devm_kzalloc(&phydev->mdio.dev, sizeof(*vsc8531), GFP_KERNEL);
389 if (!vsc8531)
390 return -ENOMEM;
391
392 phydev->priv = vsc8531;
393
Allan W. Nielsen4f58e6d2016-10-12 15:47:51 +0200394 vsc8531->rate_magic = rate_magic;
395
Raju Lakkarajua4cc96d2016-10-03 12:53:13 +0530396 return 0;
397}
398
Raju Lakkarajud50736a2016-08-05 17:54:21 +0530399/* Microsemi VSC85xx PHYs */
400static struct phy_driver vsc85xx_driver[] = {
401{
Raju Lakkaraju4ffd03f2016-09-08 14:09:31 +0530402 .phy_id = PHY_ID_VSC8531,
403 .name = "Microsemi VSC8531",
404 .phy_id_mask = 0xfffffff0,
405 .features = PHY_GBIT_FEATURES,
406 .flags = PHY_HAS_INTERRUPT,
407 .soft_reset = &genphy_soft_reset,
408 .config_init = &vsc85xx_config_init,
409 .config_aneg = &genphy_config_aneg,
410 .aneg_done = &genphy_aneg_done,
411 .read_status = &genphy_read_status,
412 .ack_interrupt = &vsc85xx_ack_interrupt,
413 .config_intr = &vsc85xx_config_intr,
414 .suspend = &genphy_suspend,
415 .resume = &genphy_resume,
Allan W. Nielsen4f58e6d2016-10-12 15:47:51 +0200416 .probe = &vsc85xx_probe,
417 .set_wol = &vsc85xx_wol_set,
418 .get_wol = &vsc85xx_wol_get,
Raju Lakkarajud50736a2016-08-05 17:54:21 +0530419},
420{
Raju Lakkaraju4ffd03f2016-09-08 14:09:31 +0530421 .phy_id = PHY_ID_VSC8541,
422 .name = "Microsemi VSC8541 SyncE",
423 .phy_id_mask = 0xfffffff0,
424 .features = PHY_GBIT_FEATURES,
425 .flags = PHY_HAS_INTERRUPT,
426 .soft_reset = &genphy_soft_reset,
427 .config_init = &vsc85xx_config_init,
428 .config_aneg = &genphy_config_aneg,
429 .aneg_done = &genphy_aneg_done,
430 .read_status = &genphy_read_status,
431 .ack_interrupt = &vsc85xx_ack_interrupt,
432 .config_intr = &vsc85xx_config_intr,
433 .suspend = &genphy_suspend,
434 .resume = &genphy_resume,
Allan W. Nielsen4f58e6d2016-10-12 15:47:51 +0200435 .probe = &vsc85xx_probe,
436 .set_wol = &vsc85xx_wol_set,
437 .get_wol = &vsc85xx_wol_get,
Raju Lakkarajud50736a2016-08-05 17:54:21 +0530438}
439
440};
441
442module_phy_driver(vsc85xx_driver);
443
444static struct mdio_device_id __maybe_unused vsc85xx_tbl[] = {
Raju Lakkaraju4ffd03f2016-09-08 14:09:31 +0530445 { PHY_ID_VSC8531, 0xfffffff0, },
446 { PHY_ID_VSC8541, 0xfffffff0, },
447 { }
Raju Lakkarajud50736a2016-08-05 17:54:21 +0530448};
449
450MODULE_DEVICE_TABLE(mdio, vsc85xx_tbl);
451
452MODULE_DESCRIPTION("Microsemi VSC85xx PHY driver");
453MODULE_AUTHOR("Nagaraju Lakkaraju");
454MODULE_LICENSE("Dual MIT/GPL");