Lines Matching +full:dual +full:- +full:lane
1 // SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
8 #include <linux/pcs-lynx.h>
38 #define lynx_to_phylink_pcs(lynx) (&(lynx)->pcs)
44 return lynx->mdio; in lynx_get_mdio_device()
51 struct mii_bus *bus = pcs->bus; in lynx_pcs_get_state_usxgmii()
52 int addr = pcs->addr; in lynx_pcs_get_state_usxgmii()
59 state->link = !!(status & MDIO_STAT1_LSTATUS); in lynx_pcs_get_state_usxgmii()
60 state->an_complete = !!(status & MDIO_AN_STAT1_COMPLETE); in lynx_pcs_get_state_usxgmii()
61 if (!state->link || !state->an_complete) in lynx_pcs_get_state_usxgmii()
79 state->link = false; in lynx_pcs_get_state_2500basex()
83 state->link = !!(bmsr & BMSR_LSTATUS); in lynx_pcs_get_state_2500basex()
84 state->an_complete = !!(bmsr & BMSR_ANEGCOMPLETE); in lynx_pcs_get_state_2500basex()
85 if (!state->link) in lynx_pcs_get_state_2500basex()
88 state->speed = SPEED_2500; in lynx_pcs_get_state_2500basex()
89 state->pause |= MLO_PAUSE_TX | MLO_PAUSE_RX; in lynx_pcs_get_state_2500basex()
90 state->duplex = DUPLEX_FULL; in lynx_pcs_get_state_2500basex()
98 switch (state->interface) { in lynx_pcs_get_state()
102 phylink_mii_c22_pcs_get_state(lynx->mdio, state); in lynx_pcs_get_state()
105 lynx_pcs_get_state_2500basex(lynx->mdio, state); in lynx_pcs_get_state()
108 lynx_pcs_get_state_usxgmii(lynx->mdio, state); in lynx_pcs_get_state()
111 phylink_mii_c45_pcs_get_state(lynx->mdio, state); in lynx_pcs_get_state()
117 dev_dbg(&lynx->mdio->dev, in lynx_pcs_get_state()
119 phy_modes(state->interface), in lynx_pcs_get_state()
120 phy_speed_to_str(state->speed), in lynx_pcs_get_state()
121 phy_duplex_to_str(state->duplex), in lynx_pcs_get_state()
122 state->link, state->an_enabled, state->an_complete); in lynx_pcs_get_state()
163 struct mii_bus *bus = pcs->bus; in lynx_pcs_config_usxgmii()
164 int addr = pcs->addr; in lynx_pcs_config_usxgmii()
167 dev_err(&pcs->dev, "USXGMII only supports in-band AN for now\n"); in lynx_pcs_config_usxgmii()
168 return -EOPNOTSUPP; in lynx_pcs_config_usxgmii()
189 return lynx_pcs_config_giga(lynx->mdio, mode, ifmode, in lynx_pcs_config()
193 dev_err(&lynx->mdio->dev, in lynx_pcs_config()
194 "AN not supported on 3.125GHz SerDes lane\n"); in lynx_pcs_config()
195 return -EOPNOTSUPP; in lynx_pcs_config()
199 return lynx_pcs_config_usxgmii(lynx->mdio, mode, advertising); in lynx_pcs_config()
204 return -EOPNOTSUPP; in lynx_pcs_config()
214 phylink_mii_c22_pcs_an_restart(lynx->mdio); in lynx_pcs_an_restart()
223 * when not operating on in-band mode in lynx_pcs_link_up_sgmii()
245 dev_err(&pcs->dev, "Invalid PCS speed %d\n", speed); in lynx_pcs_link_up_sgmii()
255 /* 2500Base-X is SerDes protocol 7 on Felix and 6 on ENETC. It is a SerDes lane
257 * auto-negotiation of any link parameters. Electrically it is compatible with
258 * a single lane of XAUI.
261 * - Downgrading the link speed by duplicating symbols
262 * - Auto-negotiation
267 * AN, we call this PHY interface type 2500Base-X. In case a PHY negotiates a
268 * lower link speed on line side, the system-side interface remains fixed at
278 dev_err(&pcs->dev, "AN not supported for 2500BaseX\n"); in lynx_pcs_link_up_2500basex()
300 lynx_pcs_link_up_sgmii(lynx->mdio, mode, speed, duplex); in lynx_pcs_link_up()
303 lynx_pcs_link_up_2500basex(lynx->mdio, mode, speed, duplex); in lynx_pcs_link_up()
306 /* At the moment, only in-band AN is supported for USXGMII in lynx_pcs_link_up()
330 lynx->mdio = mdio; in lynx_pcs_create()
331 lynx->pcs.ops = &lynx_pcs_phylink_ops; in lynx_pcs_create()
332 lynx->pcs.poll = true; in lynx_pcs_create()
346 MODULE_LICENSE("Dual BSD/GPL");