Subject: Re: [PATCH net-next v2 11/12] net: phy: marvell10g: print exact model

From: Russell King - ARM Linux admin <[email-masked]>
Date: Thu, 25 Mar 2021 15:54:52 +0000

On Thu, Mar 25, 2021 at 02:12:49PM +0100, Marek Behún wrote:
> @@ -443,12 +446,24 @@ static int mv3310_probe(struct phy_device *phydev)
>  
>  	switch (phydev->drv->phy_id) {
>  	case MARVELL_PHY_ID_88X3310:
> +		ret = phy_read_mmd(phydev, MDIO_MMD_PMAPMD, MV_PMA_XGSTAT);
> +		if (ret < 0)
> +			return ret;
> +
> +		has_macsec = !(ret & MV_PMA_XGSTAT_NO_MACSEC);
> +
>  		if (nports == 4)
>  			priv->model = MV_MODEL_88X3340;
>  		else if (nports == 1)
>  			priv->model = MV_MODEL_88X3310;
>  		break;

The 88X3310 and 88X3340 can be differentiated by bit 3 in the revision.
In other words, 88X3310 is 0x09a0..0x09a7, and 88X3340 is
0x09a8..0x09af. We could add a separate driver structure, which would
then allow the kernel to print a more specific string via standard
methods, like we do for other PHYs. Not sure whether that would work
for the 88X21x0 family though.
-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!