Commit 7adb5b21 authored by Russell King's avatar Russell King Committed by David S. Miller

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: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 52c95600
...@@ -1837,10 +1837,20 @@ static void phylink_sfp_link_up(void *upstream) ...@@ -1837,10 +1837,20 @@ static void phylink_sfp_link_up(void *upstream)
phylink_run_resolve(pl); phylink_run_resolve(pl);
} }
/* The Broadcom BCM84881 in the Methode DM7052 is unable to provide a SGMII
* or 802.3z control word, so inband will not work.
*/
static bool phylink_phy_no_inband(struct phy_device *phy)
{
return phy->is_c45 &&
(phy->c45_ids.device_ids[1] & 0xfffffff0) == 0xae025150;
}
static int phylink_sfp_connect_phy(void *upstream, struct phy_device *phy) static int phylink_sfp_connect_phy(void *upstream, struct phy_device *phy)
{ {
struct phylink *pl = upstream; struct phylink *pl = upstream;
phy_interface_t interface; phy_interface_t interface;
u8 mode;
int ret; int ret;
/* /*
...@@ -1852,9 +1862,13 @@ static int phylink_sfp_connect_phy(void *upstream, struct phy_device *phy) ...@@ -1852,9 +1862,13 @@ static int phylink_sfp_connect_phy(void *upstream, struct phy_device *phy)
*/ */
phy_support_asym_pause(phy); phy_support_asym_pause(phy);
if (phylink_phy_no_inband(phy))
mode = MLO_AN_PHY;
else
mode = MLO_AN_INBAND;
/* Do the initial configuration */ /* Do the initial configuration */
ret = phylink_sfp_config(pl, MLO_AN_INBAND, phy->supported, ret = phylink_sfp_config(pl, mode, phy->supported, phy->advertising);
phy->advertising);
if (ret < 0) if (ret < 0)
return ret; return ret;
......
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