Skip to content

Commit

Permalink
net: ti: am65-cpsw-nuss: Add devlink support
Browse files Browse the repository at this point in the history
AM65 NUSS ethernet switch on K3 devices can be configured to work either
in independent mac mode where each port acts as independent network
interface (multi mac) or switch mode.

Add devlink hooks to provide a way to switch b/w these modes.

Rationale to use devlink instead of defaulting to bridge mode is that
SoC use cases require to support multiple independent MAC ports with no
switching so that users can use software bridges with multi-mac
configuration (e.g: to support LAG, HSR/PRP, etc). Also, switching
between multi mac and switch mode requires significant Port and ALE
reconfiguration, therefore is easier to be made as part of mode change
devlink hooks. It also allows to keep user interface similar to what
was implemented for the previous generation of TI CPSW IP
(on AM33/AM43/AM57 SoCs).

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Vignesh Raghavendra authored and David S. Miller committed Feb 12, 2021
1 parent b4e18b2 commit 58356eb
Show file tree
Hide file tree
Showing 5 changed files with 404 additions and 18 deletions.
26 changes: 26 additions & 0 deletions Documentation/networking/devlink/am65-nuss-cpsw-switch.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.. SPDX-License-Identifier: GPL-2.0
==============================
am65-cpsw-nuss devlink support
==============================

This document describes the devlink features implemented by the ``am65-cpsw-nuss``
device driver.

Parameters
==========

The ``am65-cpsw-nuss`` driver implements the following driver-specific
parameters.

.. list-table:: Driver-specific parameters implemented
:widths: 5 5 5 85

* - Name
- Type
- Mode
- Description
* - ``switch_mode``
- Boolean
- runtime
- Enable switch mode
1 change: 1 addition & 0 deletions Documentation/networking/devlink/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ parameters, info versions, and other features it supports.
sja1105
qed
ti-cpsw-switch
am65-nuss-cpsw-switch
10 changes: 10 additions & 0 deletions drivers/net/ethernet/ti/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ config TI_CPTS
config TI_K3_AM65_CPSW_NUSS
tristate "TI K3 AM654x/J721E CPSW Ethernet driver"
depends on ARCH_K3 && OF && TI_K3_UDMA_GLUE_LAYER
select NET_DEVLINK
select TI_DAVINCI_MDIO
imply PHY_TI_GMII_SEL
depends on TI_K3_AM65_CPTS || !TI_K3_AM65_CPTS
Expand All @@ -105,6 +106,15 @@ config TI_K3_AM65_CPSW_NUSS
To compile this driver as a module, choose M here: the module
will be called ti-am65-cpsw-nuss.

config TI_K3_AM65_CPSW_SWITCHDEV
bool "TI K3 AM654x/J721E CPSW Switch mode support"
depends on TI_K3_AM65_CPSW_NUSS
depends on NET_SWITCHDEV
help
This enables switchdev support for TI K3 CPSWxG Ethernet
Switch. Enable this driver to support hardware switch support for AM65
CPSW NUSS driver.

config TI_K3_AM65_CPTS
tristate "TI K3 AM65x CPTS"
depends on ARCH_K3 && OF
Expand Down
Loading

0 comments on commit 58356eb

Please sign in to comment.