Skip to content

Commit 58356eb

Browse files
r-vigneshdavem330
authored andcommitted
net: ti: am65-cpsw-nuss: Add devlink support
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent b4e18b2 commit 58356eb

File tree

5 files changed

+404
-18
lines changed

5 files changed

+404
-18
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
.. SPDX-License-Identifier: GPL-2.0
2+
3+
==============================
4+
am65-cpsw-nuss devlink support
5+
==============================
6+
7+
This document describes the devlink features implemented by the ``am65-cpsw-nuss``
8+
device driver.
9+
10+
Parameters
11+
==========
12+
13+
The ``am65-cpsw-nuss`` driver implements the following driver-specific
14+
parameters.
15+
16+
.. list-table:: Driver-specific parameters implemented
17+
:widths: 5 5 5 85
18+
19+
* - Name
20+
- Type
21+
- Mode
22+
- Description
23+
* - ``switch_mode``
24+
- Boolean
25+
- runtime
26+
- Enable switch mode

Documentation/networking/devlink/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,4 @@ parameters, info versions, and other features it supports.
4545
sja1105
4646
qed
4747
ti-cpsw-switch
48+
am65-nuss-cpsw-switch

drivers/net/ethernet/ti/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ config TI_CPTS
9292
config TI_K3_AM65_CPSW_NUSS
9393
tristate "TI K3 AM654x/J721E CPSW Ethernet driver"
9494
depends on ARCH_K3 && OF && TI_K3_UDMA_GLUE_LAYER
95+
select NET_DEVLINK
9596
select TI_DAVINCI_MDIO
9697
imply PHY_TI_GMII_SEL
9798
depends on TI_K3_AM65_CPTS || !TI_K3_AM65_CPTS
@@ -105,6 +106,15 @@ config TI_K3_AM65_CPSW_NUSS
105106
To compile this driver as a module, choose M here: the module
106107
will be called ti-am65-cpsw-nuss.
107108

109+
config TI_K3_AM65_CPSW_SWITCHDEV
110+
bool "TI K3 AM654x/J721E CPSW Switch mode support"
111+
depends on TI_K3_AM65_CPSW_NUSS
112+
depends on NET_SWITCHDEV
113+
help
114+
This enables switchdev support for TI K3 CPSWxG Ethernet
115+
Switch. Enable this driver to support hardware switch support for AM65
116+
CPSW NUSS driver.
117+
108118
config TI_K3_AM65_CPTS
109119
tristate "TI K3 AM65x CPTS"
110120
depends on ARCH_K3 && OF

0 commit comments

Comments
 (0)