UBUNTU: SAUCE: net: phy: marvell: Skip setting LED on Dell EMC board

BugLink: https://bugs.launchpad.net/bugs/1971667

The board in question requires certain LED config, which is already
configured by BIOS, to correctly show its networking status. However,
Marvell PHY driver hardcodes LED value so we need a way to preserve the
default set by BIOS.

PHY maintainer asked for a "generic" approach which goes no where [1],
so let's move on and use a quirk to handle it.

[1] https://lore.kernel.org/lkml/20220420124053.853891-2-kai.heng.feng@canonical.com/

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
This commit is contained in:
Kai-Heng Feng
2022-05-05 14:20:14 +08:00
committed by Paolo Pisati
parent 611ce131d1
commit 77ae5553ca
+14
View File
@@ -33,6 +33,7 @@
#include <linux/bitfield.h>
#include <linux/of.h>
#include <linux/sfp.h>
#include <linux/dmi.h>
#include <linux/io.h>
#include <asm/irq.h>
@@ -312,6 +313,16 @@ struct marvell_priv {
s8 pair;
};
static const struct dmi_system_id skip_config_led_tbl[] = {
{
.matches = {
DMI_MATCH(DMI_BOARD_VENDOR, "Dell EMC"),
DMI_MATCH(DMI_BOARD_NAME, "0d370eed-89ca-4dc0-a365-e9904c4c62bb"),
},
},
{}
};
static int marvell_read_page(struct phy_device *phydev)
{
return __phy_read(phydev, MII_MARVELL_PHY_PAGE);
@@ -759,6 +770,9 @@ static void marvell_config_led(struct phy_device *phydev)
u16 def_config;
int err;
if (dmi_check_system(skip_config_led_tbl))
return;
switch (MARVELL_PHY_FAMILY_ID(phydev->phy_id)) {
/* Default PHY LED config: LED[0] .. Link, LED[1] .. Activity */
case MARVELL_PHY_FAMILY_ID(MARVELL_PHY_ID_88E1121R):