author | Vignesh Raghavendra <vigneshr@ti.com> | |
Tue, 20 Apr 2021 07:47:26 +0000 (13:17 +0530) | ||
committer | Vignesh Raghavendra <vigneshr@ti.com> | |
Mon, 26 Apr 2021 05:07:50 +0000 (10:37 +0530) | ||
commit | 64c9239b329a6cc21d500a6e2b25520ec3048061 | |
tree | 66acbd8cd58473e6f89e38d43769dbc02c19f1d1 | tree | snapshot (tar.xz tar.gz zip) |
parent | c4b5529b070dfdedf85b4b1cf6dc0167af29f87d | commit | diff |
net: ti: prueth_core: Add support for runtime mode change
Add support to switch b/w Dual EMAC and Switch mode at runtime. Driver
will come up by default in Dual EMAC mode with Dual EMAC firmware
loaded. When user creates a bridge b/w two EMAC ports, then the driver
reloads PRUs with RSTP Switch firmware to support L2 forwarding offload
and RSTP.
Using Switch mode:
$ ifconfig eth2 up
$ ifconfig eth3 up
$ brctl addbr br0
$ brctl addif br0 eth2
$ brctl addif br0 eth3
$ brctl stp br0 on
$ mstpctl setforcevers br0 rstp
$ ifconfig br0 up
(Driver switches PRUs to RSTP firmware here)
Switching back to Dual EMAC:
$ ifconfig br0 down
$ brctl delbr br0
(Driver switches PRUs to Dual EMAC firmware here)
Note that RSTP switch is only supported on AM57xx platforms for now.
Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Add support to switch b/w Dual EMAC and Switch mode at runtime. Driver
will come up by default in Dual EMAC mode with Dual EMAC firmware
loaded. When user creates a bridge b/w two EMAC ports, then the driver
reloads PRUs with RSTP Switch firmware to support L2 forwarding offload
and RSTP.
Using Switch mode:
$ ifconfig eth2 up
$ ifconfig eth3 up
$ brctl addbr br0
$ brctl addif br0 eth2
$ brctl addif br0 eth3
$ brctl stp br0 on
$ mstpctl setforcevers br0 rstp
$ ifconfig br0 up
(Driver switches PRUs to RSTP firmware here)
Switching back to Dual EMAC:
$ ifconfig br0 down
$ brctl delbr br0
(Driver switches PRUs to Dual EMAC firmware here)
Note that RSTP switch is only supported on AM57xx platforms for now.
Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>