Subject: Re: [PATCH v4] net: macb: add support for high speed interface

From: Russell King - ARM Linux admin <[email-masked]>
Date: Fri, 23 Oct 2020 17:03:55 +0100

On Fri, Oct 23, 2020 at 05:39:07PM +0200, Parshuram Thombare wrote:
> This patch adds support for 10GBASE-R interface to the linux driver for
> Cadence's ethernet controller.
> This controller has separate MAC's and PCS'es for low and high speed paths.
> High speed PCS supports 100M, 1G, 2.5G, 5G and 10G through rate adaptation
> implementation. However, since it doesn't support auto negotiation, linux
> driver is modified to support 10GBASE-R instead of USXGMII. 
> 
> Signed-off-by: Parshuram Thombare <[email-masked]>

Thanks, this mostly looks good - only one comment.

> @@ -588,6 +670,13 @@ static void macb_mac_config(struct phylink_config *config, unsigned int mode,
>  	if (old_ctrl ^ ctrl)
>  		macb_or_gem_writel(bp, NCFGR, ctrl);
>  
> +	if (bp->phy_interface == PHY_INTERFACE_MODE_10GBASER) {
> +		gem_writel(bp, NCFGR, GEM_BIT(PCSSEL) |
> +			   (gem_readl(bp, NCFGR) & ~GEM_BIT(SGMIIEN)));
> +		gem_writel(bp, NCR, gem_readl(bp, NCR) |
> +			   GEM_BIT(ENABLE_HS_MAC));
> +	}

If we configure 10GBASE-R, then you clear the SGMIIEN bit and then
enable the HS MAC. Can we go back to non-10GBASE-R after that? Should
the code reverse those actions here?

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