Lines Matching +full:phy +full:- +full:pma

1 // SPDX-License-Identifier: GPL-2.0
3 * Driver for Aquantia PHY
14 #include <linux/phy.h>
88 /* Sleep and timeout for checking if the Processor-Intensive
111 int len_l = min(stat->size, 16); in aqr107_get_stat()
112 int len_h = stat->size - len_l; in aqr107_get_stat()
116 val = phy_read_mmd(phydev, MDIO_MMD_C22EXT, stat->reg); in aqr107_get_stat()
120 ret = val & GENMASK(len_l - 1, 0); in aqr107_get_stat()
122 val = phy_read_mmd(phydev, MDIO_MMD_C22EXT, stat->reg + 1); in aqr107_get_stat()
126 ret += (val & GENMASK(len_h - 1, 0)) << 16; in aqr107_get_stat()
135 struct aqr107_priv *priv = phydev->priv; in aqr107_get_stats()
145 priv->sgmii_stats[i] += val; in aqr107_get_stats()
147 data[i] = priv->sgmii_stats[i]; in aqr107_get_stats()
157 if (phydev->autoneg == AUTONEG_DISABLE) in aqr_config_aneg()
171 phydev->advertising)) in aqr_config_aneg()
175 phydev->advertising)) in aqr_config_aneg()
180 phydev->advertising)) in aqr_config_aneg()
184 phydev->advertising)) in aqr_config_aneg()
202 bool en = phydev->interrupts == PHY_INTERRUPT_ENABLED; in aqr_config_intr()
261 if (phydev->autoneg == AUTONEG_ENABLE) { in aqr_read_status()
267 phydev->lp_advertising, in aqr_read_status()
270 phydev->lp_advertising, in aqr_read_status()
287 phydev->duplex = DUPLEX_FULL; in aqr107_read_rate()
289 phydev->duplex = DUPLEX_HALF; in aqr107_read_rate()
293 phydev->speed = SPEED_10; in aqr107_read_rate()
297 phydev->speed = SPEED_100; in aqr107_read_rate()
301 phydev->speed = SPEED_1000; in aqr107_read_rate()
305 phydev->speed = SPEED_2500; in aqr107_read_rate()
309 phydev->speed = SPEED_5000; in aqr107_read_rate()
313 phydev->speed = SPEED_10000; in aqr107_read_rate()
317 phydev->speed = SPEED_UNKNOWN; in aqr107_read_rate()
327 phydev->rate_matching = RATE_MATCH_PAUSE; in aqr107_read_rate()
329 phydev->rate_matching = RATE_MATCH_NONE; in aqr107_read_rate()
342 if (!phydev->link || phydev->autoneg == AUTONEG_DISABLE) in aqr107_read_status()
351 phydev->interface = PHY_INTERFACE_MODE_10GKR; in aqr107_read_status()
354 phydev->interface = PHY_INTERFACE_MODE_1000BASEKX; in aqr107_read_status()
357 phydev->interface = PHY_INTERFACE_MODE_10GBASER; in aqr107_read_status()
360 phydev->interface = PHY_INTERFACE_MODE_USXGMII; in aqr107_read_status()
363 phydev->interface = PHY_INTERFACE_MODE_XAUI; in aqr107_read_status()
366 phydev->interface = PHY_INTERFACE_MODE_SGMII; in aqr107_read_status()
369 phydev->interface = PHY_INTERFACE_MODE_RXAUI; in aqr107_read_status()
372 phydev->interface = PHY_INTERFACE_MODE_2500BASEX; in aqr107_read_status()
375 phydev->interface = PHY_INTERFACE_MODE_NA; in aqr107_read_status()
404 return -E2BIG; in aqr107_set_downshift()
419 switch (tuna->id) { in aqr107_get_tunable()
423 return -EOPNOTSUPP; in aqr107_get_tunable()
430 switch (tuna->id) { in aqr107_set_tunable()
434 return -EOPNOTSUPP; in aqr107_set_tunable()
490 struct aqr107_priv *priv = phydev->priv; in aqr107_config_init()
494 /* Check that the PHY interface type is compatible */ in aqr107_config_init()
495 if (phydev->interface != PHY_INTERFACE_MODE_SGMII && in aqr107_config_init()
496 phydev->interface != PHY_INTERFACE_MODE_1000BASEKX && in aqr107_config_init()
497 phydev->interface != PHY_INTERFACE_MODE_2500BASEX && in aqr107_config_init()
498 phydev->interface != PHY_INTERFACE_MODE_XGMII && in aqr107_config_init()
499 phydev->interface != PHY_INTERFACE_MODE_USXGMII && in aqr107_config_init()
500 phydev->interface != PHY_INTERFACE_MODE_10GKR && in aqr107_config_init()
501 phydev->interface != PHY_INTERFACE_MODE_10GBASER && in aqr107_config_init()
502 phydev->interface != PHY_INTERFACE_MODE_XAUI && in aqr107_config_init()
503 phydev->interface != PHY_INTERFACE_MODE_RXAUI) in aqr107_config_init()
504 return -ENODEV; in aqr107_config_init()
506 WARN(phydev->interface == PHY_INTERFACE_MODE_XGMII, in aqr107_config_init()
518 for_each_set_bit(led_active_low, &priv->leds_active_low, AQR_MAX_LEDS) { in aqr107_config_init()
531 /* Check that the PHY interface type is compatible */ in aqcs109_config_init()
532 if (phydev->interface != PHY_INTERFACE_MODE_SGMII && in aqcs109_config_init()
533 phydev->interface != PHY_INTERFACE_MODE_2500BASEX) in aqcs109_config_init()
534 return -ENODEV; in aqcs109_config_init()
549 if (phydev->state != PHY_RUNNING || phydev->autoneg == AUTONEG_DISABLE) in aqr107_link_change_notify()
553 /* call failed or link partner is no Aquantia PHY */ in aqr107_link_change_notify()
573 phydev_dbg(phydev, "Link partner is Aquantia PHY, FW %u.%u%s%s%s\n", in aqr107_link_change_notify()
576 downshift ? ", fast-retrain downshift advertised" : "", in aqr107_link_change_notify()
585 phydev_info(phydev, "Aquantia 1000Base-T2 mode active\n"); in aqr107_link_change_notify()
605 phydev_err(phydev, "timeout: processor-intensive MDIO operation\n"); in aqr107_wait_processor_intensive_op()
657 unsigned long *possible = phydev->possible_interfaces; in aqr107_fill_interface_modes()
662 /* Walk the media-speed configuration registers to determine which in aqr107_fill_interface_modes()
663 * host-side serdes modes may be used by the PHY depending on the in aqr107_fill_interface_modes()
713 /* It's been observed on some models that - when coming out of suspend in aqr113c_fill_interface_modes()
714 * - the FW signals that the PHY is ready but the GLOBAL_CFG registers in aqr113c_fill_interface_modes()
730 unsigned long *supported = phydev->supported; in aqr115c_get_features()
732 /* PHY supports speeds up to 2.5G with autoneg. PMA capabilities in aqr115c_get_features()
743 /* PHY supports speeds up to 5G with autoneg. PMA capabilities in aqr111_get_features()
748 phydev->supported); in aqr111_get_features()
777 phydev->priv = devm_kzalloc(&phydev->mdio.dev, in aqr107_probe()
779 if (!phydev->priv) in aqr107_probe()
780 return -ENOMEM; in aqr107_probe()
1121 MODULE_DESCRIPTION("Aquantia PHY driver");