Lines Matching +full:2500 +full:base +full:- +full:x

1 // SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
8 #include <linux/pcs-lynx.h>
19 #define IF_MODE_SPEED(x) (((x) << 2) & GENMASK(3, 2)) argument
36 #define lynx_to_phylink_pcs(lynx) (&(lynx)->pcs)
62 struct mii_bus *bus = pcs->bus; in lynx_pcs_get_state_usxgmii()
63 int addr = pcs->addr; in lynx_pcs_get_state_usxgmii()
70 state->link = !!(status & MDIO_STAT1_LSTATUS); in lynx_pcs_get_state_usxgmii()
71 state->an_complete = !!(status & MDIO_AN_STAT1_COMPLETE); in lynx_pcs_get_state_usxgmii()
72 if (!state->link || !state->an_complete) in lynx_pcs_get_state_usxgmii()
89 state->link = false; in lynx_pcs_get_state_2500basex()
93 state->link = !!(bmsr & BMSR_LSTATUS); in lynx_pcs_get_state_2500basex()
94 state->an_complete = !!(bmsr & BMSR_ANEGCOMPLETE); in lynx_pcs_get_state_2500basex()
95 if (!state->link) in lynx_pcs_get_state_2500basex()
98 state->speed = SPEED_2500; in lynx_pcs_get_state_2500basex()
99 state->pause |= MLO_PAUSE_TX | MLO_PAUSE_RX; in lynx_pcs_get_state_2500basex()
100 state->duplex = DUPLEX_FULL; in lynx_pcs_get_state_2500basex()
108 switch (state->interface) { in lynx_pcs_get_state()
112 phylink_mii_c22_pcs_get_state(lynx->mdio, neg_mode, state); in lynx_pcs_get_state()
115 lynx_pcs_get_state_2500basex(lynx->mdio, state); in lynx_pcs_get_state()
118 lynx_pcs_get_state_usxgmii(lynx->mdio, state); in lynx_pcs_get_state()
121 phylink_mii_c45_pcs_get_state(lynx->mdio, state); in lynx_pcs_get_state()
127 dev_dbg(&lynx->mdio->dev, in lynx_pcs_get_state()
129 phy_modes(state->interface), in lynx_pcs_get_state()
130 phy_speed_to_str(state->speed), in lynx_pcs_get_state()
131 phy_duplex_to_str(state->duplex), in lynx_pcs_get_state()
132 state->link, state->an_complete); in lynx_pcs_get_state()
176 struct mii_bus *bus = pcs->bus; in lynx_pcs_config_usxgmii()
177 int addr = pcs->addr; in lynx_pcs_config_usxgmii()
180 dev_err(&pcs->dev, "USXGMII only supports in-band AN for now\n"); in lynx_pcs_config_usxgmii()
181 return -EOPNOTSUPP; in lynx_pcs_config_usxgmii()
201 return lynx_pcs_config_giga(lynx->mdio, ifmode, advertising, in lynx_pcs_config()
205 dev_err(&lynx->mdio->dev, in lynx_pcs_config()
207 return -EOPNOTSUPP; in lynx_pcs_config()
211 return lynx_pcs_config_usxgmii(lynx->mdio, advertising, in lynx_pcs_config()
217 return -EOPNOTSUPP; in lynx_pcs_config()
227 phylink_mii_c22_pcs_an_restart(lynx->mdio); in lynx_pcs_an_restart()
237 * when not operating on in-band mode in lynx_pcs_link_up_sgmii()
259 dev_err(&pcs->dev, "Invalid PCS speed %d\n", speed); in lynx_pcs_link_up_sgmii()
269 /* 2500Base-X is SerDes protocol 7 on Felix and 6 on ENETC. It is a SerDes lane
271 * auto-negotiation of any link parameters. Electrically it is compatible with
275 * - Downgrading the link speed by duplicating symbols
276 * - Auto-negotiation
281 * AN, we call this PHY interface type 2500Base-X. In case a PHY negotiates a
282 * lower link speed on line side, the system-side interface remains fixed at
283 * 2500 Mbps and we do rate adaptation through pause frames.
292 dev_err(&pcs->dev, "AN not supported for 2500BaseX\n"); in lynx_pcs_link_up_2500basex()
314 lynx_pcs_link_up_sgmii(lynx->mdio, neg_mode, speed, duplex); in lynx_pcs_link_up()
317 lynx_pcs_link_up_2500basex(lynx->mdio, neg_mode, speed, duplex); in lynx_pcs_link_up()
320 /* At the moment, only in-band AN is supported for USXGMII in lynx_pcs_link_up()
353 return ERR_PTR(-ENOMEM); in lynx_pcs_create()
356 lynx->mdio = mdio; in lynx_pcs_create()
357 lynx->pcs.ops = &lynx_pcs_phylink_ops; in lynx_pcs_create()
358 lynx->pcs.neg_mode = true; in lynx_pcs_create()
359 lynx->pcs.poll = true; in lynx_pcs_create()
362 __set_bit(lynx_interfaces[i], lynx->pcs.supported_interfaces); in lynx_pcs_create()
395 * -ENODEV if the fwnode is marked unavailable
396 * -EPROBE_DEFER if we fail to find the device
397 * -ENOMEM if we fail to allocate memory
406 return ERR_PTR(-ENODEV); in lynx_pcs_create_fwnode()
410 return ERR_PTR(-EPROBE_DEFER); in lynx_pcs_create_fwnode()
430 mdio_device_put(lynx->mdio); in lynx_pcs_destroy()