Skip to content

Commit 7adb5b2

Browse files
Russell Kingdavem330
authored andcommitted
net: phylink: make Broadcom BCM84881 based SFPs work
The Broadcom BCM84881 does not appear to send the SGMII control word when operating in SGMII mode, which causes network adapters to fail to link with the PHY, or decide to operate at fixed 1G speed, even if the PHY negotiated 100M. Work around this by detecting the Broadcom BCM84881 and switch to phy mode rather than inband mode. Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 52c9560 commit 7adb5b2

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

drivers/net/phy/phylink.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1837,10 +1837,20 @@ static void phylink_sfp_link_up(void *upstream)
18371837
phylink_run_resolve(pl);
18381838
}
18391839

1840+
/* The Broadcom BCM84881 in the Methode DM7052 is unable to provide a SGMII
1841+
* or 802.3z control word, so inband will not work.
1842+
*/
1843+
static bool phylink_phy_no_inband(struct phy_device *phy)
1844+
{
1845+
return phy->is_c45 &&
1846+
(phy->c45_ids.device_ids[1] & 0xfffffff0) == 0xae025150;
1847+
}
1848+
18401849
static int phylink_sfp_connect_phy(void *upstream, struct phy_device *phy)
18411850
{
18421851
struct phylink *pl = upstream;
18431852
phy_interface_t interface;
1853+
u8 mode;
18441854
int ret;
18451855

18461856
/*
@@ -1852,9 +1862,13 @@ static int phylink_sfp_connect_phy(void *upstream, struct phy_device *phy)
18521862
*/
18531863
phy_support_asym_pause(phy);
18541864

1865+
if (phylink_phy_no_inband(phy))
1866+
mode = MLO_AN_PHY;
1867+
else
1868+
mode = MLO_AN_INBAND;
1869+
18551870
/* Do the initial configuration */
1856-
ret = phylink_sfp_config(pl, MLO_AN_INBAND, phy->supported,
1857-
phy->advertising);
1871+
ret = phylink_sfp_config(pl, mode, phy->supported, phy->advertising);
18581872
if (ret < 0)
18591873
return ret;
18601874

0 commit comments

Comments
 (0)