Commit 315cb046 authored by Max Uvarov's avatar Max Uvarov Committed by Greg Kroah-Hartman

net: phy: dp83867: fix speed 10 in sgmii mode

[ Upstream commit 333061b9 ]

For supporting 10Mps speed in SGMII mode DP83867_10M_SGMII_RATE_ADAPT bit
of DP83867_10M_SGMII_CFG register has to be cleared by software.
That does not affect speeds 100 and 1000 so can be done on init.
Signed-off-by: default avatarMax Uvarov <muvarov@gmail.com>
Cc: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 132a01b4
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
#define DP83867_STRAP_STS1 0x006E #define DP83867_STRAP_STS1 0x006E
#define DP83867_RGMIIDCTL 0x0086 #define DP83867_RGMIIDCTL 0x0086
#define DP83867_IO_MUX_CFG 0x0170 #define DP83867_IO_MUX_CFG 0x0170
#define DP83867_10M_SGMII_CFG 0x016F
#define DP83867_10M_SGMII_RATE_ADAPT_MASK BIT(7)
#define DP83867_SW_RESET BIT(15) #define DP83867_SW_RESET BIT(15)
#define DP83867_SW_RESTART BIT(14) #define DP83867_SW_RESTART BIT(14)
...@@ -277,6 +279,21 @@ static int dp83867_config_init(struct phy_device *phydev) ...@@ -277,6 +279,21 @@ static int dp83867_config_init(struct phy_device *phydev)
DP83867_IO_MUX_CFG_IO_IMPEDANCE_CTRL); DP83867_IO_MUX_CFG_IO_IMPEDANCE_CTRL);
} }
if (phydev->interface == PHY_INTERFACE_MODE_SGMII) {
/* For support SPEED_10 in SGMII mode
* DP83867_10M_SGMII_RATE_ADAPT bit
* has to be cleared by software. That
* does not affect SPEED_100 and
* SPEED_1000.
*/
ret = phy_modify_mmd(phydev, DP83867_DEVADDR,
DP83867_10M_SGMII_CFG,
DP83867_10M_SGMII_RATE_ADAPT_MASK,
0);
if (ret)
return ret;
}
/* 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 = phy_read(phydev, DP83867_CFG3);
......
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