Skip to content

Commit 62507e3

Browse files
ccpalexkuba-moo
authored andcommitted
net: ethernet: ti: am65-cpsw: VLAN-aware CPSW only if !DSA
Only configure VLAN-aware CPSW mode if no port is used as DSA CPU port. VLAN-aware mode interferes with some DSA tagging schemes and makes stacking DSA switches downstream of CPSW impossible. Previous attempts to address the issue linked below. Link: https://lore.kernel.org/netdev/[email protected]/ Link: https://lore.kernel.org/linux-arm-kernel/4699400.vD3TdgH1nR@localhost/ Co-developed-by: Siddharth Vadapalli <[email protected]> Signed-off-by: Siddharth Vadapalli <[email protected]> Signed-off-by: Alexander Sverdlin <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent b1b5cff commit 62507e3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/net/ethernet/ti/am65-cpsw-nuss.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include <linux/dma/ti-cppi5.h>
3333
#include <linux/dma/k3-udma-glue.h>
3434
#include <net/page_pool/helpers.h>
35+
#include <net/dsa.h>
3536
#include <net/switchdev.h>
3637

3738
#include "cpsw_ale.h"
@@ -1014,6 +1015,15 @@ static int am65_cpsw_nuss_ndo_slave_open(struct net_device *ndev)
10141015

10151016
common->usage_count++;
10161017

1018+
/* VLAN aware CPSW mode is incompatible with some DSA tagging schemes.
1019+
* Therefore disable VLAN_AWARE mode if any of the ports is a DSA Port.
1020+
*/
1021+
if (netdev_uses_dsa(ndev)) {
1022+
reg = readl(common->cpsw_base + AM65_CPSW_REG_CTL);
1023+
reg &= ~AM65_CPSW_CTL_VLAN_AWARE;
1024+
writel(reg, common->cpsw_base + AM65_CPSW_REG_CTL);
1025+
}
1026+
10171027
am65_cpsw_port_set_sl_mac(port, ndev->dev_addr);
10181028
am65_cpsw_port_enable_dscp_map(port);
10191029

0 commit comments

Comments
 (0)