switch (ifmode) { case PHY_INTERFACE_MODE_1000BASEX: case PHY_INTERFACE_MODE_SGMII: case PHY_INTERFACE_MODE_QSGMII: return lynx_pcs_config_giga(lynx->mdio, ifmode, advertising,
neg_mode); case PHY_INTERFACE_MODE_2500BASEX: if (neg_mode == PHYLINK_PCS_NEG_INBAND_ENABLED) {
dev_err(&lynx->mdio->dev, "AN not supported on 3.125GHz SerDes lane\n"); return -EOPNOTSUPP;
} break; case PHY_INTERFACE_MODE_USXGMII: return lynx_pcs_config_usxgmii(lynx->mdio, advertising,
neg_mode); case PHY_INTERFACE_MODE_10GBASER: /* Nothing to do here for 10GBASER */ break; default: return -EOPNOTSUPP;
}
/* 2500Base-X is SerDes protocol 7 on Felix and 6 on ENETC. It is a SerDes lane *clockedat3.125GHzwhichencodessymbolswith8b/10banddoesnothave *auto-negotiationofanylinkparameters.Electricallyitiscompatiblewith *asinglelaneofXAUI. *ThehardwarereferencemanualwantstocallthismodeSGMII,butitisn't *really,sincethefundamentalfeaturesofSGMII: *-Downgradingthelinkspeedbyduplicatingsymbols *-Auto-negotiation *arenotthere. *Thespeedisconfiguredat1000intheIF_MODEbecausetheclockfrequency *isactuallygivenbyaPLLconfiguredintheResetConfigurationWord(RCW). *SincethereisnodifferencebetweenfixedspeedSGMIIw/oANand802.3zw/o *AN,wecallthisPHYinterfacetype2500Base-X.IncaseaPHYnegotiatesa *lowerlinkspeedonlineside,thesystem-sideinterfaceremainsfixedat *2500Mbpsandwedorateadaptationthroughpauseframes.
*/ staticvoid lynx_pcs_link_up_2500basex(struct mdio_device *pcs, unsignedint neg_mode, int speed, int duplex)
{
u16 if_mode = 0;
if (neg_mode == PHYLINK_PCS_NEG_INBAND_ENABLED) {
dev_err(&pcs->dev, "AN not supported for 2500BaseX\n"); return;
}
if (duplex == DUPLEX_HALF)
if_mode |= IF_MODE_HALF_DUPLEX;
if_mode |= IF_MODE_SPEED(SGMII_SPEED_2500);
staticvoid lynx_pcs_link_up(struct phylink_pcs *pcs, unsignedint neg_mode,
phy_interface_t interface, int speed, int duplex)
{ struct lynx_pcs *lynx = phylink_pcs_to_lynx(pcs);
switch (interface) { case PHY_INTERFACE_MODE_SGMII: case PHY_INTERFACE_MODE_QSGMII:
lynx_pcs_link_up_sgmii(lynx->mdio, neg_mode, speed, duplex); break; case PHY_INTERFACE_MODE_2500BASEX:
lynx_pcs_link_up_2500basex(lynx->mdio, neg_mode, speed, duplex); break; case PHY_INTERFACE_MODE_USXGMII: /* At the moment, only in-band AN is supported for USXGMII *sonothingtodoinlink_up
*/ break; default: break;
}
}
mdio = mdio_device_create(bus, addr); if (IS_ERR(mdio)) return ERR_CAST(mdio);
pcs = lynx_pcs_create(mdio);
/* lynx_create() has taken a refcount on the mdiodev if it was *successful.Iflynx_create()fails,thiswillfreethemdio *devicehere.Inanycase,wedon'tneedtoholdourreference *anymore,andputtingitherewillallowmdio_device_put()in *lynx_destroy()toautomaticallyfreethemdiodevice.
*/
mdio_device_put(mdio);
if (!fwnode_device_is_available(node)) return ERR_PTR(-ENODEV);
mdio = fwnode_mdio_find_device(node); if (!mdio) return ERR_PTR(-EPROBE_DEFER);
pcs = lynx_pcs_create(mdio);
/* lynx_create() has taken a refcount on the mdiodev if it was *successful.Iflynx_create()fails,thiswillfreethemdio *devicehere.Inanycase,wedon'tneedtoholdourreference *anymore,andputtingitherewillallowmdio_device_put()in *lynx_destroy()toautomaticallyfreethemdiodevice.
*/
mdio_device_put(mdio);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.