net: dpaa2-mac: add backplane link mode support
authorRussell King <rmk+kernel@armlinux.org.uk>
Fri, 5 Feb 2021 10:40:09 +0000 (10:40 +0000)
committerIoana Ciornei <ciorneiioana@gmail.com>
Mon, 26 Apr 2021 09:22:47 +0000 (12:22 +0300)
Add support for backplane link mode, which is, according to discussions
with NXP earlier in the year, is a mode where the OS (Linux) is able to
manage the PCS and Serdes itself.

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

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c

index cccbba3..836ff51 100644 (file)
@@ -705,7 +705,9 @@ static inline int dpaa2_eth_ch_count(struct dpaa2_eth_priv *priv)
 
 static inline bool dpaa2_eth_is_type_phy(struct dpaa2_eth_priv *priv)
 {
-       if (priv->mac && priv->mac->attr.link_type == DPMAC_LINK_TYPE_PHY)
+       if (priv->mac &&
+           (priv->mac->attr.link_type == DPMAC_LINK_TYPE_PHY ||
+            priv->mac->attr.link_type == DPMAC_LINK_TYPE_BACKPLANE))
                return true;
 
        return false;
index 3ddfb40..ccaf7e3 100644 (file)
@@ -315,8 +315,9 @@ int dpaa2_mac_connect(struct dpaa2_mac *mac)
                goto err_put_node;
        }
 
-       if (mac->attr.link_type == DPMAC_LINK_TYPE_PHY &&
-           mac->attr.eth_if != DPMAC_ETH_IF_RGMII) {
+       if ((mac->attr.link_type == DPMAC_LINK_TYPE_PHY &&
+            mac->attr.eth_if != DPMAC_ETH_IF_RGMII) ||
+           mac->attr.link_type == DPMAC_LINK_TYPE_BACKPLANE) {
                err = dpaa2_pcs_create(mac, dpmac_node, mac->attr.id);
                if (err)
                        goto err_put_node;