Skip to content

Commit

Permalink
net: dpaa2-mac: add 1000BASE-X support
Browse files Browse the repository at this point in the history
Now that pcs-lynx supports 1000BASE-X, add support for this interface
mode to dpaa2-mac. pcs-lynx can be switched at runtime between SGMII
and 1000BASE-X mode, so allow dpaa2-mac to switch between these as
well.

This commit prepares the ground work for allowing 1G fiber connections
to be used with DPAA2 on the SolidRun CEX7 platforms.

Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Russell King authored and Jakub Kicinski committed Feb 6, 2021
1 parent 694a000 commit 46c518c
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,20 @@ static bool dpaa2_mac_phy_mode_mismatch(struct dpaa2_mac *mac,
phy_interface_t interface)
{
switch (interface) {
/* We can switch between SGMII and 1000BASE-X at runtime with
* pcs-lynx
*/
case PHY_INTERFACE_MODE_SGMII:
case PHY_INTERFACE_MODE_1000BASEX:
if (mac->pcs &&
(mac->if_mode == PHY_INTERFACE_MODE_SGMII ||
mac->if_mode == PHY_INTERFACE_MODE_1000BASEX))
return false;
return interface != mac->if_mode;

case PHY_INTERFACE_MODE_10GBASER:
case PHY_INTERFACE_MODE_USXGMII:
case PHY_INTERFACE_MODE_QSGMII:
case PHY_INTERFACE_MODE_SGMII:
case PHY_INTERFACE_MODE_RGMII:
case PHY_INTERFACE_MODE_RGMII_ID:
case PHY_INTERFACE_MODE_RGMII_RXID:
Expand Down Expand Up @@ -122,13 +132,17 @@ static void dpaa2_mac_validate(struct phylink_config *config,
fallthrough;
case PHY_INTERFACE_MODE_SGMII:
case PHY_INTERFACE_MODE_QSGMII:
case PHY_INTERFACE_MODE_1000BASEX:
case PHY_INTERFACE_MODE_RGMII:
case PHY_INTERFACE_MODE_RGMII_ID:
case PHY_INTERFACE_MODE_RGMII_RXID:
case PHY_INTERFACE_MODE_RGMII_TXID:
phylink_set(mask, 10baseT_Full);
phylink_set(mask, 100baseT_Full);
phylink_set(mask, 1000baseX_Full);
phylink_set(mask, 1000baseT_Full);
if (state->interface == PHY_INTERFACE_MODE_1000BASEX)
break;
phylink_set(mask, 100baseT_Full);
phylink_set(mask, 10baseT_Full);
break;
default:
goto empty_set;
Expand Down

0 comments on commit 46c518c

Please sign in to comment.