aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMurali Karicheri2014-07-22 13:10:24 -0500
committerMurali Karicheri2014-12-03 10:30:14 -0600
commit7b2eb3e38da5e3ec0affb8f9ba84850b84584460 (patch)
treed9bdfc087044082f7ed9603b05f599729fd894f6 /drivers/net/ethernet/ti/keystone_ethss2.c
parent2b7e462d7d884b1dfbac2eaa14f0c907c85edc65 (diff)
downloadlinux-7b2eb3e38da5e3ec0affb8f9ba84850b84584460.tar.gz
linux-7b2eb3e38da5e3ec0affb8f9ba84850b84584460.tar.xz
linux-7b2eb3e38da5e3ec0affb8f9ba84850b84584460.zip
keystone: net: use h/w capability to remove FCS from rx packet
CPSW_NU has a bit in control register to remove FCS from packet send on Port 0 tx. Use this to strip FCS instead of software doing it. Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Diffstat (limited to 'drivers/net/ethernet/ti/keystone_ethss2.c')
-rw-r--r--drivers/net/ethernet/ti/keystone_ethss2.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/ethernet/ti/keystone_ethss2.c b/drivers/net/ethernet/ti/keystone_ethss2.c
index bfd3382354d..df4e21568ad 100644
--- a/drivers/net/ethernet/ti/keystone_ethss2.c
+++ b/drivers/net/ethernet/ti/keystone_ethss2.c
@@ -63,6 +63,7 @@
63#define GMACSL_RET_WARN_RESET_INCOMPLETE -2 63#define GMACSL_RET_WARN_RESET_INCOMPLETE -2
64 64
65#define CPSW2_NUM_PORTS 9 65#define CPSW2_NUM_PORTS 9
66#define CPSW_CTL_P0_TX_CRC_REMOVE BIT(13)
66#define CPSW2_CTL_P0_ENABLE BIT(2) 67#define CPSW2_CTL_P0_ENABLE BIT(2)
67#define CPSW2_CTL_VLAN_AWARE BIT(1) 68#define CPSW2_CTL_VLAN_AWARE BIT(1)
68#define CPSW2_REG_VAL_STAT_ENABLE_ALL(x) ((1 << (x)) - 1) 69#define CPSW2_REG_VAL_STAT_ENABLE_ALL(x) ((1 << (x)) - 1)
@@ -3391,6 +3392,9 @@ static int cpsw2_open(void *intf_priv, struct net_device *ndev)
3391 CPSW2_MAJOR_VERSION(reg), CPSW2_MINOR_VERSION(reg), 3392 CPSW2_MAJOR_VERSION(reg), CPSW2_MINOR_VERSION(reg),
3392 CPSW2_RTL_VERSION(reg), CPSW2_SGMII_IDENT(reg)); 3393 CPSW2_RTL_VERSION(reg), CPSW2_SGMII_IDENT(reg));
3393 3394
3395 /* Use CPSW_NU P0 TX crc remove capability to remove FCS */
3396 netcp->hw_capabilities |= CPSW_HAS_P0_TX_CRC_REMOVE;
3397
3394 ret = netcp_txpipe_open(&cpsw_intf->tx_pipe); 3398 ret = netcp_txpipe_open(&cpsw_intf->tx_pipe);
3395 if (ret) 3399 if (ret)
3396 goto txpipe_fail; 3400 goto txpipe_fail;
@@ -3436,7 +3440,8 @@ static int cpsw2_open(void *intf_priv, struct net_device *ndev)
3436 writel(0, &cpsw_dev->regs->ptype); 3440 writel(0, &cpsw_dev->regs->ptype);
3437 3441
3438 /* Control register */ 3442 /* Control register */
3439 writel(CPSW2_CTL_P0_ENABLE, &cpsw_dev->regs->control); 3443 __raw_writel(CPSW2_CTL_P0_ENABLE | CPSW_CTL_P0_TX_CRC_REMOVE,
3444 &cpsw_dev->regs->control);
3440 3445
3441 /* All statistics enabled by default */ 3446 /* All statistics enabled by default */
3442 writel(CPSW2_REG_VAL_STAT_ENABLE_ALL(cpsw_dev->num_slaves + 1), 3447 writel(CPSW2_REG_VAL_STAT_ENABLE_ALL(cpsw_dev->num_slaves + 1),