net: phy: broadcom: add 1000Base-X support for BCM54616S
authorTao Ren <taoren@fb.com>
Tue, 22 Oct 2019 18:31:08 +0000 (11:31 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 24 Oct 2019 03:42:52 +0000 (20:42 -0700)
commitb9bcb95315febd09419ab870ddc7cb98a393f9d0
treecb1b86e9a89be628e03f454b138afcf1242dd129
parentfa6e98cee558622565c97924e922b97340aeabd8
net: phy: broadcom: add 1000Base-X support for BCM54616S

The BCM54616S PHY cannot work properly in RGMII->1000Base-X mode, mainly
because genphy functions are designed for copper links, and 1000Base-X
(clause 37) auto negotiation needs to be handled differently.

This patch enables 1000Base-X support for BCM54616S by customizing 3
driver callbacks, and it's verified to be working on Facebook CMM BMC
platform (RGMII->1000Base-KX):

  - probe: probe callback detects PHY's operation mode based on
    INTERF_SEL[1:0] pins and 1000X/100FX selection bit in SerDES 100-FX
    Control register.

  - config_aneg: calls genphy_c37_config_aneg when the PHY is running in
    1000Base-X mode; otherwise, genphy_config_aneg will be called.

  - read_status: calls genphy_c37_read_status when the PHY is running in
    1000Base-X mode; otherwise, genphy_read_status will be called.

Note: BCM54616S PHY can also be configured in RGMII->100Base-FX mode, and
100Base-FX support is not available as of now.

Signed-off-by: Tao Ren <taoren@fb.com>
Acked-by: Vladimir Oltean <olteanv@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/broadcom.c
include/linux/brcmphy.h