Handle phys changing the interface between 2500basex & SGMII
Subsystems (2)
Hi,
I've a mediatek mt7622 SoC connected to a realtek 2.5gbit copper phy (rtl8221) via SGMII/2500basex.
The rtl8221 is changing its phy interface depending on the link. So 2500basex for 2.5gbit copper and for all lower speeds (down to 10mbit) it's using SGMII.
What's the best way to implement it?
Should the phy driver change the phy_interface on link up?
As a hack I've modified mac_link_up to handle the different speeds and changed the phylink_mac_ops validate to allow advertising lower speeds on 2500basex.
Best,
lynxis
Quoted 10 lines · Alexander 'lynxis' Couzens
Hi,
I've a mediatek mt7622 SoC connected to a realtek 2.5gbit copper phy (rtl8221) via SGMII/2500basex.
The rtl8221 is changing its phy interface depending on the link. So 2500basex for 2.5gbit copper and for all lower speeds (down to 10mbit) it's using SGMII.
What's the best way to implement it?
The marvel10g PHY driver is a good example to follow. It also changes its host side interface mode as needed by whatever the copper side has negotiated.
Quoted 1 line
Should the phy driver change the
phy_interfaceon link up?
Yes.
Quoted 3 lines
As a hack I've modified
mac_link_upto handle the different speeds and changed thephylink_mac_opsvalidate to allow advertising lower speeds on 2500basex.
phylink should not need any changes. You just need your MAC driver to follow what is happening in its callbacks.
Andrew