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

From: Andrew Lunn
Date: Mon Apr 12 2021 - 10:30:13 EST


> > > +/* This table contains representative model for every family */
> > > +static const enum mv88e6xxx_model family_model_table[] = {
> > > + [MV88E6XXX_FAMILY_6095] = MV88E6095,
> > > + [MV88E6XXX_FAMILY_6097] = MV88E6097,
> > > + [MV88E6XXX_FAMILY_6185] = MV88E6185,
> > > + [MV88E6XXX_FAMILY_6250] = MV88E6250,
> > > + [MV88E6XXX_FAMILY_6320] = MV88E6320,
> > > + [MV88E6XXX_FAMILY_6341] = MV88E6341,
> > > + [MV88E6XXX_FAMILY_6351] = MV88E6351,
> > > + [MV88E6XXX_FAMILY_6352] = MV88E6352,
> > > + [MV88E6XXX_FAMILY_6390] = MV88E6390,
> > > +};
> >
> > This table is wrong. MV88E6390 does not equal
> > MV88E6XXX_PORT_SWITCH_ID_PROD_6390. MV88E6XXX_PORT_SWITCH_ID_PROD_6390
> > was chosen because it is already an MDIO device ID, in register 2 and
> > 3. It probably will never clash with a real Marvell PHY ID. MV88E6390
> > is just a small integer, and there is a danger it will clash with a
> > real PHY.
>
> So... how to solve this issue? What should be in the mapping table?

You need to use MV88E6XXX_PORT_SWITCH_ID_PROD_6095,
MV88E6XXX_PORT_SWITCH_ID_PROD_6097,
...
MV88E6XXX_PORT_SWITCH_ID_PROD_6390,

> > You cannot just replace the MARVELL_PHY_ID_88E6390. That will break
> > the 6390! You need to add the new PHY for the 88E6341.
>
> I have not replaced anything.

Yes, sorry. I read the diff wrong.

Andrew