提交 a7c2ce38 编写于 作者: G Grygorii Strashko 提交者: Yang Yingliang

net: phy: dp83867: enable robust auto-mdix

[ Upstream commit 5a7f08c2abb0efc9d17aff2fc75d6d3b85e622e4 ]

The link detection timeouts can be observed (or link might not be detected
at all) when dp83867 PHY is configured in manual mode (speed/duplex).

CFG3[9] Robust Auto-MDIX option allows to significantly improve link detection
in case dp83867 is configured in manual mode and reduce link detection
time.
As per DM: "If link partners are configured to operational modes that are
not supported by normal Auto MDI/MDIX mode (like Auto-Neg versus Force
100Base-TX or Force 100Base-TX versus Force 100Base-TX), this Robust Auto
MDI/MDIX mode allows MDI/MDIX resolution and prevents deadlock."

Hence, enable this option by default as there are no known reasons
not to do so.
Signed-off-by: NGrygorii Strashko <grygorii.strashko@ti.com>
Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 2dcd9beb
...@@ -86,6 +86,10 @@ ...@@ -86,6 +86,10 @@
#define DP83867_IO_MUX_CFG_CLK_O_SEL_MASK (0x1f << 8) #define DP83867_IO_MUX_CFG_CLK_O_SEL_MASK (0x1f << 8)
#define DP83867_IO_MUX_CFG_CLK_O_SEL_SHIFT 8 #define DP83867_IO_MUX_CFG_CLK_O_SEL_SHIFT 8
/* CFG3 bits */
#define DP83867_CFG3_INT_OE BIT(7)
#define DP83867_CFG3_ROBUST_AUTO_MDIX BIT(9)
/* CFG4 bits */ /* CFG4 bits */
#define DP83867_CFG4_PORT_MIRROR_EN BIT(0) #define DP83867_CFG4_PORT_MIRROR_EN BIT(0)
...@@ -331,12 +335,13 @@ static int dp83867_config_init(struct phy_device *phydev) ...@@ -331,12 +335,13 @@ static int dp83867_config_init(struct phy_device *phydev)
return ret; return ret;
} }
val = phy_read(phydev, DP83867_CFG3);
/* Enable Interrupt output INT_OE in CFG3 register */ /* Enable Interrupt output INT_OE in CFG3 register */
if (phy_interrupt_is_valid(phydev)) { if (phy_interrupt_is_valid(phydev))
val = phy_read(phydev, DP83867_CFG3); val |= DP83867_CFG3_INT_OE;
val |= BIT(7);
phy_write(phydev, DP83867_CFG3, val); val |= DP83867_CFG3_ROBUST_AUTO_MDIX;
} phy_write(phydev, DP83867_CFG3, val);
if (dp83867->port_mirroring != DP83867_PORT_MIRROING_KEEP) if (dp83867->port_mirroring != DP83867_PORT_MIRROING_KEEP)
dp83867_config_port_mirroring(phydev); dp83867_config_port_mirroring(phydev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册