Re: [PATCH 0/7] net: stmmac: enable EHL SGMII

From: Andrew Lunn
Date: Thu Apr 25 2019 - 08:38:09 EST


On Thu, Apr 25, 2019 at 07:27:51AM +0000, Voon, Weifeng wrote:
> > > This patch-set is to enable Ethernet controller (DW Ethernet QoS and
> > > DW Ethernet PCS) with SGMII interface in Elkhart Lake.
> >
> > Can the hardware also do 1000BaseX?
>
> Yes, it is able to do 1000BaseX.

I Voon

That means you should not really hard code it to SGMII. Somebody is
going to connect an SFP or an Ethernet switch and want to use
1000BaseX.

At minimum, please add support for phy-mode in the device tree.

Also, when the adjust_link callback passed to phy_connect() is called,
you can look at the interface type to know if you need to configure it
to SGMII or 1000BaseX. A copper PHY in an SFP module generally wants
SGMII, but an optical module wants 1000BaseX. But to properly support
SPFs the driver needs to swap to phylink, rather than phylib.

Andrew