提交 13bd8558 编写于 作者: T Tan Tee Min 提交者: Jakub Kicinski

net: phy: dp83867: add TI PHY loopback

The existing genphy_loopback() is not working for TI DP83867 PHY as it
will disable autoneg support while another side is still enabling autoneg.
This is causing the link is not established and results in timeout error
in genphy_loopback() function.

Thus, based on TI PHY datasheet, introduce a TI PHY loopback function by
just configuring BMCR_LOOPBACK(Bit-9) in MII_BMCR register (0x0).

Tested working on TI DP83867 PHY for all speeds (10/100/1000Mbps).
Signed-off-by: NTan Tee Min <tee.min.tan@linux.intel.com>
Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20221108101527.612723-1-michael.wei.hong.sit@intel.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
上级 470765e4
...@@ -933,6 +933,12 @@ static void dp83867_link_change_notify(struct phy_device *phydev) ...@@ -933,6 +933,12 @@ static void dp83867_link_change_notify(struct phy_device *phydev)
} }
} }
static int dp83867_loopback(struct phy_device *phydev, bool enable)
{
return phy_modify(phydev, MII_BMCR, BMCR_LOOPBACK,
enable ? BMCR_LOOPBACK : 0);
}
static struct phy_driver dp83867_driver[] = { static struct phy_driver dp83867_driver[] = {
{ {
.phy_id = DP83867_PHY_ID, .phy_id = DP83867_PHY_ID,
...@@ -959,6 +965,7 @@ static struct phy_driver dp83867_driver[] = { ...@@ -959,6 +965,7 @@ static struct phy_driver dp83867_driver[] = {
.resume = genphy_resume, .resume = genphy_resume,
.link_change_notify = dp83867_link_change_notify, .link_change_notify = dp83867_link_change_notify,
.set_loopback = dp83867_loopback,
}, },
}; };
module_phy_driver(dp83867_driver); module_phy_driver(dp83867_driver);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册