Commit 25108a83 authored by Stefan Eichenberger's avatar Stefan Eichenberger Committed by Paolo Abeni

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: default avatarStefan Eichenberger <eichest@gmail.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 6f1c646d
...@@ -108,7 +108,7 @@ EXPORT_SYMBOL_GPL(genphy_c45_pma_baset1_setup_master_slave); ...@@ -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 genphy_c45_pma_setup_forced(struct phy_device *phydev)
{ {
int ctrl1, ctrl2, ret; int bt1_ctrl, ctrl1, ctrl2, ret;
/* Half duplex is not supported */ /* Half duplex is not supported */
if (phydev->duplex != DUPLEX_FULL) if (phydev->duplex != DUPLEX_FULL)
...@@ -176,6 +176,15 @@ int genphy_c45_pma_setup_forced(struct phy_device *phydev) ...@@ -176,6 +176,15 @@ int genphy_c45_pma_setup_forced(struct phy_device *phydev)
ret = genphy_c45_pma_baset1_setup_master_slave(phydev); ret = genphy_c45_pma_baset1_setup_master_slave(phydev);
if (ret < 0) if (ret < 0)
return ret; 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); return genphy_c45_an_disable_aneg(phydev);
......
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