Skip to contentSkip to conversation

Handle phys changing the interface between 2500basex & SGMII

DISCUSSION Alexander 'lynxis' Couzens 2 participants 2 messages Sep 19, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
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_interface on link up?

Yes.

Quoted 3 lines

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.

phylink should not need any changes. You just need your MAC driver to follow what is happening in its callbacks.

Andrew