blob: 601121dc3a17726f5e03ba743711cc847bf9b916 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Shaohui Xie0e548d72014-12-30 18:32:04 +08002/*
3 * Aquantia PHY drivers
4 *
Shaohui Xie0e548d72014-12-30 18:32:04 +08005 * Copyright 2014 Freescale Semiconductor, Inc.
Valentin-catalin Neacsu123b24f2018-10-30 09:54:46 +00006 * Copyright 2018 NXP
Shaohui Xie0e548d72014-12-30 18:32:04 +08007 */
8#include <config.h>
9#include <common.h>
Calvin Johnsond76b9b72018-03-08 15:30:23 +053010#include <dm.h>
Shaohui Xie0e548d72014-12-30 18:32:04 +080011#include <phy.h>
Philipp Tomsich36b26d12018-11-25 19:22:18 +010012#include <u-boot/crc.h>
Jeremy Gebbene662c0d2018-09-18 15:49:36 -060013#include <malloc.h>
14#include <asm/byteorder.h>
15#include <fs.h>
Shaohui Xie0e548d72014-12-30 18:32:04 +080016
Shaohui Xie0e548d72014-12-30 18:32:04 +080017#define AQUNTIA_10G_CTL 0x20
18#define AQUNTIA_VENDOR_P1 0xc400
19
20#define AQUNTIA_SPEED_LSB_MASK 0x2000
21#define AQUNTIA_SPEED_MSB_MASK 0x40
22
Valentin-catalin Neacsu123b24f2018-10-30 09:54:46 +000023#define AQUANTIA_SYSTEM_INTERFACE_SR 0xe812
24#define AQUANTIA_VENDOR_PROVISIONING_REG 0xC441
Valentin-catalin Neacsu78119192018-11-06 12:16:54 +000025#define AQUANTIA_FIRMWARE_ID 0x20
26#define AQUANTIA_RESERVED_STATUS 0xc885
27#define AQUANTIA_FIRMWARE_MAJOR_MASK 0xff00
28#define AQUANTIA_FIRMWARE_MINOR_MASK 0xff
29#define AQUANTIA_FIRMWARE_BUILD_MASK 0xf0
Valentin-catalin Neacsu123b24f2018-10-30 09:54:46 +000030
31#define AQUANTIA_USX_AUTONEG_CONTROL_ENA 0x0008
32#define AQUANTIA_SI_IN_USE_MASK 0x0078
33#define AQUANTIA_SI_USXGMII 0x0018
34
Jeremy Gebbene662c0d2018-09-18 15:49:36 -060035/* registers in MDIO_MMD_VEND1 region */
36#define GLOBAL_FIRMWARE_ID 0x20
37#define GLOBAL_FAULT 0xc850
38#define GLOBAL_RSTATUS_1 0xc885
39
Florin Chiculita40829fa2019-10-14 17:27:07 +030040#define GLOBAL_ALARM_1 0xcc00
41#define SYSTEM_READY_BIT 0x40
42
Jeremy Gebbene662c0d2018-09-18 15:49:36 -060043#define GLOBAL_STANDARD_CONTROL 0x0
44#define SOFT_RESET BIT(15)
45#define LOW_POWER BIT(11)
46
47#define MAILBOX_CONTROL 0x0200
48#define MAILBOX_EXECUTE BIT(15)
49#define MAILBOX_WRITE BIT(14)
50#define MAILBOX_RESET_CRC BIT(12)
51#define MAILBOX_BUSY BIT(8)
52
53#define MAILBOX_CRC 0x0201
54
55#define MAILBOX_ADDR_MSW 0x0202
56#define MAILBOX_ADDR_LSW 0x0203
57
58#define MAILBOX_DATA_MSW 0x0204
59#define MAILBOX_DATA_LSW 0x0205
60
61#define UP_CONTROL 0xc001
62#define UP_RESET BIT(15)
63#define UP_RUN_STALL_OVERRIDE BIT(6)
64#define UP_RUN_STALL BIT(0)
65
66/* addresses of memory segments in the phy */
67#define DRAM_BASE_ADDR 0x3FFE0000
68#define IRAM_BASE_ADDR 0x40000000
69
70/* firmware image format constants */
71#define VERSION_STRING_SIZE 0x40
72#define VERSION_STRING_OFFSET 0x0200
73#define HEADER_OFFSET 0x300
74
75#pragma pack(1)
76struct fw_header {
77 u8 padding[4];
78 u8 iram_offset[3];
79 u8 iram_size[3];
80 u8 dram_offset[3];
81 u8 dram_size[3];
82};
83
84#pragma pack()
85
86#if defined(CONFIG_PHY_AQUANTIA_UPLOAD_FW)
87static int aquantia_read_fw(u8 **fw_addr, size_t *fw_length)
88{
89 loff_t length, read;
90 int ret;
91 void *addr = NULL;
92
93 *fw_addr = NULL;
94 *fw_length = 0;
95 debug("Loading Acquantia microcode from %s %s\n",
96 CONFIG_PHY_AQUANTIA_FW_PART, CONFIG_PHY_AQUANTIA_FW_NAME);
97 ret = fs_set_blk_dev("mmc", CONFIG_PHY_AQUANTIA_FW_PART, FS_TYPE_ANY);
98 if (ret < 0)
99 goto cleanup;
100
101 ret = fs_size(CONFIG_PHY_AQUANTIA_FW_NAME, &length);
102 if (ret < 0)
103 goto cleanup;
104
105 addr = malloc(length);
106 if (!addr) {
107 ret = -ENOMEM;
108 goto cleanup;
109 }
110
111 ret = fs_set_blk_dev("mmc", CONFIG_PHY_AQUANTIA_FW_PART, FS_TYPE_ANY);
112 if (ret < 0)
113 goto cleanup;
114
115 ret = fs_read(CONFIG_PHY_AQUANTIA_FW_NAME, (ulong)addr, 0, length,
116 &read);
117 if (ret < 0)
118 goto cleanup;
119
120 *fw_addr = addr;
121 *fw_length = length;
122 debug("Found Acquantia microcode.\n");
123
124cleanup:
125 if (ret < 0) {
126 printf("loading firmware file %s %s failed with error %d\n",
127 CONFIG_PHY_AQUANTIA_FW_PART,
128 CONFIG_PHY_AQUANTIA_FW_NAME, ret);
129 free(addr);
130 }
131 return ret;
132}
133
134/* load data into the phy's memory */
135static int aquantia_load_memory(struct phy_device *phydev, u32 addr,
136 const u8 *data, size_t len)
137{
138 size_t pos;
139 u16 crc = 0, up_crc;
140
141 phy_write(phydev, MDIO_MMD_VEND1, MAILBOX_CONTROL, MAILBOX_RESET_CRC);
142 phy_write(phydev, MDIO_MMD_VEND1, MAILBOX_ADDR_MSW, addr >> 16);
143 phy_write(phydev, MDIO_MMD_VEND1, MAILBOX_ADDR_LSW, addr & 0xfffc);
144
145 for (pos = 0; pos < len; pos += min(sizeof(u32), len - pos)) {
146 u32 word = 0;
147
148 memcpy(&word, &data[pos], min(sizeof(u32), len - pos));
149
150 phy_write(phydev, MDIO_MMD_VEND1, MAILBOX_DATA_MSW,
151 (word >> 16));
152 phy_write(phydev, MDIO_MMD_VEND1, MAILBOX_DATA_LSW,
153 word & 0xffff);
154
155 phy_write(phydev, MDIO_MMD_VEND1, MAILBOX_CONTROL,
156 MAILBOX_EXECUTE | MAILBOX_WRITE);
157
158 /* keep a big endian CRC to match the phy processor */
159 word = cpu_to_be32(word);
160 crc = crc16_ccitt(crc, (u8 *)&word, sizeof(word));
161 }
162
163 up_crc = phy_read(phydev, MDIO_MMD_VEND1, MAILBOX_CRC);
164 if (crc != up_crc) {
165 printf("%s crc mismatch: calculated 0x%04hx phy 0x%04hx\n",
166 phydev->dev->name, crc, up_crc);
167 return -EINVAL;
168 }
169 return 0;
170}
171
172static u32 unpack_u24(const u8 *data)
173{
174 return (data[2] << 16) + (data[1] << 8) + data[0];
175}
176
177static int aquantia_upload_firmware(struct phy_device *phydev)
178{
179 int ret;
180 u8 *addr = NULL;
181 size_t fw_length = 0;
182 u16 calculated_crc, read_crc;
183 char version[VERSION_STRING_SIZE];
184 u32 primary_offset, iram_offset, iram_size, dram_offset, dram_size;
185 const struct fw_header *header;
186
187 ret = aquantia_read_fw(&addr, &fw_length);
188 if (ret != 0)
189 return ret;
190
191 read_crc = (addr[fw_length - 2] << 8) | addr[fw_length - 1];
192 calculated_crc = crc16_ccitt(0, addr, fw_length - 2);
193 if (read_crc != calculated_crc) {
194 printf("%s bad firmware crc: file 0x%04x calculated 0x%04x\n",
195 phydev->dev->name, read_crc, calculated_crc);
196 ret = -EINVAL;
197 goto done;
198 }
199
200 /* Find the DRAM and IRAM sections within the firmware file. */
201 primary_offset = ((addr[9] & 0xf) << 8 | addr[8]) << 12;
202
203 header = (struct fw_header *)&addr[primary_offset + HEADER_OFFSET];
204
205 iram_offset = primary_offset + unpack_u24(header->iram_offset);
206 iram_size = unpack_u24(header->iram_size);
207
208 dram_offset = primary_offset + unpack_u24(header->dram_offset);
209 dram_size = unpack_u24(header->dram_size);
210
211 debug("primary %d iram offset=%d size=%d dram offset=%d size=%d\n",
212 primary_offset, iram_offset, iram_size, dram_offset, dram_size);
213
214 strlcpy(version, (char *)&addr[dram_offset + VERSION_STRING_OFFSET],
215 VERSION_STRING_SIZE);
216 printf("%s loading firmare version '%s'\n", phydev->dev->name, version);
217
218 /* stall the microcprocessor */
219 phy_write(phydev, MDIO_MMD_VEND1, UP_CONTROL,
220 UP_RUN_STALL | UP_RUN_STALL_OVERRIDE);
221
222 debug("loading dram 0x%08x from offset=%d size=%d\n",
223 DRAM_BASE_ADDR, dram_offset, dram_size);
224 ret = aquantia_load_memory(phydev, DRAM_BASE_ADDR, &addr[dram_offset],
225 dram_size);
226 if (ret != 0)
227 goto done;
228
229 debug("loading iram 0x%08x from offset=%d size=%d\n",
230 IRAM_BASE_ADDR, iram_offset, iram_size);
231 ret = aquantia_load_memory(phydev, IRAM_BASE_ADDR, &addr[iram_offset],
232 iram_size);
233 if (ret != 0)
234 goto done;
235
236 /* make sure soft reset and low power mode are clear */
237 phy_write(phydev, MDIO_MMD_VEND1, GLOBAL_STANDARD_CONTROL, 0);
238
239 /* Release the microprocessor. UP_RESET must be held for 100 usec. */
240 phy_write(phydev, MDIO_MMD_VEND1, UP_CONTROL,
241 UP_RUN_STALL | UP_RUN_STALL_OVERRIDE | UP_RESET);
242
243 udelay(100);
244
245 phy_write(phydev, MDIO_MMD_VEND1, UP_CONTROL, UP_RUN_STALL_OVERRIDE);
246
247 printf("%s firmare loading done.\n", phydev->dev->name);
248done:
249 free(addr);
250 return ret;
251}
252#else
253static int aquantia_upload_firmware(struct phy_device *phydev)
254{
Jeremy Gebben6ce0dd82018-09-18 15:49:37 -0600255 printf("ERROR %s firmware loading disabled.\n", phydev->dev->name);
256 return -1;
Jeremy Gebbene662c0d2018-09-18 15:49:36 -0600257}
258#endif
259
Shaohui Xie0e548d72014-12-30 18:32:04 +0800260int aquantia_config(struct phy_device *phydev)
261{
Alex Margineand103efb2019-11-14 18:28:30 +0200262 int interface = phydev->interface;
Jeremy Gebben6ce0dd82018-09-18 15:49:37 -0600263 u32 val, id, rstatus, fault;
Valentin-catalin Neacsu78119192018-11-06 12:16:54 +0000264 u32 reg_val1 = 0;
Florin Chiculita40829fa2019-10-14 17:27:07 +0300265 int num_retries = 5;
Alex Margineand103efb2019-11-14 18:28:30 +0200266 int usx_an = 0;
Florin Chiculita40829fa2019-10-14 17:27:07 +0300267
268 /*
269 * check if the system is out of reset and init sequence completed.
270 * chip-wide reset for gen1 quad phys takes longer
271 */
272 while (--num_retries) {
273 rstatus = phy_read(phydev, MDIO_MMD_VEND1, GLOBAL_ALARM_1);
274 if (rstatus & SYSTEM_READY_BIT)
275 break;
276 mdelay(10);
277 }
Jeremy Gebben6ce0dd82018-09-18 15:49:37 -0600278
279 id = phy_read(phydev, MDIO_MMD_VEND1, GLOBAL_FIRMWARE_ID);
280 rstatus = phy_read(phydev, MDIO_MMD_VEND1, GLOBAL_RSTATUS_1);
281 fault = phy_read(phydev, MDIO_MMD_VEND1, GLOBAL_FAULT);
282
283 if (id != 0)
284 printf("%s running firmware version %X.%X.%X\n",
285 phydev->dev->name, (id >> 8), id & 0xff,
286 (rstatus >> 4) & 0xf);
287
288 if (fault != 0)
289 printf("%s fault 0x%04x detected\n", phydev->dev->name, fault);
290
291 if (id == 0 || fault != 0) {
292 int ret;
Jeremy Gebbene662c0d2018-09-18 15:49:36 -0600293
Jeremy Gebben6ce0dd82018-09-18 15:49:37 -0600294 ret = aquantia_upload_firmware(phydev);
295 if (ret != 0)
296 return ret;
297 }
Alex Margineand103efb2019-11-14 18:28:30 +0200298 /*
299 * for backward compatibility convert XGMII into either XFI or USX based
300 * on FW config
301 */
302 if (interface == PHY_INTERFACE_MODE_XGMII) {
303 reg_val1 = phy_read(phydev, MDIO_MMD_PHYXS,
304 AQUANTIA_SYSTEM_INTERFACE_SR);
305 if ((reg_val1 & AQUANTIA_SI_IN_USE_MASK) == AQUANTIA_SI_USXGMII)
306 interface = PHY_INTERFACE_MODE_USXGMII;
307 else
308 interface = PHY_INTERFACE_MODE_XFI;
309 }
Jeremy Gebbene662c0d2018-09-18 15:49:36 -0600310
311 val = phy_read(phydev, MDIO_MMD_PMAPMD, MII_BMCR);
Shaohui Xie0e548d72014-12-30 18:32:04 +0800312
Alex Margineand103efb2019-11-14 18:28:30 +0200313 switch (interface) {
314 case PHY_INTERFACE_MODE_SGMII:
Shaohui Xie0e548d72014-12-30 18:32:04 +0800315 /* 1000BASE-T mode */
316 phydev->advertising = SUPPORTED_1000baseT_Full;
317 phydev->supported = phydev->advertising;
318
319 val = (val & ~AQUNTIA_SPEED_LSB_MASK) | AQUNTIA_SPEED_MSB_MASK;
320 phy_write(phydev, MDIO_MMD_PMAPMD, MII_BMCR, val);
Alex Margineand103efb2019-11-14 18:28:30 +0200321 break;
322 case PHY_INTERFACE_MODE_USXGMII:
323 usx_an = 1;
324 /* FALLTHROUGH */
325 case PHY_INTERFACE_MODE_XFI:
Shaohui Xie0e548d72014-12-30 18:32:04 +0800326 /* 10GBASE-T mode */
327 phydev->advertising = SUPPORTED_10000baseT_Full;
328 phydev->supported = phydev->advertising;
329
330 if (!(val & AQUNTIA_SPEED_LSB_MASK) ||
331 !(val & AQUNTIA_SPEED_MSB_MASK))
332 phy_write(phydev, MDIO_MMD_PMAPMD, MII_BMCR,
333 AQUNTIA_SPEED_LSB_MASK |
334 AQUNTIA_SPEED_MSB_MASK);
Valentin-catalin Neacsu123b24f2018-10-30 09:54:46 +0000335
Valentin-catalin Neacsu123b24f2018-10-30 09:54:46 +0000336 /* If SI is USXGMII then start USXGMII autoneg */
Alex Margineand103efb2019-11-14 18:28:30 +0200337 reg_val1 = phy_read(phydev, MDIO_MMD_PHYXS,
338 AQUANTIA_VENDOR_PROVISIONING_REG);
Valentin-catalin Neacsudeef3112019-02-13 09:14:53 +0000339
Alex Margineand103efb2019-11-14 18:28:30 +0200340 if (usx_an) {
Valentin-catalin Neacsudeef3112019-02-13 09:14:53 +0000341 reg_val1 |= AQUANTIA_USX_AUTONEG_CONTROL_ENA;
Valentin-catalin Neacsu78119192018-11-06 12:16:54 +0000342 printf("%s: system interface USXGMII\n",
343 phydev->dev->name);
344 } else {
Alex Margineand103efb2019-11-14 18:28:30 +0200345 reg_val1 &= ~AQUANTIA_USX_AUTONEG_CONTROL_ENA;
Valentin-catalin Neacsu78119192018-11-06 12:16:54 +0000346 printf("%s: system interface XFI\n",
347 phydev->dev->name);
Valentin-catalin Neacsu123b24f2018-10-30 09:54:46 +0000348 }
349
Alex Margineand103efb2019-11-14 18:28:30 +0200350 phy_write(phydev, MDIO_MMD_PHYXS,
351 AQUANTIA_VENDOR_PROVISIONING_REG, reg_val1);
352 break;
353 case PHY_INTERFACE_MODE_SGMII_2500:
Shaohui Xie0e548d72014-12-30 18:32:04 +0800354 /* 2.5GBASE-T mode */
355 phydev->advertising = SUPPORTED_1000baseT_Full;
356 phydev->supported = phydev->advertising;
357
358 phy_write(phydev, MDIO_MMD_AN, AQUNTIA_10G_CTL, 1);
359 phy_write(phydev, MDIO_MMD_AN, AQUNTIA_VENDOR_P1, 0x9440);
Alex Margineand103efb2019-11-14 18:28:30 +0200360 break;
361 case PHY_INTERFACE_MODE_MII:
Shaohui Xie0e548d72014-12-30 18:32:04 +0800362 /* 100BASE-TX mode */
363 phydev->advertising = SUPPORTED_100baseT_Full;
364 phydev->supported = phydev->advertising;
365
366 val = (val & ~AQUNTIA_SPEED_MSB_MASK) | AQUNTIA_SPEED_LSB_MASK;
367 phy_write(phydev, MDIO_MMD_PMAPMD, MII_BMCR, val);
Alex Margineand103efb2019-11-14 18:28:30 +0200368 break;
369 };
Valentin-catalin Neacsu78119192018-11-06 12:16:54 +0000370
371 val = phy_read(phydev, MDIO_MMD_VEND1, AQUANTIA_RESERVED_STATUS);
372 reg_val1 = phy_read(phydev, MDIO_MMD_VEND1, AQUANTIA_FIRMWARE_ID);
373
374 printf("%s: %s Firmware Version %x.%x.%x\n", phydev->dev->name,
375 phydev->drv->name,
376 (reg_val1 & AQUANTIA_FIRMWARE_MAJOR_MASK) >> 8,
377 reg_val1 & AQUANTIA_FIRMWARE_MINOR_MASK,
378 (val & AQUANTIA_FIRMWARE_BUILD_MASK) >> 4);
379
Shaohui Xie0e548d72014-12-30 18:32:04 +0800380 return 0;
381}
382
383int aquantia_startup(struct phy_device *phydev)
384{
385 u32 reg, speed;
386 int i = 0;
387
388 phydev->duplex = DUPLEX_FULL;
389
390 /* if the AN is still in progress, wait till timeout. */
391 phy_read(phydev, MDIO_MMD_AN, MDIO_STAT1);
392 reg = phy_read(phydev, MDIO_MMD_AN, MDIO_STAT1);
393 if (!(reg & MDIO_AN_STAT1_COMPLETE)) {
394 printf("%s Waiting for PHY auto negotiation to complete",
395 phydev->dev->name);
396 do {
397 udelay(1000);
398 reg = phy_read(phydev, MDIO_MMD_AN, MDIO_STAT1);
399 if ((i++ % 500) == 0)
400 printf(".");
401 } while (!(reg & MDIO_AN_STAT1_COMPLETE) &&
402 i < (4 * PHY_ANEG_TIMEOUT));
403
404 if (i > PHY_ANEG_TIMEOUT)
405 printf(" TIMEOUT !\n");
406 }
407
408 /* Read twice because link state is latched and a
409 * read moves the current state into the register */
410 phy_read(phydev, MDIO_MMD_AN, MDIO_STAT1);
411 reg = phy_read(phydev, MDIO_MMD_AN, MDIO_STAT1);
412 if (reg < 0 || !(reg & MDIO_STAT1_LSTATUS))
413 phydev->link = 0;
414 else
415 phydev->link = 1;
416
417 speed = phy_read(phydev, MDIO_MMD_PMAPMD, MII_BMCR);
418 if (speed & AQUNTIA_SPEED_MSB_MASK) {
419 if (speed & AQUNTIA_SPEED_LSB_MASK)
420 phydev->speed = SPEED_10000;
421 else
422 phydev->speed = SPEED_1000;
423 } else {
424 if (speed & AQUNTIA_SPEED_LSB_MASK)
425 phydev->speed = SPEED_100;
426 else
427 phydev->speed = SPEED_10;
428 }
429
430 return 0;
431}
432
433struct phy_driver aq1202_driver = {
434 .name = "Aquantia AQ1202",
435 .uid = 0x3a1b445,
436 .mask = 0xfffffff0,
437 .features = PHY_10G_FEATURES,
438 .mmds = (MDIO_MMD_PMAPMD | MDIO_MMD_PCS|
439 MDIO_MMD_PHYXS | MDIO_MMD_AN |
440 MDIO_MMD_VEND1),
441 .config = &aquantia_config,
442 .startup = &aquantia_startup,
443 .shutdown = &gen10g_shutdown,
444};
445
446struct phy_driver aq2104_driver = {
447 .name = "Aquantia AQ2104",
448 .uid = 0x3a1b460,
449 .mask = 0xfffffff0,
450 .features = PHY_10G_FEATURES,
451 .mmds = (MDIO_MMD_PMAPMD | MDIO_MMD_PCS|
452 MDIO_MMD_PHYXS | MDIO_MMD_AN |
453 MDIO_MMD_VEND1),
454 .config = &aquantia_config,
455 .startup = &aquantia_startup,
456 .shutdown = &gen10g_shutdown,
457};
458
459struct phy_driver aqr105_driver = {
460 .name = "Aquantia AQR105",
461 .uid = 0x3a1b4a2,
462 .mask = 0xfffffff0,
463 .features = PHY_10G_FEATURES,
464 .mmds = (MDIO_MMD_PMAPMD | MDIO_MMD_PCS|
465 MDIO_MMD_PHYXS | MDIO_MMD_AN |
466 MDIO_MMD_VEND1),
467 .config = &aquantia_config,
468 .startup = &aquantia_startup,
469 .shutdown = &gen10g_shutdown,
470};
Shaohui Xief6a0e732015-11-10 19:16:33 +0800471
Mingkai Hu602e9b52016-07-01 19:03:23 +0800472struct phy_driver aqr106_driver = {
473 .name = "Aquantia AQR106",
474 .uid = 0x3a1b4d0,
475 .mask = 0xfffffff0,
476 .features = PHY_10G_FEATURES,
477 .mmds = (MDIO_MMD_PMAPMD | MDIO_MMD_PCS|
478 MDIO_MMD_PHYXS | MDIO_MMD_AN |
479 MDIO_MMD_VEND1),
480 .config = &aquantia_config,
481 .startup = &aquantia_startup,
482 .shutdown = &gen10g_shutdown,
483};
484
485struct phy_driver aqr107_driver = {
486 .name = "Aquantia AQR107",
487 .uid = 0x3a1b4e0,
488 .mask = 0xfffffff0,
489 .features = PHY_10G_FEATURES,
490 .mmds = (MDIO_MMD_PMAPMD | MDIO_MMD_PCS|
491 MDIO_MMD_PHYXS | MDIO_MMD_AN |
492 MDIO_MMD_VEND1),
493 .config = &aquantia_config,
494 .startup = &aquantia_startup,
495 .shutdown = &gen10g_shutdown,
496};
497
Alexandru Marginean6ad27442019-06-19 12:53:43 +0000498struct phy_driver aqr112_driver = {
499 .name = "Aquantia AQR112",
500 .uid = 0x3a1b660,
501 .mask = 0xfffffff0,
502 .features = PHY_10G_FEATURES,
503 .mmds = (MDIO_MMD_PMAPMD | MDIO_MMD_PCS |
504 MDIO_MMD_PHYXS | MDIO_MMD_AN |
505 MDIO_MMD_VEND1),
506 .config = &aquantia_config,
507 .startup = &aquantia_startup,
508 .shutdown = &gen10g_shutdown,
509};
510
Shaohui Xief6a0e732015-11-10 19:16:33 +0800511struct phy_driver aqr405_driver = {
512 .name = "Aquantia AQR405",
513 .uid = 0x3a1b4b2,
514 .mask = 0xfffffff0,
515 .features = PHY_10G_FEATURES,
516 .mmds = (MDIO_MMD_PMAPMD | MDIO_MMD_PCS|
517 MDIO_MMD_PHYXS | MDIO_MMD_AN |
518 MDIO_MMD_VEND1),
519 .config = &aquantia_config,
520 .startup = &aquantia_startup,
521 .shutdown = &gen10g_shutdown,
522};
523
Alexandru Marginean6ad27442019-06-19 12:53:43 +0000524struct phy_driver aqr412_driver = {
525 .name = "Aquantia AQR412",
526 .uid = 0x3a1b710,
527 .mask = 0xfffffff0,
528 .features = PHY_10G_FEATURES,
529 .mmds = (MDIO_MMD_PMAPMD | MDIO_MMD_PCS |
530 MDIO_MMD_PHYXS | MDIO_MMD_AN |
531 MDIO_MMD_VEND1),
532 .config = &aquantia_config,
533 .startup = &aquantia_startup,
534 .shutdown = &gen10g_shutdown,
535};
536
Shaohui Xie0e548d72014-12-30 18:32:04 +0800537int phy_aquantia_init(void)
538{
539 phy_register(&aq1202_driver);
540 phy_register(&aq2104_driver);
541 phy_register(&aqr105_driver);
Mingkai Hu602e9b52016-07-01 19:03:23 +0800542 phy_register(&aqr106_driver);
543 phy_register(&aqr107_driver);
Alexandru Marginean6ad27442019-06-19 12:53:43 +0000544 phy_register(&aqr112_driver);
Shaohui Xief6a0e732015-11-10 19:16:33 +0800545 phy_register(&aqr405_driver);
Alexandru Marginean6ad27442019-06-19 12:53:43 +0000546 phy_register(&aqr412_driver);
Shaohui Xie0e548d72014-12-30 18:32:04 +0800547
548 return 0;
549}