提交 1e8a0462 编写于 作者: J Jian Shen 提交者: Xie XiuQi

net: phy: marvell: add new default led configure for m88e151x

mainline-next inclusion
from mainline-5.1-rc5
commit a93f7fe134543649cf2e2d8fc2c50a8f4d742915
category: bugfix
bugzilla: NA
CVE: NA
-------------------------------------------------

The default m88e151x LED configuration is 0x1177, used LED[0]
for 1000M link, LED[1] for 100M link, and LED[2] for active.
But for some boards, which use LED[0] for link, and LED[1] for
active, prefer to be 0x1040. To be compatible with this case,
this patch defines a new dev_flag, and set it before connect
phy in HNS3 driver. When phy initializing, using the new
LED configuration if this dev_flag is set.
Signed-off-by: NJian Shen <shenjian15@huawei.com>
Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Reviewed-by: Peng Li<lipeng321@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 e9e9b7c6
......@@ -199,9 +199,7 @@ int hclge_mac_connect_phy(struct hnae3_handle *handle)
if (!phydev)
return 0;
#ifdef MARVELL_PHY_M1510_HNS3_LEDS
phydev->dev_flags |= MARVELL_PHY_M1510_HNS3_LEDS;
#endif
phydev->dev_flags |= MARVELL_PHY_LED0_LINK_LED1_ACTIVE;
#ifdef HAS_LINK_MODE_OPS
linkmode_clear_bit(ETHTOOL_LINK_MODE_FIBRE_BIT, phydev->supported);
......
......@@ -133,6 +133,7 @@
#define MII_PHY_LED_CTRL 16
#define MII_88E1121_PHY_LED_DEF 0x0030
#define MII_88E1510_PHY_LED_DEF 0x1177
#define MII_88E1510_PHY_LED0_LINK_LED1_ACTIVE 0x1040
#define MII_M1011_PHY_STATUS 0x11
#define MII_M1011_PHY_STATUS_1000 0x8000
......@@ -650,6 +651,9 @@ static void marvell_config_led(struct phy_device *phydev)
* LED[2] .. Blink, Activity
*/
case MARVELL_PHY_FAMILY_ID(MARVELL_PHY_ID_88E1510):
if (phydev->dev_flags & MARVELL_PHY_LED0_LINK_LED1_ACTIVE)
def_config = MII_88E1510_PHY_LED0_LINK_LED1_ACTIVE;
else
def_config = MII_88E1510_PHY_LED_DEF;
break;
default:
......
......@@ -32,5 +32,6 @@
/* struct phy_device dev_flags definitions */
#define MARVELL_PHY_M1145_FLAGS_RESISTANCE 0x00000001
#define MARVELL_PHY_M1118_DNS323_LEDS 0x00000002
#define MARVELL_PHY_LED0_LINK_LED1_ACTIVE 0x00000004
#endif /* _MARVELL_PHY_H */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册