Skip to content

Commit e10acac

Browse files
committed
feat(linux): Update CPSW documentation to enable switch mode
Update documentation for enabling CPSW in switch mode for AM57x devices. Signed-off-by: Aksh Garg <[email protected]>
1 parent 064e58e commit e10acac

File tree

1 file changed

+55
-2
lines changed
  • source/linux/Foundational_Components/Kernel/Kernel_Drivers/Network

1 file changed

+55
-2
lines changed

source/linux/Foundational_Components/Kernel/Kernel_Drivers/Network/CPSW.rst

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ VLAN will be subscribed to host port and the respective slave ports.
249249
250250
< or >
251251
252-
vconfig rem eth0 5
252+
vconfig rem eth0.5
253253
254254
**IP assigning**
255255

@@ -417,7 +417,7 @@ To allow Dual Emac interfaces to be added to the Linux Bridge one of following c
417417
Dual EMAC can be enabled with adding the entry dual\_emac to the cpsw
418418
device tree node as the reference patch below
419419

420-
.. code:: dts
420+
.. code:: diff
421421
422422
diff --git a/arch/arm/boot/dts/am335x-evmsk.dts b/arch/arm/boot/dts/am335x-evmsk.dts
423423
index ac1f759..b50e9ef 100644
@@ -571,6 +571,59 @@ Userspace binary formats --->
571571
572572
|
573573
574+
.. rubric:: Multi port Switch mode
575+
:name: multi-port-switch-mode
576+
577+
.. note::
578+
579+
The following section documents the Switch mode features available with
580+
CPSW.
581+
582+
To enable Switch mode, configure the devlink driver parameter
583+
"switch_mode" to true
584+
585+
.. code-block:: console
586+
587+
devlink dev param set platform/48484000.switch name switch_mode value true cmode runtime
588+
589+
You can apply the above setting regardless of the state of Port's netdev
590+
devices - **up** or **down**, but Port's netdev devices have to be in **up** state
591+
before joining the bridge. This is to avoid overwriting of bridge
592+
configuration as CPSW switch driver completely reloads its configuration
593+
when first port changes its state to **up**.
594+
595+
When all the interfaces have joined the bridge - CPSW switch driver will
596+
enable marking packets with offload_fwd_mark flag.
597+
598+
The usage of switchdev API implements all configuration.
599+
600+
.. rubric:: Bridge Setup
601+
:name: bridge-setup
602+
603+
.. code-block:: console
604+
605+
devlink dev param set platform/48484000.switch name switch_mode value true cmode runtime
606+
607+
ip link add name br0 type bridge
608+
ip link set dev br0 type bridge ageing_time 1000
609+
ip link set dev eth0 up
610+
ip link set dev eth1 up
611+
ip link set dev eth0 master br0
612+
ip link set dev eth1 master br0
613+
614+
[*] bridge vlan add dev br0 vid 1 self
615+
[*] bridge vlan add dev br0 vid 1 pvid untagged self
616+
[*] if vlan_filtering=1, where default_pvid=1
617+
618+
Note: Steps [*] are mandatory.
619+
620+
.. rubric:: Turn On or Off Spanning Tree Protocol (STP)
621+
:name: turn-on-or-off-spanning-tree-protocol
622+
623+
.. code-block:: console
624+
625+
ip link set dev br0 type bridge stp_state 1/0
626+
574627
.. rubric:: Switch Config Commands
575628
:name: switch-config-commands
576629

0 commit comments

Comments
 (0)