]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitf8dfcde46ce0636b975736877ee3fa69521c1366
tree0f05a014c75373c7ee8da613ba68c0abf7b74a04
parent8c36b1dc0493a4c726875f3b582d69751f374e23
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]