Lines Matching +full:10 +full:gbase +full:- +full:r
1 // SPDX-License-Identifier: GPL-2.0+
3 * Marvell 88x2222 dual-port multi-speed ethernet transceiver.
7 * 1000Base-X or 10GBase-R on the line side.
8 * SGMII over 1000Base-X.
36 /* 1000Base-X/SGMII Control Register */
39 /* 1000BASE-X/SGMII Status Register */
42 /* 1000Base-X Auto-Negotiation Advertisement Register */
45 /* 1000Base-X PHY Specific Status Register */
110 struct mv2222_data *priv = phydev->priv; in mv2222_set_sgmii_speed()
112 switch (phydev->speed) { in mv2222_set_sgmii_speed()
116 priv->supported) || in mv2222_set_sgmii_speed()
118 priv->supported))) in mv2222_set_sgmii_speed()
127 priv->supported) || in mv2222_set_sgmii_speed()
129 priv->supported))) in mv2222_set_sgmii_speed()
137 priv->supported) || in mv2222_set_sgmii_speed()
139 priv->supported))) in mv2222_set_sgmii_speed()
145 return -EINVAL; in mv2222_set_sgmii_speed()
151 struct mv2222_data *priv = phydev->priv; in mv2222_is_10g_capable()
154 priv->supported) || in mv2222_is_10g_capable()
156 priv->supported) || in mv2222_is_10g_capable()
158 priv->supported) || in mv2222_is_10g_capable()
160 priv->supported) || in mv2222_is_10g_capable()
162 priv->supported) || in mv2222_is_10g_capable()
164 priv->supported)); in mv2222_is_10g_capable()
169 struct mv2222_data *priv = phydev->priv; in mv2222_is_1gbx_capable()
172 priv->supported); in mv2222_is_1gbx_capable()
177 struct mv2222_data *priv = phydev->priv; in mv2222_is_sgmii_capable()
180 priv->supported) || in mv2222_is_sgmii_capable()
182 priv->supported) || in mv2222_is_sgmii_capable()
184 priv->supported) || in mv2222_is_sgmii_capable()
186 priv->supported) || in mv2222_is_sgmii_capable()
188 priv->supported) || in mv2222_is_sgmii_capable()
190 priv->supported)); in mv2222_is_sgmii_capable()
195 struct mv2222_data *priv = phydev->priv; in mv2222_config_line()
197 switch (priv->line_interface) { in mv2222_config_line()
208 return -EINVAL; in mv2222_config_line()
212 /* Switch between 1G (1000Base-X/SGMII) and 10G (10GBase-R) modes */
215 struct mv2222_data *priv = phydev->priv; in mv2222_swap_line_type()
219 switch (priv->line_interface) { in mv2222_swap_line_type()
222 priv->line_interface = PHY_INTERFACE_MODE_1000BASEX; in mv2222_swap_line_type()
227 priv->line_interface = PHY_INTERFACE_MODE_SGMII; in mv2222_swap_line_type()
235 priv->line_interface = PHY_INTERFACE_MODE_10GBASER; in mv2222_swap_line_type()
241 return -EINVAL; in mv2222_swap_line_type()
255 struct mv2222_data *priv = phydev->priv; in mv2222_setup_forced()
258 if (priv->line_interface == PHY_INTERFACE_MODE_10GBASER) { in mv2222_setup_forced()
259 if (phydev->speed < SPEED_10000 && in mv2222_setup_forced()
260 phydev->speed != SPEED_UNKNOWN) { in mv2222_setup_forced()
267 if (priv->line_interface == PHY_INTERFACE_MODE_SGMII) { in mv2222_setup_forced()
278 struct mv2222_data *priv = phydev->priv; in mv2222_config_aneg()
282 if (priv->line_interface == PHY_INTERFACE_MODE_NA) in mv2222_config_aneg()
285 if (phydev->autoneg == AUTONEG_DISABLE || in mv2222_config_aneg()
286 priv->line_interface == PHY_INTERFACE_MODE_10GBASER) in mv2222_config_aneg()
289 adv = linkmode_adv_to_mii_adv_x(priv->supported, in mv2222_config_aneg()
335 /* 10GBASE-R do not support auto-negotiation */ in mv2222_read_status_10g()
336 phydev->autoneg = AUTONEG_DISABLE; in mv2222_read_status_10g()
337 phydev->speed = SPEED_10000; in mv2222_read_status_10g()
338 phydev->duplex = DUPLEX_FULL; in mv2222_read_status_10g()
340 if (phydev->autoneg == AUTONEG_ENABLE) { in mv2222_read_status_10g()
368 if (phydev->autoneg == AUTONEG_ENABLE && in mv2222_read_status_1g()
396 phydev->duplex = DUPLEX_FULL; in mv2222_read_status_1g()
398 phydev->duplex = DUPLEX_HALF; in mv2222_read_status_1g()
401 phydev->speed = SPEED_1000; in mv2222_read_status_1g()
403 phydev->speed = SPEED_100; in mv2222_read_status_1g()
405 phydev->speed = SPEED_10; in mv2222_read_status_1g()
413 struct mv2222_data *priv = phydev->priv; in mv2222_link_is_operational()
420 if (phydev->sfp_bus && !priv->sfp_link) in mv2222_link_is_operational()
428 struct mv2222_data *priv = phydev->priv; in mv2222_read_status()
431 phydev->link = 0; in mv2222_read_status()
432 phydev->speed = SPEED_UNKNOWN; in mv2222_read_status()
433 phydev->duplex = DUPLEX_UNKNOWN; in mv2222_read_status()
438 if (priv->line_interface == PHY_INTERFACE_MODE_10GBASER) in mv2222_read_status()
446 phydev->link = link; in mv2222_read_status()
470 if (phydev->interface != PHY_INTERFACE_MODE_XAUI) in mv2222_config_init()
471 return -EINVAL; in mv2222_config_init()
487 priv = phydev->priv; in mv2222_sfp_insert()
488 dev = &phydev->mdio.dev; in mv2222_sfp_insert()
490 sfp_parse_support(phydev->sfp_bus, id, sfp_supported, interfaces); in mv2222_sfp_insert()
491 phydev->port = sfp_parse_port(phydev->sfp_bus, id, sfp_supported); in mv2222_sfp_insert()
492 sfp_interface = sfp_select_interface(phydev->sfp_bus, sfp_supported); in mv2222_sfp_insert()
501 return -EINVAL; in mv2222_sfp_insert()
504 priv->line_interface = sfp_interface; in mv2222_sfp_insert()
505 linkmode_and(priv->supported, phydev->supported, sfp_supported); in mv2222_sfp_insert()
511 if (mutex_trylock(&phydev->lock)) { in mv2222_sfp_insert()
513 mutex_unlock(&phydev->lock); in mv2222_sfp_insert()
524 priv = phydev->priv; in mv2222_sfp_remove()
526 priv->line_interface = PHY_INTERFACE_MODE_NA; in mv2222_sfp_remove()
527 linkmode_zero(priv->supported); in mv2222_sfp_remove()
528 phydev->port = PORT_NONE; in mv2222_sfp_remove()
536 priv = phydev->priv; in mv2222_sfp_link_up()
537 priv->sfp_link = true; in mv2222_sfp_link_up()
545 priv = phydev->priv; in mv2222_sfp_link_down()
546 priv->sfp_link = false; in mv2222_sfp_link_down()
562 struct device *dev = &phydev->mdio.dev; in mv2222_probe()
586 linkmode_copy(phydev->supported, supported); in mv2222_probe()
590 return -ENOMEM; in mv2222_probe()
592 priv->line_interface = PHY_INTERFACE_MODE_NA; in mv2222_probe()
593 phydev->priv = priv; in mv2222_probe()