fsl/fman: take into account all RGMII modes
authorMadalin Bucur <madalin.bucur@nxp.com>
Thu, 30 Mar 2017 13:21:40 +0000 (16:21 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sat, 1 Apr 2017 18:49:14 +0000 (11:49 -0700)
Accept the internal delay RGMII variants.

Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/fman/fman_dtsec.c
drivers/net/ethernet/freescale/fman/fman_memac.c

index 84ea130eed365b405655650e7999351135b533e5..98bba10fc38c1a5916108fc0ec4b1f6f136f0032 100644 (file)
@@ -381,6 +381,9 @@ static int init(struct dtsec_regs __iomem *regs, struct dtsec_cfg *cfg,
 
        /* check RGMII support */
        if (iface == PHY_INTERFACE_MODE_RGMII ||
+           iface == PHY_INTERFACE_MODE_RGMII_ID ||
+           iface == PHY_INTERFACE_MODE_RGMII_RXID ||
+           iface == PHY_INTERFACE_MODE_RGMII_TXID ||
            iface == PHY_INTERFACE_MODE_RMII)
                if (tmp & DTSEC_ID2_INT_REDUCED_OFF)
                        return -EINVAL;
@@ -390,7 +393,10 @@ static int init(struct dtsec_regs __iomem *regs, struct dtsec_cfg *cfg,
                if (tmp & DTSEC_ID2_INT_REDUCED_OFF)
                        return -EINVAL;
 
-       is_rgmii = iface == PHY_INTERFACE_MODE_RGMII;
+       is_rgmii = iface == PHY_INTERFACE_MODE_RGMII ||
+                  iface == PHY_INTERFACE_MODE_RGMII_ID ||
+                  iface == PHY_INTERFACE_MODE_RGMII_RXID ||
+                  iface == PHY_INTERFACE_MODE_RGMII_TXID;
        is_sgmii = iface == PHY_INTERFACE_MODE_SGMII;
        is_qsgmii = iface == PHY_INTERFACE_MODE_QSGMII;
 
index cd6a53eaf1614f7ffbeaadc7bbf6b28d8163e4c0..c0296880feba7f1afa505d4f9c08003e496de429 100644 (file)
@@ -443,7 +443,10 @@ static int init(struct memac_regs __iomem *regs, struct memac_cfg *cfg,
                break;
        default:
                tmp |= IF_MODE_GMII;
-               if (phy_if == PHY_INTERFACE_MODE_RGMII)
+               if (phy_if == PHY_INTERFACE_MODE_RGMII ||
+                   phy_if == PHY_INTERFACE_MODE_RGMII_ID ||
+                   phy_if == PHY_INTERFACE_MODE_RGMII_RXID ||
+                   phy_if == PHY_INTERFACE_MODE_RGMII_TXID)
                        tmp |= IF_MODE_RGMII | IF_MODE_RGMII_AUTO;
        }
        iowrite32be(tmp, &regs->if_mode);