diff options
author | Stefan Eichenberger <eichest@gmail.com> | 2023-07-19 08:42:55 +0200 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2023-07-20 12:24:06 +0200 |
commit | 25108a834e145a274024d174083089f8a83fe5bb (patch) | |
tree | 88bc29d5f5abf633e771edfd50dee213641bff4d /drivers/net/phy | |
parent | 6f1c646d88c591a8139997c5591c1385cbc3d4e1 (diff) | |
download | linux-stable-25108a834e145a274024d174083089f8a83fe5bb.tar.gz linux-stable-25108a834e145a274024d174083089f8a83fe5bb.tar.bz2 linux-stable-25108a834e145a274024d174083089f8a83fe5bb.zip |
net: phy: c45: add support for 1000BASE-T1 forced setup
Add support to force 1000BASE-T1 by setting the correct control bit in
the MDIO_MMD_PMA_PMD_BT1_CTRL register.
Signed-off-by: Stefan Eichenberger <eichest@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'drivers/net/phy')
-rw-r--r-- | drivers/net/phy/phy-c45.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c index 93ed07223377..b73c428a1566 100644 --- a/drivers/net/phy/phy-c45.c +++ b/drivers/net/phy/phy-c45.c @@ -108,7 +108,7 @@ EXPORT_SYMBOL_GPL(genphy_c45_pma_baset1_setup_master_slave); */ int genphy_c45_pma_setup_forced(struct phy_device *phydev) { - int ctrl1, ctrl2, ret; + int bt1_ctrl, ctrl1, ctrl2, ret; /* Half duplex is not supported */ if (phydev->duplex != DUPLEX_FULL) @@ -176,6 +176,15 @@ int genphy_c45_pma_setup_forced(struct phy_device *phydev) ret = genphy_c45_pma_baset1_setup_master_slave(phydev); if (ret < 0) return ret; + + bt1_ctrl = 0; + if (phydev->speed == SPEED_1000) + bt1_ctrl = MDIO_PMA_PMD_BT1_CTRL_STRAP_B1000; + + ret = phy_modify_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_PMA_PMD_BT1_CTRL, + MDIO_PMA_PMD_BT1_CTRL_STRAP, bt1_ctrl); + if (ret < 0) + return ret; } return genphy_c45_an_disable_aneg(phydev); |