mbox series

[net-next,0/2] at803x fiber/SFP support

Message ID 20210630180146.1121925-1-robert.hancock@calian.com
Headers show
Series at803x fiber/SFP support | expand

Message

Robert Hancock June 30, 2021, 6:01 p.m. UTC
Add support for 1000Base-X fiber modes to the at803x PHY driver, as
well as support for connecting a downstream SFP cage.

Robert Hancock (2):
  net: phy: at803x: add fiber support
  net: phy: at803x: Support downstream SFP cage

 drivers/net/phy/at803x.c | 122 +++++++++++++++++++++++++++++++++++----
 1 file changed, 112 insertions(+), 10 deletions(-)

Comments

Russell King (Oracle) July 1, 2021, 11:12 p.m. UTC | #1
On Wed, Jun 30, 2021 at 12:01:46PM -0600, Robert Hancock wrote:
> Add support for downstream SFP cages for AR8031 and AR8033. This is

> primarily intended for fiber modules or direct-attach cables, however

> copper modules which work in 1000Base-X mode may also function. Such

> modules are allowed with a warning.


Possibly that's because they default to 1000Base-X mode for
compatibility, but there are some (MikroTik S-RJ01) for example
where the PHY definitely is in SGMII mode and will negotiate
10/100Mbit on its media side which won't work with an AR803x.

> +	/* Some modules support 10G modes as well as others we support.

> +	 * Mask out non-supported modes so the correct interface is picked.

> +	 */

> +	linkmode_and(sfp_support, phy_support, sfp_support);


I think rather than relying on sfp_select_interface() complaining when
sfp_support is empty, do an explicit check here (phylink code
effectively does this via the phylink_validate() check.)

You'll then either be given SGMII or 1000BASE-X by
sfp_select_interface().

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!