[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e408ed0a-94fc-438f-b279-79f9253531d5@lunn.ch>
Date: Tue, 25 Jul 2023 23:22:06 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Ante Knezic <ante.knezic@...mholz.de>
Cc: davem@...emloft.net, edumazet@...gle.com, f.fainelli@...il.com,
kuba@...nel.org, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org, olteanv@...il.com, pabeni@...hat.com
Subject: Re: [PATCH net-next] net: dsa: mv88e6xxx: enable automedia on 6190x
and 6390x devices
On Tue, Jul 25, 2023 at 11:57:12AM +0200, Ante Knezic wrote:
> 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 i would not call this automedia. You are not supporting both copper
and SFP at the same time, and you are not supporting first win. You
are just allowing the lower ports to use the SERDES interfaces for
SFPs.
> 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.
So this used to work. It got broken at some point, and i have a much
simpler patch in one of the branches:
https://github.com/lunn/linux/commit/74e2c2a9a56fd4e2baeee4d5fbe897c21f394ede
Please try this and see if it works for you.
Andrew
Powered by blists - more mailing lists