Re: [PATCH] net: phy: marvell: fix detection of PHY on Topaz switches

From: Pali Rohár
Date: Mon Apr 12 2021 - 11:52:47 EST


On Monday 12 April 2021 17:32:33 Andrew Lunn wrote:
> > Anyway, now I'm looking at phy/marvell.c driver again and it supports
> > only 88E6341 and 88E6390 families from whole 88E63xxx range.
> >
> > So do we need to define for now table for more than
> > MV88E6XXX_FAMILY_6341 and MV88E6XXX_FAMILY_6390 entries?
>
> Probably not. I've no idea if the 6393 has an ID, so to be safe you
> should add that. Assuming it has a family of its own.

So what about just?

if (reg == MII_PHYSID2 && !(val & 0x3f0)) {
if (chip->info->family == MV88E6XXX_FAMILY_6341)
val |= MV88E6XXX_PORT_SWITCH_ID_PROD_6341 >> 4;
else if (chip->info->family == MV88E6XXX_FAMILY_6390)
val |= MV88E6XXX_PORT_SWITCH_ID_PROD_6390 >> 4;
}