Re: [PATCH net-next] net: phy: marvell: add support for MV88E6020 internal PHYs

From: Matthias Schiffer
Date: Wed Apr 24 2024 - 08:49:37 EST


On Wed, 2024-04-24 at 14:42 +0200, Andrew Lunn wrote:
> On Wed, Apr 24, 2024 at 02:10:22PM +0200, Matthias Schiffer wrote:
> > The embedded PHYs of the MV88E6020 (88E6250 family) switch are very
> > basic - they do not even have an Extended Address / Page register.
> >
> > This adds support for the PHYs to the driver to set up PHY interrupts
> > and retrieve error stats. The ethtool stat functions are slightly
> > refactored to allow dealing with different marvell_hw_stat definitions.
> >
> > The same code should also work with other 88E6250 family switches
> > (6250/6220/6071/6070), but it is unclear whether these use the same PHY
> > ID - the spec only lists the prefix 0x01410c00 and describes the lower
> > 10 bits as reserved, but that seems too unspecific to be useful, as it
> > would cover several existing PHY IDs already supported by the driver.
>
> This sounds like:
>
> https://elixir.bootlin.com/linux/latest/source/drivers/net/dsa/mv88e6xxx/chip.c#L3642
>
> So the DSA driver will fill in the lower bits, and it should work for
> all devices in the family.
>
> > @@ -4072,6 +4134,7 @@ static struct mdio_device_id __maybe_unused marvell_tbl[] = {
> > { MARVELL_PHY_ID_88E1540, MARVELL_PHY_ID_MASK },
> > { MARVELL_PHY_ID_88E1545, MARVELL_PHY_ID_MASK },
> > { MARVELL_PHY_ID_88E3016, MARVELL_PHY_ID_MASK },
> > + { MARVELL_PHY_ID_88E6020, MARVELL_PHY_ID_MASK },
> > { MARVELL_PHY_ID_88E6341_FAMILY, MARVELL_PHY_ID_MASK },
>
> Please follow the naming convention. MARVELL_PHY_ID_88E6250_FAMILY.
>
> Andrew

We currently do not override the PHY ID for this family in the DSA driver - my understanding was
that this is only necessary for switches that don't provide a usable PHY ID at all. As I have no
idea if this PHY ID works for the whole family or just the single switch, I went with the more
specific naming here.

Matthias



--
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
https://www.tq-group.com/