[PATCH net-next] net: dsa: mv88e6xxx: enable automedia on 6190x and 6390x devices

From: Ante Knezic
Date: Tue Jul 25 2023 - 05:57:37 EST


On Mon, 24 Jul 2023 20:34:27 +0200 Anrew Lunn wrote:
>By auto-media, you mean both a copper PHY and an SFP? And whichever
>gets link first wins the MAC?
>

Yes, that is correct.

On Mon, 24 Jul 2023 20:34:27 +0200 Anrew Lunn wrote:
>auto-media has been discussed a few times, and rejected, since Linux
>has no concept of multiple 'phy like devices' connected to one MAC.
>
>How are you representing this in DT? I assume you have both an SFP
>socket, and a phy-handle pointing to a PHY? phylink will not drive
>both at the same time. So you cannot have them admin up at the same
>time? How do you get the SFP out of TX disable, when phylink sees a
>PHY? What does ethtool return? What the PHY is advertising as its link
>modes? Or nothing since an SFP does not advertise speeds?

Patch simply covers the automedia aspect of the device while the
exact mode is specified by the DT. So for example if you would like
to connect an SFP to port 3 of the device you would create a "regular"
sfp node just like for ports 9/10 along the lines of:
port@3 {
reg = <3>;
label = "SFP";
phy-mode = "1000base-x";
managed = "in-band-status";
sfp = <&sfp1>;
};

>From then on, phylink will handle the sfp just as if it was connected
to ports 9/10 - the ethtool reports advertised and supported link mode
as 1000baseX, "Port" is "FIBRE", etc.

Patch looks for "1000base-x" phy-mode in the dt node so in case it
is not found the device can be linked only against a copper PHY.

The "real" automedia you are refering to is of course not covered here
and maybe the commit message is a "bit" misleading.