net: ti: am65-cpsw-nuss: Add switchdev support
authorVignesh Raghavendra <vigneshr@ti.com>
Thu, 11 Feb 2021 10:56:43 +0000 (16:26 +0530)
committerDavid S. Miller <davem@davemloft.net>
Fri, 12 Feb 2021 01:52:13 +0000 (17:52 -0800)
commit86e8b070b25e3cb459d0a4e293327a56f344515e
tree0f05a014c75373c7ee8da613ba68c0abf7b74a04
parent2934db9bcb300ee1df5cfe9a1134e6e1f6a81906
net: ti: am65-cpsw-nuss: Add switchdev support

J721e, J7200 and AM64 have multi port switches which can work in multi
mac mode and in switch mode. Add support for configuring this HW in
switch mode using devlink and switchdev notifiers.

Support is similar to existing CPSW switchdev implementation of TI's 32 bit
platform like AM33/AM43/AM57.

To enable switch mode:
devlink dev param set platform/8000000.ethernet name switch_mode value true cmode runtime

All configuration is implemented via switchdev API and notifiers.
Supported:
      - SWITCHDEV_ATTR_ID_PORT_PRE_BRIDGE_FLAGS
      - SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS
      - SWITCHDEV_ATTR_ID_PORT_STP_STATE
      - SWITCHDEV_OBJ_ID_PORT_VLAN
      - SWITCHDEV_OBJ_ID_PORT_MDB
      - SWITCHDEV_OBJ_ID_HOST_MDB

Hence AM65 CPSW switchdev driver supports:
     - FDB offloading
     - MDB offloading
     - VLAN filtering and offloading
     - STP

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/Makefile
drivers/net/ethernet/ti/am65-cpsw-nuss.c
drivers/net/ethernet/ti/am65-cpsw-switchdev.c [new file with mode: 0644]
drivers/net/ethernet/ti/am65-cpsw-switchdev.h [new file with mode: 0644]