Skip to content

Commit ddc49ac

Browse files
lunndavem330
authored andcommitted
net: dsa: mv88e6xxx: Work around mv886e6161 SERDES missing MII_PHYSID2
We already have a workaround for a couple of switches whose internal PHYs only have the Marvel OUI, but no model number. We detect such PHYs and give them the 6390 ID as the model number. However the mv88e6161 has two SERDES interfaces in the same address range as its internal PHYs. These suffer from the same problem, the Marvell OUI, but no model number. As a result, these SERDES interfaces were getting the same PHY ID as the mv88e6390, even though they are not PHYs, and the Marvell PHY driver was trying to drive them. Add a special case to stop this from happen. Reported-by: Chris Healy <[email protected]> Signed-off-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f0739e6 commit ddc49ac

File tree

1 file changed

+16
-5
lines changed
  • drivers/net/dsa/mv88e6xxx

1 file changed

+16
-5
lines changed

drivers/net/dsa/mv88e6xxx/chip.c

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2524,11 +2524,22 @@ static int mv88e6xxx_mdio_read(struct mii_bus *bus, int phy, int reg)
25242524
mutex_unlock(&chip->reg_lock);
25252525

25262526
if (reg == MII_PHYSID2) {
2527-
/* Some internal PHYS don't have a model number. Use
2528-
* the mv88e6390 family model number instead.
2529-
*/
2530-
if (!(val & 0x3f0))
2531-
val |= MV88E6XXX_PORT_SWITCH_ID_PROD_6390 >> 4;
2527+
/* Some internal PHYs don't have a model number. */
2528+
if (chip->info->family != MV88E6XXX_FAMILY_6165)
2529+
/* Then there is the 6165 family. It gets is
2530+
* PHYs correct. But it can also have two
2531+
* SERDES interfaces in the PHY address
2532+
* space. And these don't have a model
2533+
* number. But they are not PHYs, so we don't
2534+
* want to give them something a PHY driver
2535+
* will recognise.
2536+
*
2537+
* Use the mv88e6390 family model number
2538+
* instead, for anything which really could be
2539+
* a PHY,
2540+
*/
2541+
if (!(val & 0x3f0))
2542+
val |= MV88E6XXX_PORT_SWITCH_ID_PROD_6390 >> 4;
25322543
}
25332544

25342545
return err ? err : val;

0 commit comments

Comments
 (0)