1 // SPDX-License-Identifier: GPL-2.0
3 * Driver for Aquantia PHY
5 * Author: Shaohui Xie <Shaohui.Xie@freescale.com>
7 * Copyright 2015 Freescale Semiconductor, Inc.
10 #include <linux/kernel.h>
11 #include <linux/module.h>
12 #include <linux/delay.h>
13 #include <linux/bitfield.h>
15 #include <linux/phy.h>
19 #define PHY_ID_AQ1202 0x03a1b445
20 #define PHY_ID_AQ2104 0x03a1b460
21 #define PHY_ID_AQR105 0x03a1b4a2
22 #define PHY_ID_AQR106 0x03a1b4d0
23 #define PHY_ID_AQR107 0x03a1b4e0
24 #define PHY_ID_AQCS109 0x03a1b5c2
25 #define PHY_ID_AQR405 0x03a1b4b0
26 #define PHY_ID_AQR111 0x03a1b610
27 #define PHY_ID_AQR111B0 0x03a1b612
28 #define PHY_ID_AQR112 0x03a1b662
29 #define PHY_ID_AQR412 0x03a1b712
30 #define PHY_ID_AQR113 0x31c31c40
31 #define PHY_ID_AQR113C 0x31c31c12
32 #define PHY_ID_AQR114C 0x31c31c22
33 #define PHY_ID_AQR115C 0x31c31c33
34 #define PHY_ID_AQR813 0x31c31cb2
36 #define MDIO_PHYXS_VEND_IF_STATUS 0xe812
37 #define MDIO_PHYXS_VEND_IF_STATUS_TYPE_MASK GENMASK(7, 3)
38 #define MDIO_PHYXS_VEND_IF_STATUS_TYPE_KR 0
39 #define MDIO_PHYXS_VEND_IF_STATUS_TYPE_KX 1
40 #define MDIO_PHYXS_VEND_IF_STATUS_TYPE_XFI 2
41 #define MDIO_PHYXS_VEND_IF_STATUS_TYPE_USXGMII 3
42 #define MDIO_PHYXS_VEND_IF_STATUS_TYPE_XAUI 4
43 #define MDIO_PHYXS_VEND_IF_STATUS_TYPE_SGMII 6
44 #define MDIO_PHYXS_VEND_IF_STATUS_TYPE_RXAUI 7
45 #define MDIO_PHYXS_VEND_IF_STATUS_TYPE_OFF 9
46 #define MDIO_PHYXS_VEND_IF_STATUS_TYPE_OCSGMII 10
48 #define MDIO_AN_VEND_PROV 0xc400
49 #define MDIO_AN_VEND_PROV_1000BASET_FULL BIT(15)
50 #define MDIO_AN_VEND_PROV_1000BASET_HALF BIT(14)
51 #define MDIO_AN_VEND_PROV_5000BASET_FULL BIT(11)
52 #define MDIO_AN_VEND_PROV_2500BASET_FULL BIT(10)
53 #define MDIO_AN_VEND_PROV_DOWNSHIFT_EN BIT(4)
54 #define MDIO_AN_VEND_PROV_DOWNSHIFT_MASK GENMASK(3, 0)
55 #define MDIO_AN_VEND_PROV_DOWNSHIFT_DFLT 4
57 #define MDIO_AN_RESVD_VEND_PROV 0xc410
58 #define MDIO_AN_RESVD_VEND_PROV_MDIX_AUTO 0
59 #define MDIO_AN_RESVD_VEND_PROV_MDIX_MDI 1
60 #define MDIO_AN_RESVD_VEND_PROV_MDIX_MDIX 2
61 #define MDIO_AN_RESVD_VEND_PROV_MDIX_MASK GENMASK(1, 0)
63 #define MDIO_AN_TX_VEND_STATUS1 0xc800
64 #define MDIO_AN_TX_VEND_STATUS1_RATE_MASK GENMASK(3, 1)
65 #define MDIO_AN_TX_VEND_STATUS1_10BASET 0
66 #define MDIO_AN_TX_VEND_STATUS1_100BASETX 1
67 #define MDIO_AN_TX_VEND_STATUS1_1000BASET 2
68 #define MDIO_AN_TX_VEND_STATUS1_10GBASET 3
69 #define MDIO_AN_TX_VEND_STATUS1_2500BASET 4
70 #define MDIO_AN_TX_VEND_STATUS1_5000BASET 5
71 #define MDIO_AN_TX_VEND_STATUS1_FULL_DUPLEX BIT(0)
73 #define MDIO_AN_RESVD_VEND_STATUS1 0xc810
74 #define MDIO_AN_RESVD_VEND_STATUS1_MDIX BIT(8)
76 #define MDIO_AN_TX_VEND_INT_STATUS1 0xcc00
77 #define MDIO_AN_TX_VEND_INT_STATUS1_DOWNSHIFT BIT(1)
79 #define MDIO_AN_TX_VEND_INT_STATUS2 0xcc01
80 #define MDIO_AN_TX_VEND_INT_STATUS2_MASK BIT(0)
82 #define MDIO_AN_TX_VEND_INT_MASK2 0xd401
83 #define MDIO_AN_TX_VEND_INT_MASK2_LINK BIT(0)
85 #define PMAPMD_RSVD_VEND_PROV 0xe400
86 #define PMAPMD_RSVD_VEND_PROV_MDI_CONF GENMASK(1, 0)
87 #define PMAPMD_RSVD_VEND_PROV_MDI_REVERSE BIT(0)
88 #define PMAPMD_RSVD_VEND_PROV_MDI_FORCE BIT(1)
90 #define MDIO_AN_RX_LP_STAT1 0xe820
91 #define MDIO_AN_RX_LP_STAT1_1000BASET_FULL BIT(15)
92 #define MDIO_AN_RX_LP_STAT1_1000BASET_HALF BIT(14)
93 #define MDIO_AN_RX_LP_STAT1_SHORT_REACH BIT(13)
94 #define MDIO_AN_RX_LP_STAT1_AQRATE_DOWNSHIFT BIT(12)
95 #define MDIO_AN_RX_LP_STAT1_AQ_PHY BIT(2)
97 #define MDIO_AN_RX_LP_STAT4 0xe823
98 #define MDIO_AN_RX_LP_STAT4_FW_MAJOR GENMASK(15, 8)
99 #define MDIO_AN_RX_LP_STAT4_FW_MINOR GENMASK(7, 0)
101 #define MDIO_AN_RX_VEND_STAT3 0xe832
102 #define MDIO_AN_RX_VEND_STAT3_AFR BIT(0)
104 /* Sleep and timeout for checking if the Processor-Intensive
105 * MDIO operation is finished
107 #define AQR107_OP_IN_PROG_SLEEP 1000
108 #define AQR107_OP_IN_PROG_TIMEOUT 100000
110 static int aqr107_get_sset_count(struct phy_device
*phydev
)
112 return AQR107_SGMII_STAT_SZ
;
115 static void aqr107_get_strings(struct phy_device
*phydev
, u8
*data
)
119 for (i
= 0; i
< AQR107_SGMII_STAT_SZ
; i
++)
120 strscpy(data
+ i
* ETH_GSTRING_LEN
, aqr107_hw_stats
[i
].name
,
124 static u64
aqr107_get_stat(struct phy_device
*phydev
, int index
)
126 const struct aqr107_hw_stat
*stat
= aqr107_hw_stats
+ index
;
127 int len_l
= min(stat
->size
, 16);
128 int len_h
= stat
->size
- len_l
;
132 val
= phy_read_mmd(phydev
, MDIO_MMD_C22EXT
, stat
->reg
);
136 ret
= val
& GENMASK(len_l
- 1, 0);
138 val
= phy_read_mmd(phydev
, MDIO_MMD_C22EXT
, stat
->reg
+ 1);
142 ret
+= (val
& GENMASK(len_h
- 1, 0)) << 16;
148 static void aqr107_get_stats(struct phy_device
*phydev
,
149 struct ethtool_stats
*stats
, u64
*data
)
151 struct aqr107_priv
*priv
= phydev
->priv
;
155 for (i
= 0; i
< AQR107_SGMII_STAT_SZ
; i
++) {
156 val
= aqr107_get_stat(phydev
, i
);
158 phydev_err(phydev
, "Reading HW Statistics failed for %s\n",
159 aqr107_hw_stats
[i
].name
);
161 priv
->sgmii_stats
[i
] += val
;
163 data
[i
] = priv
->sgmii_stats
[i
];
167 static int aqr_set_mdix(struct phy_device
*phydev
, int mdix
)
173 val
= MDIO_AN_RESVD_VEND_PROV_MDIX_MDI
;
176 val
= MDIO_AN_RESVD_VEND_PROV_MDIX_MDIX
;
178 case ETH_TP_MDI_AUTO
:
179 case ETH_TP_MDI_INVALID
:
181 val
= MDIO_AN_RESVD_VEND_PROV_MDIX_AUTO
;
185 return phy_modify_mmd_changed(phydev
, MDIO_MMD_AN
, MDIO_AN_RESVD_VEND_PROV
,
186 MDIO_AN_RESVD_VEND_PROV_MDIX_MASK
, val
);
189 static int aqr_config_aneg(struct phy_device
*phydev
)
191 bool changed
= false;
195 ret
= aqr_set_mdix(phydev
, phydev
->mdix_ctrl
);
201 if (phydev
->autoneg
== AUTONEG_DISABLE
)
202 return genphy_c45_pma_setup_forced(phydev
);
204 ret
= genphy_c45_an_config_aneg(phydev
);
210 /* Clause 45 has no standardized support for 1000BaseT, therefore
211 * use vendor registers for this mode.
214 if (linkmode_test_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT
,
215 phydev
->advertising
))
216 reg
|= MDIO_AN_VEND_PROV_1000BASET_FULL
;
218 if (linkmode_test_bit(ETHTOOL_LINK_MODE_1000baseT_Half_BIT
,
219 phydev
->advertising
))
220 reg
|= MDIO_AN_VEND_PROV_1000BASET_HALF
;
222 /* Handle the case when the 2.5G and 5G speeds are not advertised */
223 if (linkmode_test_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT
,
224 phydev
->advertising
))
225 reg
|= MDIO_AN_VEND_PROV_2500BASET_FULL
;
227 if (linkmode_test_bit(ETHTOOL_LINK_MODE_5000baseT_Full_BIT
,
228 phydev
->advertising
))
229 reg
|= MDIO_AN_VEND_PROV_5000BASET_FULL
;
231 ret
= phy_modify_mmd_changed(phydev
, MDIO_MMD_AN
, MDIO_AN_VEND_PROV
,
232 MDIO_AN_VEND_PROV_1000BASET_HALF
|
233 MDIO_AN_VEND_PROV_1000BASET_FULL
|
234 MDIO_AN_VEND_PROV_2500BASET_FULL
|
235 MDIO_AN_VEND_PROV_5000BASET_FULL
, reg
);
241 return genphy_c45_check_and_restart_aneg(phydev
, changed
);
244 static int aqr_config_intr(struct phy_device
*phydev
)
246 bool en
= phydev
->interrupts
== PHY_INTERRUPT_ENABLED
;
250 /* Clear any pending interrupts before enabling them */
251 err
= phy_read_mmd(phydev
, MDIO_MMD_AN
, MDIO_AN_TX_VEND_INT_STATUS2
);
256 err
= phy_write_mmd(phydev
, MDIO_MMD_AN
, MDIO_AN_TX_VEND_INT_MASK2
,
257 en
? MDIO_AN_TX_VEND_INT_MASK2_LINK
: 0);
261 err
= phy_write_mmd(phydev
, MDIO_MMD_VEND1
, VEND1_GLOBAL_INT_STD_MASK
,
262 en
? VEND1_GLOBAL_INT_STD_MASK_ALL
: 0);
266 err
= phy_write_mmd(phydev
, MDIO_MMD_VEND1
, VEND1_GLOBAL_INT_VEND_MASK
,
267 en
? VEND1_GLOBAL_INT_VEND_MASK_GLOBAL3
|
268 VEND1_GLOBAL_INT_VEND_MASK_AN
: 0);
273 /* Clear any pending interrupts after we have disabled them */
274 err
= phy_read_mmd(phydev
, MDIO_MMD_AN
, MDIO_AN_TX_VEND_INT_STATUS2
);
282 static irqreturn_t
aqr_handle_interrupt(struct phy_device
*phydev
)
286 irq_status
= phy_read_mmd(phydev
, MDIO_MMD_AN
,
287 MDIO_AN_TX_VEND_INT_STATUS2
);
288 if (irq_status
< 0) {
293 if (!(irq_status
& MDIO_AN_TX_VEND_INT_STATUS2_MASK
))
296 phy_trigger_machine(phydev
);
301 static int aqr_read_status(struct phy_device
*phydev
)
305 if (phydev
->autoneg
== AUTONEG_ENABLE
) {
306 val
= phy_read_mmd(phydev
, MDIO_MMD_AN
, MDIO_AN_RX_LP_STAT1
);
310 linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT
,
311 phydev
->lp_advertising
,
312 val
& MDIO_AN_RX_LP_STAT1_1000BASET_FULL
);
313 linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseT_Half_BIT
,
314 phydev
->lp_advertising
,
315 val
& MDIO_AN_RX_LP_STAT1_1000BASET_HALF
);
318 val
= genphy_c45_aneg_done(phydev
);
322 val
= phy_read_mmd(phydev
, MDIO_MMD_AN
, MDIO_AN_RESVD_VEND_STATUS1
);
325 if (val
& MDIO_AN_RESVD_VEND_STATUS1_MDIX
)
326 phydev
->mdix
= ETH_TP_MDI_X
;
328 phydev
->mdix
= ETH_TP_MDI
;
330 phydev
->mdix
= ETH_TP_MDI_INVALID
;
333 return genphy_c45_read_status(phydev
);
336 static int aqr107_read_rate(struct phy_device
*phydev
)
341 val
= phy_read_mmd(phydev
, MDIO_MMD_AN
, MDIO_AN_TX_VEND_STATUS1
);
345 if (val
& MDIO_AN_TX_VEND_STATUS1_FULL_DUPLEX
)
346 phydev
->duplex
= DUPLEX_FULL
;
348 phydev
->duplex
= DUPLEX_HALF
;
350 switch (FIELD_GET(MDIO_AN_TX_VEND_STATUS1_RATE_MASK
, val
)) {
351 case MDIO_AN_TX_VEND_STATUS1_10BASET
:
352 phydev
->speed
= SPEED_10
;
353 config_reg
= VEND1_GLOBAL_CFG_10M
;
355 case MDIO_AN_TX_VEND_STATUS1_100BASETX
:
356 phydev
->speed
= SPEED_100
;
357 config_reg
= VEND1_GLOBAL_CFG_100M
;
359 case MDIO_AN_TX_VEND_STATUS1_1000BASET
:
360 phydev
->speed
= SPEED_1000
;
361 config_reg
= VEND1_GLOBAL_CFG_1G
;
363 case MDIO_AN_TX_VEND_STATUS1_2500BASET
:
364 phydev
->speed
= SPEED_2500
;
365 config_reg
= VEND1_GLOBAL_CFG_2_5G
;
367 case MDIO_AN_TX_VEND_STATUS1_5000BASET
:
368 phydev
->speed
= SPEED_5000
;
369 config_reg
= VEND1_GLOBAL_CFG_5G
;
371 case MDIO_AN_TX_VEND_STATUS1_10GBASET
:
372 phydev
->speed
= SPEED_10000
;
373 config_reg
= VEND1_GLOBAL_CFG_10G
;
376 phydev
->speed
= SPEED_UNKNOWN
;
380 val
= phy_read_mmd(phydev
, MDIO_MMD_VEND1
, config_reg
);
384 if (FIELD_GET(VEND1_GLOBAL_CFG_RATE_ADAPT
, val
) ==
385 VEND1_GLOBAL_CFG_RATE_ADAPT_PAUSE
)
386 phydev
->rate_matching
= RATE_MATCH_PAUSE
;
388 phydev
->rate_matching
= RATE_MATCH_NONE
;
393 static int aqr107_read_status(struct phy_device
*phydev
)
397 ret
= aqr_read_status(phydev
);
401 if (!phydev
->link
|| phydev
->autoneg
== AUTONEG_DISABLE
)
405 * The status register is not immediately correct on line side link up.
406 * Poll periodically until it reflects the correct ON state.
407 * Only return fail for read error, timeout defaults to OFF state.
409 ret
= phy_read_mmd_poll_timeout(phydev
, MDIO_MMD_PHYXS
,
410 MDIO_PHYXS_VEND_IF_STATUS
, val
,
411 (FIELD_GET(MDIO_PHYXS_VEND_IF_STATUS_TYPE_MASK
, val
) !=
412 MDIO_PHYXS_VEND_IF_STATUS_TYPE_OFF
),
413 AQR107_OP_IN_PROG_SLEEP
,
414 AQR107_OP_IN_PROG_TIMEOUT
, false);
415 if (ret
&& ret
!= -ETIMEDOUT
)
418 switch (FIELD_GET(MDIO_PHYXS_VEND_IF_STATUS_TYPE_MASK
, val
)) {
419 case MDIO_PHYXS_VEND_IF_STATUS_TYPE_KR
:
420 phydev
->interface
= PHY_INTERFACE_MODE_10GKR
;
422 case MDIO_PHYXS_VEND_IF_STATUS_TYPE_KX
:
423 phydev
->interface
= PHY_INTERFACE_MODE_1000BASEKX
;
425 case MDIO_PHYXS_VEND_IF_STATUS_TYPE_XFI
:
426 phydev
->interface
= PHY_INTERFACE_MODE_10GBASER
;
428 case MDIO_PHYXS_VEND_IF_STATUS_TYPE_USXGMII
:
429 phydev
->interface
= PHY_INTERFACE_MODE_USXGMII
;
431 case MDIO_PHYXS_VEND_IF_STATUS_TYPE_XAUI
:
432 phydev
->interface
= PHY_INTERFACE_MODE_XAUI
;
434 case MDIO_PHYXS_VEND_IF_STATUS_TYPE_SGMII
:
435 phydev
->interface
= PHY_INTERFACE_MODE_SGMII
;
437 case MDIO_PHYXS_VEND_IF_STATUS_TYPE_RXAUI
:
438 phydev
->interface
= PHY_INTERFACE_MODE_RXAUI
;
440 case MDIO_PHYXS_VEND_IF_STATUS_TYPE_OCSGMII
:
441 phydev
->interface
= PHY_INTERFACE_MODE_2500BASEX
;
443 case MDIO_PHYXS_VEND_IF_STATUS_TYPE_OFF
:
445 phydev
->link
= false;
446 phydev
->interface
= PHY_INTERFACE_MODE_NA
;
450 /* Read possibly downshifted rate from vendor register */
451 return aqr107_read_rate(phydev
);
454 static int aqr107_get_downshift(struct phy_device
*phydev
, u8
*data
)
456 int val
, cnt
, enable
;
458 val
= phy_read_mmd(phydev
, MDIO_MMD_AN
, MDIO_AN_VEND_PROV
);
462 enable
= FIELD_GET(MDIO_AN_VEND_PROV_DOWNSHIFT_EN
, val
);
463 cnt
= FIELD_GET(MDIO_AN_VEND_PROV_DOWNSHIFT_MASK
, val
);
465 *data
= enable
&& cnt
? cnt
: DOWNSHIFT_DEV_DISABLE
;
470 static int aqr107_set_downshift(struct phy_device
*phydev
, u8 cnt
)
474 if (!FIELD_FIT(MDIO_AN_VEND_PROV_DOWNSHIFT_MASK
, cnt
))
477 if (cnt
!= DOWNSHIFT_DEV_DISABLE
) {
478 val
= MDIO_AN_VEND_PROV_DOWNSHIFT_EN
;
479 val
|= FIELD_PREP(MDIO_AN_VEND_PROV_DOWNSHIFT_MASK
, cnt
);
482 return phy_modify_mmd(phydev
, MDIO_MMD_AN
, MDIO_AN_VEND_PROV
,
483 MDIO_AN_VEND_PROV_DOWNSHIFT_EN
|
484 MDIO_AN_VEND_PROV_DOWNSHIFT_MASK
, val
);
487 static int aqr107_get_tunable(struct phy_device
*phydev
,
488 struct ethtool_tunable
*tuna
, void *data
)
491 case ETHTOOL_PHY_DOWNSHIFT
:
492 return aqr107_get_downshift(phydev
, data
);
498 static int aqr107_set_tunable(struct phy_device
*phydev
,
499 struct ethtool_tunable
*tuna
, const void *data
)
502 case ETHTOOL_PHY_DOWNSHIFT
:
503 return aqr107_set_downshift(phydev
, *(const u8
*)data
);
509 #define AQR_FW_WAIT_SLEEP_US 20000
510 #define AQR_FW_WAIT_TIMEOUT_US 2000000
512 /* If we configure settings whilst firmware is still initializing the chip,
513 * then these settings may be overwritten. Therefore make sure chip
514 * initialization has completed. Use presence of the firmware ID as
515 * indicator for initialization having completed.
516 * The chip also provides a "reset completed" bit, but it's cleared after
517 * read. Therefore function would time out if called again.
519 int aqr_wait_reset_complete(struct phy_device
*phydev
)
523 ret
= read_poll_timeout(phy_read_mmd
, val
, val
!= 0,
524 AQR_FW_WAIT_SLEEP_US
, AQR_FW_WAIT_TIMEOUT_US
,
525 false, phydev
, MDIO_MMD_VEND1
,
528 phydev_err(phydev
, "Failed to read VEND1_GLOBAL_FW_ID: %pe\n",
536 static void aqr107_chip_info(struct phy_device
*phydev
)
538 u8 fw_major
, fw_minor
, build_id
, prov_id
;
541 val
= phy_read_mmd(phydev
, MDIO_MMD_VEND1
, VEND1_GLOBAL_FW_ID
);
545 fw_major
= FIELD_GET(VEND1_GLOBAL_FW_ID_MAJOR
, val
);
546 fw_minor
= FIELD_GET(VEND1_GLOBAL_FW_ID_MINOR
, val
);
548 val
= phy_read_mmd(phydev
, MDIO_MMD_VEND1
, VEND1_GLOBAL_RSVD_STAT1
);
552 build_id
= FIELD_GET(VEND1_GLOBAL_RSVD_STAT1_FW_BUILD_ID
, val
);
553 prov_id
= FIELD_GET(VEND1_GLOBAL_RSVD_STAT1_PROV_ID
, val
);
555 phydev_dbg(phydev
, "FW %u.%u, Build %u, Provisioning %u\n",
556 fw_major
, fw_minor
, build_id
, prov_id
);
559 static int aqr107_config_mdi(struct phy_device
*phydev
)
561 struct device_node
*np
= phydev
->mdio
.dev
.of_node
;
565 ret
= of_property_read_u32(np
, "marvell,mdi-cfg-order", &mdi_conf
);
567 /* Do nothing in case property "marvell,mdi-cfg-order" is not present */
568 if (ret
== -EINVAL
|| ret
== -ENOSYS
)
574 if (mdi_conf
& ~PMAPMD_RSVD_VEND_PROV_MDI_REVERSE
)
577 return phy_modify_mmd(phydev
, MDIO_MMD_PMAPMD
, PMAPMD_RSVD_VEND_PROV
,
578 PMAPMD_RSVD_VEND_PROV_MDI_CONF
,
579 mdi_conf
| PMAPMD_RSVD_VEND_PROV_MDI_FORCE
);
582 static int aqr107_config_init(struct phy_device
*phydev
)
584 struct aqr107_priv
*priv
= phydev
->priv
;
588 /* Check that the PHY interface type is compatible */
589 if (phydev
->interface
!= PHY_INTERFACE_MODE_SGMII
&&
590 phydev
->interface
!= PHY_INTERFACE_MODE_1000BASEKX
&&
591 phydev
->interface
!= PHY_INTERFACE_MODE_2500BASEX
&&
592 phydev
->interface
!= PHY_INTERFACE_MODE_XGMII
&&
593 phydev
->interface
!= PHY_INTERFACE_MODE_USXGMII
&&
594 phydev
->interface
!= PHY_INTERFACE_MODE_10GKR
&&
595 phydev
->interface
!= PHY_INTERFACE_MODE_10GBASER
&&
596 phydev
->interface
!= PHY_INTERFACE_MODE_XAUI
&&
597 phydev
->interface
!= PHY_INTERFACE_MODE_RXAUI
)
600 WARN(phydev
->interface
== PHY_INTERFACE_MODE_XGMII
,
601 "Your devicetree is out of date, please update it. The AQR107 family doesn't support XGMII, maybe you mean USXGMII.\n");
603 ret
= aqr_wait_reset_complete(phydev
);
605 aqr107_chip_info(phydev
);
607 ret
= aqr107_set_downshift(phydev
, MDIO_AN_VEND_PROV_DOWNSHIFT_DFLT
);
611 ret
= aqr107_config_mdi(phydev
);
615 /* Restore LED polarity state after reset */
616 for_each_set_bit(led_idx
, &priv
->leds_active_low
, AQR_MAX_LEDS
) {
617 ret
= aqr_phy_led_active_low_set(phydev
, led_idx
, true);
622 for_each_set_bit(led_idx
, &priv
->leds_active_high
, AQR_MAX_LEDS
) {
623 ret
= aqr_phy_led_active_low_set(phydev
, led_idx
, false);
631 static int aqcs109_config_init(struct phy_device
*phydev
)
635 /* Check that the PHY interface type is compatible */
636 if (phydev
->interface
!= PHY_INTERFACE_MODE_SGMII
&&
637 phydev
->interface
!= PHY_INTERFACE_MODE_2500BASEX
)
640 ret
= aqr_wait_reset_complete(phydev
);
642 aqr107_chip_info(phydev
);
644 return aqr107_set_downshift(phydev
, MDIO_AN_VEND_PROV_DOWNSHIFT_DFLT
);
647 static void aqr107_link_change_notify(struct phy_device
*phydev
)
649 u8 fw_major
, fw_minor
;
650 bool downshift
, short_reach
, afr
;
653 if (phydev
->state
!= PHY_RUNNING
|| phydev
->autoneg
== AUTONEG_DISABLE
)
656 val
= phy_read_mmd(phydev
, MDIO_MMD_AN
, MDIO_AN_RX_LP_STAT1
);
657 /* call failed or link partner is no Aquantia PHY */
658 if (val
< 0 || !(val
& MDIO_AN_RX_LP_STAT1_AQ_PHY
))
661 short_reach
= val
& MDIO_AN_RX_LP_STAT1_SHORT_REACH
;
662 downshift
= val
& MDIO_AN_RX_LP_STAT1_AQRATE_DOWNSHIFT
;
664 val
= phy_read_mmd(phydev
, MDIO_MMD_AN
, MDIO_AN_RX_LP_STAT4
);
668 fw_major
= FIELD_GET(MDIO_AN_RX_LP_STAT4_FW_MAJOR
, val
);
669 fw_minor
= FIELD_GET(MDIO_AN_RX_LP_STAT4_FW_MINOR
, val
);
671 val
= phy_read_mmd(phydev
, MDIO_MMD_AN
, MDIO_AN_RX_VEND_STAT3
);
675 afr
= val
& MDIO_AN_RX_VEND_STAT3_AFR
;
677 phydev_dbg(phydev
, "Link partner is Aquantia PHY, FW %u.%u%s%s%s\n",
679 short_reach
? ", short reach mode" : "",
680 downshift
? ", fast-retrain downshift advertised" : "",
681 afr
? ", fast reframe advertised" : "");
683 val
= phy_read_mmd(phydev
, MDIO_MMD_VEND1
, VEND1_GLOBAL_RSVD_STAT9
);
687 mode
= FIELD_GET(VEND1_GLOBAL_RSVD_STAT9_MODE
, val
);
688 if (mode
== VEND1_GLOBAL_RSVD_STAT9_1000BT2
)
689 phydev_info(phydev
, "Aquantia 1000Base-T2 mode active\n");
692 static int aqr107_wait_processor_intensive_op(struct phy_device
*phydev
)
696 /* The datasheet notes to wait at least 1ms after issuing a
697 * processor intensive operation before checking.
698 * We cannot use the 'sleep_before_read' parameter of read_poll_timeout
699 * because that just determines the maximum time slept, not the minimum.
701 usleep_range(1000, 5000);
703 err
= phy_read_mmd_poll_timeout(phydev
, MDIO_MMD_VEND1
,
704 VEND1_GLOBAL_GEN_STAT2
, val
,
705 !(val
& VEND1_GLOBAL_GEN_STAT2_OP_IN_PROG
),
706 AQR107_OP_IN_PROG_SLEEP
,
707 AQR107_OP_IN_PROG_TIMEOUT
, false);
709 phydev_err(phydev
, "timeout: processor-intensive MDIO operation\n");
716 static int aqr107_get_rate_matching(struct phy_device
*phydev
,
717 phy_interface_t iface
)
719 if (iface
== PHY_INTERFACE_MODE_10GBASER
||
720 iface
== PHY_INTERFACE_MODE_2500BASEX
||
721 iface
== PHY_INTERFACE_MODE_NA
)
722 return RATE_MATCH_PAUSE
;
723 return RATE_MATCH_NONE
;
726 static int aqr107_suspend(struct phy_device
*phydev
)
730 err
= phy_set_bits_mmd(phydev
, MDIO_MMD_VEND1
, MDIO_CTRL1
,
735 return aqr107_wait_processor_intensive_op(phydev
);
738 static int aqr107_resume(struct phy_device
*phydev
)
742 err
= phy_clear_bits_mmd(phydev
, MDIO_MMD_VEND1
, MDIO_CTRL1
,
747 return aqr107_wait_processor_intensive_op(phydev
);
750 static const u16 aqr_global_cfg_regs
[] = {
751 VEND1_GLOBAL_CFG_10M
,
752 VEND1_GLOBAL_CFG_100M
,
754 VEND1_GLOBAL_CFG_2_5G
,
759 static int aqr107_fill_interface_modes(struct phy_device
*phydev
)
761 unsigned long *possible
= phydev
->possible_interfaces
;
762 unsigned int serdes_mode
, rate_adapt
;
763 phy_interface_t interface
;
766 /* Walk the media-speed configuration registers to determine which
767 * host-side serdes modes may be used by the PHY depending on the
768 * negotiated media speed.
770 for (i
= 0; i
< ARRAY_SIZE(aqr_global_cfg_regs
); i
++) {
771 val
= phy_read_mmd(phydev
, MDIO_MMD_VEND1
,
772 aqr_global_cfg_regs
[i
]);
776 serdes_mode
= FIELD_GET(VEND1_GLOBAL_CFG_SERDES_MODE
, val
);
777 rate_adapt
= FIELD_GET(VEND1_GLOBAL_CFG_RATE_ADAPT
, val
);
779 switch (serdes_mode
) {
780 case VEND1_GLOBAL_CFG_SERDES_MODE_XFI
:
781 if (rate_adapt
== VEND1_GLOBAL_CFG_RATE_ADAPT_USX
)
782 interface
= PHY_INTERFACE_MODE_USXGMII
;
784 interface
= PHY_INTERFACE_MODE_10GBASER
;
787 case VEND1_GLOBAL_CFG_SERDES_MODE_XFI5G
:
788 interface
= PHY_INTERFACE_MODE_5GBASER
;
791 case VEND1_GLOBAL_CFG_SERDES_MODE_OCSGMII
:
792 interface
= PHY_INTERFACE_MODE_2500BASEX
;
795 case VEND1_GLOBAL_CFG_SERDES_MODE_SGMII
:
796 interface
= PHY_INTERFACE_MODE_SGMII
;
800 phydev_warn(phydev
, "unrecognised serdes mode %u\n",
802 interface
= PHY_INTERFACE_MODE_NA
;
806 if (interface
!= PHY_INTERFACE_MODE_NA
)
807 __set_bit(interface
, possible
);
813 static int aqr113c_fill_interface_modes(struct phy_device
*phydev
)
817 /* It's been observed on some models that - when coming out of suspend
818 * - the FW signals that the PHY is ready but the GLOBAL_CFG registers
819 * continue on returning zeroes for some time. Let's poll the 100M
820 * register until it returns a real value as both 113c and 115c support
823 ret
= phy_read_mmd_poll_timeout(phydev
, MDIO_MMD_VEND1
,
824 VEND1_GLOBAL_CFG_100M
, val
, val
!= 0,
825 1000, 100000, false);
829 return aqr107_fill_interface_modes(phydev
);
832 static int aqr115c_get_features(struct phy_device
*phydev
)
834 unsigned long *supported
= phydev
->supported
;
836 /* PHY supports speeds up to 2.5G with autoneg. PMA capabilities
839 linkmode_or(supported
, supported
, phy_gbit_features
);
840 linkmode_set_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT
, supported
);
845 static int aqr111_get_features(struct phy_device
*phydev
)
847 /* PHY supports speeds up to 5G with autoneg. PMA capabilities
850 aqr115c_get_features(phydev
);
851 linkmode_set_bit(ETHTOOL_LINK_MODE_5000baseT_Full_BIT
,
857 static int aqr113c_config_init(struct phy_device
*phydev
)
861 ret
= aqr107_config_init(phydev
);
865 ret
= phy_clear_bits_mmd(phydev
, MDIO_MMD_PMAPMD
, MDIO_PMA_TXDIS
,
866 MDIO_PMD_TXDIS_GLOBAL
);
870 ret
= aqr107_wait_processor_intensive_op(phydev
);
874 return aqr113c_fill_interface_modes(phydev
);
877 static int aqr107_probe(struct phy_device
*phydev
)
881 phydev
->priv
= devm_kzalloc(&phydev
->mdio
.dev
,
882 sizeof(struct aqr107_priv
), GFP_KERNEL
);
886 ret
= aqr_firmware_load(phydev
);
890 return aqr_hwmon_probe(phydev
);
894 static struct phy_driver aqr_driver
[] = {
896 PHY_ID_MATCH_MODEL(PHY_ID_AQ1202
),
897 .name
= "Aquantia AQ1202",
898 .config_aneg
= aqr_config_aneg
,
899 .config_intr
= aqr_config_intr
,
900 .handle_interrupt
= aqr_handle_interrupt
,
901 .read_status
= aqr_read_status
,
904 PHY_ID_MATCH_MODEL(PHY_ID_AQ2104
),
905 .name
= "Aquantia AQ2104",
906 .config_aneg
= aqr_config_aneg
,
907 .config_intr
= aqr_config_intr
,
908 .handle_interrupt
= aqr_handle_interrupt
,
909 .read_status
= aqr_read_status
,
912 PHY_ID_MATCH_MODEL(PHY_ID_AQR105
),
913 .name
= "Aquantia AQR105",
914 .config_aneg
= aqr_config_aneg
,
915 .config_intr
= aqr_config_intr
,
916 .handle_interrupt
= aqr_handle_interrupt
,
917 .read_status
= aqr_read_status
,
918 .suspend
= aqr107_suspend
,
919 .resume
= aqr107_resume
,
922 PHY_ID_MATCH_MODEL(PHY_ID_AQR106
),
923 .name
= "Aquantia AQR106",
924 .config_aneg
= aqr_config_aneg
,
925 .config_intr
= aqr_config_intr
,
926 .handle_interrupt
= aqr_handle_interrupt
,
927 .read_status
= aqr_read_status
,
930 PHY_ID_MATCH_MODEL(PHY_ID_AQR107
),
931 .name
= "Aquantia AQR107",
932 .probe
= aqr107_probe
,
933 .get_rate_matching
= aqr107_get_rate_matching
,
934 .config_init
= aqr107_config_init
,
935 .config_aneg
= aqr_config_aneg
,
936 .config_intr
= aqr_config_intr
,
937 .handle_interrupt
= aqr_handle_interrupt
,
938 .read_status
= aqr107_read_status
,
939 .get_tunable
= aqr107_get_tunable
,
940 .set_tunable
= aqr107_set_tunable
,
941 .suspend
= aqr107_suspend
,
942 .resume
= aqr107_resume
,
943 .get_sset_count
= aqr107_get_sset_count
,
944 .get_strings
= aqr107_get_strings
,
945 .get_stats
= aqr107_get_stats
,
946 .link_change_notify
= aqr107_link_change_notify
,
947 .led_brightness_set
= aqr_phy_led_brightness_set
,
948 .led_hw_is_supported
= aqr_phy_led_hw_is_supported
,
949 .led_hw_control_set
= aqr_phy_led_hw_control_set
,
950 .led_hw_control_get
= aqr_phy_led_hw_control_get
,
951 .led_polarity_set
= aqr_phy_led_polarity_set
,
954 PHY_ID_MATCH_MODEL(PHY_ID_AQCS109
),
955 .name
= "Aquantia AQCS109",
956 .probe
= aqr107_probe
,
957 .get_rate_matching
= aqr107_get_rate_matching
,
958 .config_init
= aqcs109_config_init
,
959 .config_aneg
= aqr_config_aneg
,
960 .config_intr
= aqr_config_intr
,
961 .handle_interrupt
= aqr_handle_interrupt
,
962 .read_status
= aqr107_read_status
,
963 .get_tunable
= aqr107_get_tunable
,
964 .set_tunable
= aqr107_set_tunable
,
965 .suspend
= aqr107_suspend
,
966 .resume
= aqr107_resume
,
967 .get_sset_count
= aqr107_get_sset_count
,
968 .get_strings
= aqr107_get_strings
,
969 .get_stats
= aqr107_get_stats
,
970 .get_features
= aqr115c_get_features
,
971 .link_change_notify
= aqr107_link_change_notify
,
972 .led_brightness_set
= aqr_phy_led_brightness_set
,
973 .led_hw_is_supported
= aqr_phy_led_hw_is_supported
,
974 .led_hw_control_set
= aqr_phy_led_hw_control_set
,
975 .led_hw_control_get
= aqr_phy_led_hw_control_get
,
976 .led_polarity_set
= aqr_phy_led_polarity_set
,
979 PHY_ID_MATCH_MODEL(PHY_ID_AQR111
),
980 .name
= "Aquantia AQR111",
981 .probe
= aqr107_probe
,
982 .get_rate_matching
= aqr107_get_rate_matching
,
983 .config_init
= aqr107_config_init
,
984 .config_aneg
= aqr_config_aneg
,
985 .config_intr
= aqr_config_intr
,
986 .handle_interrupt
= aqr_handle_interrupt
,
987 .read_status
= aqr107_read_status
,
988 .get_tunable
= aqr107_get_tunable
,
989 .set_tunable
= aqr107_set_tunable
,
990 .suspend
= aqr107_suspend
,
991 .resume
= aqr107_resume
,
992 .get_sset_count
= aqr107_get_sset_count
,
993 .get_strings
= aqr107_get_strings
,
994 .get_stats
= aqr107_get_stats
,
995 .get_features
= aqr111_get_features
,
996 .link_change_notify
= aqr107_link_change_notify
,
997 .led_brightness_set
= aqr_phy_led_brightness_set
,
998 .led_hw_is_supported
= aqr_phy_led_hw_is_supported
,
999 .led_hw_control_set
= aqr_phy_led_hw_control_set
,
1000 .led_hw_control_get
= aqr_phy_led_hw_control_get
,
1001 .led_polarity_set
= aqr_phy_led_polarity_set
,
1004 PHY_ID_MATCH_MODEL(PHY_ID_AQR111B0
),
1005 .name
= "Aquantia AQR111B0",
1006 .probe
= aqr107_probe
,
1007 .get_rate_matching
= aqr107_get_rate_matching
,
1008 .config_init
= aqr107_config_init
,
1009 .config_aneg
= aqr_config_aneg
,
1010 .config_intr
= aqr_config_intr
,
1011 .handle_interrupt
= aqr_handle_interrupt
,
1012 .read_status
= aqr107_read_status
,
1013 .get_tunable
= aqr107_get_tunable
,
1014 .set_tunable
= aqr107_set_tunable
,
1015 .suspend
= aqr107_suspend
,
1016 .resume
= aqr107_resume
,
1017 .get_sset_count
= aqr107_get_sset_count
,
1018 .get_strings
= aqr107_get_strings
,
1019 .get_stats
= aqr107_get_stats
,
1020 .get_features
= aqr111_get_features
,
1021 .link_change_notify
= aqr107_link_change_notify
,
1022 .led_brightness_set
= aqr_phy_led_brightness_set
,
1023 .led_hw_is_supported
= aqr_phy_led_hw_is_supported
,
1024 .led_hw_control_set
= aqr_phy_led_hw_control_set
,
1025 .led_hw_control_get
= aqr_phy_led_hw_control_get
,
1026 .led_polarity_set
= aqr_phy_led_polarity_set
,
1029 PHY_ID_MATCH_MODEL(PHY_ID_AQR405
),
1030 .name
= "Aquantia AQR405",
1031 .config_aneg
= aqr_config_aneg
,
1032 .config_intr
= aqr_config_intr
,
1033 .handle_interrupt
= aqr_handle_interrupt
,
1034 .read_status
= aqr_read_status
,
1037 PHY_ID_MATCH_MODEL(PHY_ID_AQR112
),
1038 .name
= "Aquantia AQR112",
1039 .probe
= aqr107_probe
,
1040 .config_aneg
= aqr_config_aneg
,
1041 .config_intr
= aqr_config_intr
,
1042 .handle_interrupt
= aqr_handle_interrupt
,
1043 .get_tunable
= aqr107_get_tunable
,
1044 .set_tunable
= aqr107_set_tunable
,
1045 .suspend
= aqr107_suspend
,
1046 .resume
= aqr107_resume
,
1047 .read_status
= aqr107_read_status
,
1048 .get_rate_matching
= aqr107_get_rate_matching
,
1049 .get_sset_count
= aqr107_get_sset_count
,
1050 .get_strings
= aqr107_get_strings
,
1051 .get_stats
= aqr107_get_stats
,
1052 .link_change_notify
= aqr107_link_change_notify
,
1053 .led_brightness_set
= aqr_phy_led_brightness_set
,
1054 .led_hw_is_supported
= aqr_phy_led_hw_is_supported
,
1055 .led_hw_control_set
= aqr_phy_led_hw_control_set
,
1056 .led_hw_control_get
= aqr_phy_led_hw_control_get
,
1057 .led_polarity_set
= aqr_phy_led_polarity_set
,
1060 PHY_ID_MATCH_MODEL(PHY_ID_AQR412
),
1061 .name
= "Aquantia AQR412",
1062 .probe
= aqr107_probe
,
1063 .config_aneg
= aqr_config_aneg
,
1064 .config_intr
= aqr_config_intr
,
1065 .handle_interrupt
= aqr_handle_interrupt
,
1066 .get_tunable
= aqr107_get_tunable
,
1067 .set_tunable
= aqr107_set_tunable
,
1068 .suspend
= aqr107_suspend
,
1069 .resume
= aqr107_resume
,
1070 .read_status
= aqr107_read_status
,
1071 .get_rate_matching
= aqr107_get_rate_matching
,
1072 .get_sset_count
= aqr107_get_sset_count
,
1073 .get_strings
= aqr107_get_strings
,
1074 .get_stats
= aqr107_get_stats
,
1075 .link_change_notify
= aqr107_link_change_notify
,
1078 PHY_ID_MATCH_MODEL(PHY_ID_AQR113
),
1079 .name
= "Aquantia AQR113",
1080 .probe
= aqr107_probe
,
1081 .get_rate_matching
= aqr107_get_rate_matching
,
1082 .config_init
= aqr113c_config_init
,
1083 .config_aneg
= aqr_config_aneg
,
1084 .config_intr
= aqr_config_intr
,
1085 .handle_interrupt
= aqr_handle_interrupt
,
1086 .read_status
= aqr107_read_status
,
1087 .get_tunable
= aqr107_get_tunable
,
1088 .set_tunable
= aqr107_set_tunable
,
1089 .suspend
= aqr107_suspend
,
1090 .resume
= aqr107_resume
,
1091 .get_sset_count
= aqr107_get_sset_count
,
1092 .get_strings
= aqr107_get_strings
,
1093 .get_stats
= aqr107_get_stats
,
1094 .link_change_notify
= aqr107_link_change_notify
,
1095 .led_brightness_set
= aqr_phy_led_brightness_set
,
1096 .led_hw_is_supported
= aqr_phy_led_hw_is_supported
,
1097 .led_hw_control_set
= aqr_phy_led_hw_control_set
,
1098 .led_hw_control_get
= aqr_phy_led_hw_control_get
,
1099 .led_polarity_set
= aqr_phy_led_polarity_set
,
1102 PHY_ID_MATCH_MODEL(PHY_ID_AQR113C
),
1103 .name
= "Aquantia AQR113C",
1104 .probe
= aqr107_probe
,
1105 .get_rate_matching
= aqr107_get_rate_matching
,
1106 .config_init
= aqr113c_config_init
,
1107 .config_aneg
= aqr_config_aneg
,
1108 .config_intr
= aqr_config_intr
,
1109 .handle_interrupt
= aqr_handle_interrupt
,
1110 .read_status
= aqr107_read_status
,
1111 .get_tunable
= aqr107_get_tunable
,
1112 .set_tunable
= aqr107_set_tunable
,
1113 .suspend
= aqr107_suspend
,
1114 .resume
= aqr107_resume
,
1115 .get_sset_count
= aqr107_get_sset_count
,
1116 .get_strings
= aqr107_get_strings
,
1117 .get_stats
= aqr107_get_stats
,
1118 .link_change_notify
= aqr107_link_change_notify
,
1119 .led_brightness_set
= aqr_phy_led_brightness_set
,
1120 .led_hw_is_supported
= aqr_phy_led_hw_is_supported
,
1121 .led_hw_control_set
= aqr_phy_led_hw_control_set
,
1122 .led_hw_control_get
= aqr_phy_led_hw_control_get
,
1123 .led_polarity_set
= aqr_phy_led_polarity_set
,
1126 PHY_ID_MATCH_MODEL(PHY_ID_AQR114C
),
1127 .name
= "Aquantia AQR114C",
1128 .probe
= aqr107_probe
,
1129 .get_rate_matching
= aqr107_get_rate_matching
,
1130 .config_init
= aqr107_config_init
,
1131 .config_aneg
= aqr_config_aneg
,
1132 .config_intr
= aqr_config_intr
,
1133 .handle_interrupt
= aqr_handle_interrupt
,
1134 .read_status
= aqr107_read_status
,
1135 .get_tunable
= aqr107_get_tunable
,
1136 .set_tunable
= aqr107_set_tunable
,
1137 .suspend
= aqr107_suspend
,
1138 .resume
= aqr107_resume
,
1139 .get_sset_count
= aqr107_get_sset_count
,
1140 .get_strings
= aqr107_get_strings
,
1141 .get_stats
= aqr107_get_stats
,
1142 .get_features
= aqr111_get_features
,
1143 .link_change_notify
= aqr107_link_change_notify
,
1144 .led_brightness_set
= aqr_phy_led_brightness_set
,
1145 .led_hw_is_supported
= aqr_phy_led_hw_is_supported
,
1146 .led_hw_control_set
= aqr_phy_led_hw_control_set
,
1147 .led_hw_control_get
= aqr_phy_led_hw_control_get
,
1148 .led_polarity_set
= aqr_phy_led_polarity_set
,
1151 PHY_ID_MATCH_MODEL(PHY_ID_AQR115C
),
1152 .name
= "Aquantia AQR115C",
1153 .probe
= aqr107_probe
,
1154 .get_rate_matching
= aqr107_get_rate_matching
,
1155 .config_init
= aqr113c_config_init
,
1156 .config_aneg
= aqr_config_aneg
,
1157 .config_intr
= aqr_config_intr
,
1158 .handle_interrupt
= aqr_handle_interrupt
,
1159 .read_status
= aqr107_read_status
,
1160 .get_tunable
= aqr107_get_tunable
,
1161 .set_tunable
= aqr107_set_tunable
,
1162 .suspend
= aqr107_suspend
,
1163 .resume
= aqr107_resume
,
1164 .get_sset_count
= aqr107_get_sset_count
,
1165 .get_strings
= aqr107_get_strings
,
1166 .get_stats
= aqr107_get_stats
,
1167 .get_features
= aqr115c_get_features
,
1168 .link_change_notify
= aqr107_link_change_notify
,
1169 .led_brightness_set
= aqr_phy_led_brightness_set
,
1170 .led_hw_is_supported
= aqr_phy_led_hw_is_supported
,
1171 .led_hw_control_set
= aqr_phy_led_hw_control_set
,
1172 .led_hw_control_get
= aqr_phy_led_hw_control_get
,
1173 .led_polarity_set
= aqr_phy_led_polarity_set
,
1176 PHY_ID_MATCH_MODEL(PHY_ID_AQR813
),
1177 .name
= "Aquantia AQR813",
1178 .probe
= aqr107_probe
,
1179 .get_rate_matching
= aqr107_get_rate_matching
,
1180 .config_init
= aqr107_config_init
,
1181 .config_aneg
= aqr_config_aneg
,
1182 .config_intr
= aqr_config_intr
,
1183 .handle_interrupt
= aqr_handle_interrupt
,
1184 .read_status
= aqr107_read_status
,
1185 .get_tunable
= aqr107_get_tunable
,
1186 .set_tunable
= aqr107_set_tunable
,
1187 .suspend
= aqr107_suspend
,
1188 .resume
= aqr107_resume
,
1189 .get_sset_count
= aqr107_get_sset_count
,
1190 .get_strings
= aqr107_get_strings
,
1191 .get_stats
= aqr107_get_stats
,
1192 .link_change_notify
= aqr107_link_change_notify
,
1193 .led_brightness_set
= aqr_phy_led_brightness_set
,
1194 .led_hw_is_supported
= aqr_phy_led_hw_is_supported
,
1195 .led_hw_control_set
= aqr_phy_led_hw_control_set
,
1196 .led_hw_control_get
= aqr_phy_led_hw_control_get
,
1197 .led_polarity_set
= aqr_phy_led_polarity_set
,
1201 module_phy_driver(aqr_driver
);
1203 static struct mdio_device_id __maybe_unused aqr_tbl
[] = {
1204 { PHY_ID_MATCH_MODEL(PHY_ID_AQ1202
) },
1205 { PHY_ID_MATCH_MODEL(PHY_ID_AQ2104
) },
1206 { PHY_ID_MATCH_MODEL(PHY_ID_AQR105
) },
1207 { PHY_ID_MATCH_MODEL(PHY_ID_AQR106
) },
1208 { PHY_ID_MATCH_MODEL(PHY_ID_AQR107
) },
1209 { PHY_ID_MATCH_MODEL(PHY_ID_AQCS109
) },
1210 { PHY_ID_MATCH_MODEL(PHY_ID_AQR405
) },
1211 { PHY_ID_MATCH_MODEL(PHY_ID_AQR111
) },
1212 { PHY_ID_MATCH_MODEL(PHY_ID_AQR111B0
) },
1213 { PHY_ID_MATCH_MODEL(PHY_ID_AQR112
) },
1214 { PHY_ID_MATCH_MODEL(PHY_ID_AQR412
) },
1215 { PHY_ID_MATCH_MODEL(PHY_ID_AQR113
) },
1216 { PHY_ID_MATCH_MODEL(PHY_ID_AQR113C
) },
1217 { PHY_ID_MATCH_MODEL(PHY_ID_AQR114C
) },
1218 { PHY_ID_MATCH_MODEL(PHY_ID_AQR115C
) },
1219 { PHY_ID_MATCH_MODEL(PHY_ID_AQR813
) },
1223 MODULE_DEVICE_TABLE(mdio
, aqr_tbl
);
1225 MODULE_DESCRIPTION("Aquantia PHY driver");
1226 MODULE_AUTHOR("Shaohui Xie <Shaohui.Xie@freescale.com>");
1227 MODULE_LICENSE("GPL v2");