Commit 8a5c1487 authored by David S. Miller's avatar David S. Miller

Merge branch 'phy-c45-loopback'

Wong Vee Khee says:

====================
Add support for Clause-45 PHY Loopback

This patch series add support for Clause-45 PHY loopback.

It involves adding a generic API in the PHY framework, which can be
accessed by all C45 PHY drivers using the .set_loopback callback.

Also, enable PHY loopback for the Marvell 88x3310/88x2110 driver.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 4adec7f8 d137c70d
...@@ -781,6 +781,7 @@ static struct phy_driver mv3310_drivers[] = { ...@@ -781,6 +781,7 @@ static struct phy_driver mv3310_drivers[] = {
.get_tunable = mv3310_get_tunable, .get_tunable = mv3310_get_tunable,
.set_tunable = mv3310_set_tunable, .set_tunable = mv3310_set_tunable,
.remove = mv3310_remove, .remove = mv3310_remove,
.set_loopback = genphy_c45_loopback,
}, },
{ {
.phy_id = MARVELL_PHY_ID_88E2110, .phy_id = MARVELL_PHY_ID_88E2110,
...@@ -796,6 +797,7 @@ static struct phy_driver mv3310_drivers[] = { ...@@ -796,6 +797,7 @@ static struct phy_driver mv3310_drivers[] = {
.get_tunable = mv3310_get_tunable, .get_tunable = mv3310_get_tunable,
.set_tunable = mv3310_set_tunable, .set_tunable = mv3310_set_tunable,
.remove = mv3310_remove, .remove = mv3310_remove,
.set_loopback = genphy_c45_loopback,
}, },
}; };
......
...@@ -560,6 +560,14 @@ int gen10g_config_aneg(struct phy_device *phydev) ...@@ -560,6 +560,14 @@ int gen10g_config_aneg(struct phy_device *phydev)
} }
EXPORT_SYMBOL_GPL(gen10g_config_aneg); EXPORT_SYMBOL_GPL(gen10g_config_aneg);
int genphy_c45_loopback(struct phy_device *phydev, bool enable)
{
return phy_modify_mmd(phydev, MDIO_MMD_PCS, MDIO_CTRL1,
MDIO_PCS_CTRL1_LOOPBACK,
enable ? MDIO_PCS_CTRL1_LOOPBACK : 0);
}
EXPORT_SYMBOL_GPL(genphy_c45_loopback);
struct phy_driver genphy_c45_driver = { struct phy_driver genphy_c45_driver = {
.phy_id = 0xffffffff, .phy_id = 0xffffffff,
.phy_id_mask = 0xffffffff, .phy_id_mask = 0xffffffff,
......
...@@ -1532,6 +1532,7 @@ int genphy_c45_read_mdix(struct phy_device *phydev); ...@@ -1532,6 +1532,7 @@ int genphy_c45_read_mdix(struct phy_device *phydev);
int genphy_c45_pma_read_abilities(struct phy_device *phydev); int genphy_c45_pma_read_abilities(struct phy_device *phydev);
int genphy_c45_read_status(struct phy_device *phydev); int genphy_c45_read_status(struct phy_device *phydev);
int genphy_c45_config_aneg(struct phy_device *phydev); int genphy_c45_config_aneg(struct phy_device *phydev);
int genphy_c45_loopback(struct phy_device *phydev, bool enable);
/* Generic C45 PHY driver */ /* Generic C45 PHY driver */
extern struct phy_driver genphy_c45_driver; extern struct phy_driver genphy_c45_driver;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment