From 56e8dc36aaad34f836ea4f1f60231af7d5004e38 Mon Sep 17 00:00:00 2001 From: Jian Shen Date: Fri, 29 Mar 2019 17:39:52 +0800 Subject: [PATCH] net: hns3: remove marvell phy led control changes driver inclusion category: bugfix bugzilla: NA CVE: NA In original codes, we changed the default value of led control register and polarity register of marvell phy 88e115x, in order to adapt the D06 boards, which use LED[0] for link and LED[1] for active. This change make our driver being strong relative with cpld. In this case, if user doesn't use marvell phy driver, or use other boards(e.g. x6000v2) with different cpld, the behaviour of led is abonormal. This patch removes the former changes, keep the behaviour be consitent with other commercial OS. Fixes: 9a158a9052a5 ("net: phy: marvell: net: phy: marvell: add new m88e1510 LED configuration for hns3") Fixes: f06104b30e4f ("driver: hns3: update hns3 driver from driver team") Signed-off-by: Jian Shen Reviewed-by: Yang Yingliang Signed-off-by: Yang Yingliang --- .../hisilicon/hns3/hns3pf/hclge_mdio.c | 19 ----------------- drivers/net/phy/marvell.c | 21 +------------------ include/linux/marvell_phy.h | 1 - 3 files changed, 1 insertion(+), 40 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c index a4e1784d7c77..2beaf8d69dee 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c @@ -109,13 +109,6 @@ static int hclge_mdio_read(struct mii_bus *bus, int phyid, int regnum) return le16_to_cpu(mdio_cmd->data_rd); } -static int hclge_phy_marvell_fixup(struct phy_device *phydev) -{ - phydev->dev_flags |= MARVELL_PHY_M1510_HNS3_LEDS; - - return 0; -} - int hclge_mac_mdio_config(struct hclge_dev *hdev) { struct hclge_mac *mac = &hdev->hw.mac; @@ -159,15 +152,6 @@ int hclge_mac_mdio_config(struct hclge_dev *hdev) mac->phydev = phydev; mac->mdio_bus = mdio_bus; - /* register the PHY board fixup (for Marvell 88E1510) */ - ret = phy_register_fixup_for_uid(MARVELL_PHY_ID_88E1510, - MARVELL_PHY_ID_MASK, - hclge_phy_marvell_fixup); - /* we can live without it, so just issue a warning */ - if (ret) - dev_warn(&hdev->pdev->dev, - "Cannot register PHY board fixup\n"); - return 0; } @@ -249,9 +233,6 @@ void hclge_mac_disconnect_phy(struct hnae3_handle *handle) if (!phydev) return; - phy_unregister_fixup_for_uid(MARVELL_PHY_ID_88E1510, - MARVELL_PHY_ID_MASK); - phy_disconnect(phydev); } diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index 056c2b0b89b7..73813c7afa49 100644 --- a/drivers/net/phy/marvell.c +++ b/drivers/net/phy/marvell.c @@ -133,10 +133,6 @@ #define MII_PHY_LED_CTRL 16 #define MII_88E1121_PHY_LED_DEF 0x0030 #define MII_88E1510_PHY_LED_DEF 0x1177 -#define MII_88E1510_PHY_HNS3_LED_DEF 0x1040 - -#define MII_88E1510_PHY_LED_POLARITY_CTRL 0x11 -#define MII_88E1510_PHY_HNS3_LED_POLARITY 0x4415 #define MII_M1011_PHY_STATUS 0x11 #define MII_M1011_PHY_STATUS_1000 0x8000 @@ -649,19 +645,12 @@ static void marvell_config_led(struct phy_device *phydev) def_config = MII_88E1121_PHY_LED_DEF; break; /* Default PHY LED config: - * For hns3: - * LED[0] .. Link - * LED[1] .. Activity - * For others: * LED[0] .. 1000Mbps Link * LED[1] .. 100Mbps Link * LED[2] .. Blink, Activity */ case MARVELL_PHY_FAMILY_ID(MARVELL_PHY_ID_88E1510): - if (phydev->dev_flags & MARVELL_PHY_M1510_HNS3_LEDS) - def_config = MII_88E1510_PHY_HNS3_LED_DEF; - else - def_config = MII_88E1510_PHY_LED_DEF; + def_config = MII_88E1510_PHY_LED_DEF; break; default: return; @@ -671,14 +660,6 @@ static void marvell_config_led(struct phy_device *phydev) def_config); if (err < 0) pr_warn("Fail to config marvell phy LED.\n"); - - if (phydev->dev_flags & MARVELL_PHY_M1510_HNS3_LEDS) { - err = phy_write_paged(phydev, MII_MARVELL_LED_PAGE, - MII_88E1510_PHY_LED_POLARITY_CTRL, - MII_88E1510_PHY_HNS3_LED_POLARITY); - if (err < 0) - pr_warn("Fail to config marvell phy LED polarity.\n"); - } } static int marvell_config_init(struct phy_device *phydev) diff --git a/include/linux/marvell_phy.h b/include/linux/marvell_phy.h index 99e0bbb54a16..1eb6f244588d 100644 --- a/include/linux/marvell_phy.h +++ b/include/linux/marvell_phy.h @@ -32,6 +32,5 @@ /* struct phy_device dev_flags definitions */ #define MARVELL_PHY_M1145_FLAGS_RESISTANCE 0x00000001 #define MARVELL_PHY_M1118_DNS323_LEDS 0x00000002 -#define MARVELL_PHY_M1510_HNS3_LEDS 0x00000004 #endif /* _MARVELL_PHY_H */ -- GitLab