]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: phy: dp83867: Extend RX strap quirk for SGMII mode
authorHarini Katakam <harini.katakam@amd.com>
Fri, 14 Oct 2022 06:47:35 +0000 (12:17 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 29 Oct 2022 08:20:35 +0000 (10:20 +0200)
[ Upstream commit cf6da8c8a4a4eafa754bb2535c31502e7235af42 ]

When RX strap in HW is not set to MODE 3 or 4, bit 7 and 8 in CF4
register should be set. The former is already handled in
dp83867_config_init; add the latter in SGMII specific initialization.

Fixes: 6d27bc44975f ("net: phy: dp83867: Add TI dp83867 phy")
Signed-off-by: Harini Katakam <harini.katakam@amd.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/phy/dp83867.c

index 87c0cdbf262aee3bde167a1ee10e1bf14f369ddd..c7d91415a4369b20c498cdbe707e40d1cd1a0e3c 100644 (file)
@@ -432,6 +432,14 @@ static int dp83867_config_init(struct phy_device *phydev)
                else
                        val &= ~DP83867_SGMII_TYPE;
                phy_write_mmd(phydev, DP83867_DEVADDR, DP83867_SGMIICTL, val);
+
+               /* This is a SW workaround for link instability if RX_CTRL is
+                * not strapped to mode 3 or 4 in HW. This is required for SGMII
+                * in addition to clearing bit 7, handled above.
+                */
+               if (dp83867->rxctrl_strap_quirk)
+                       phy_set_bits_mmd(phydev, DP83867_DEVADDR, DP83867_CFG4,
+                                        BIT(8));
        }
 
        val = phy_read(phydev, DP83867_CFG3);