Skip to content

Commit 6c0b849

Browse files
grygoriySdavem330
authored andcommitted
net: ethernet: ti: ale: add support for mac-only mode
The new CPSW ALE version, available on TI K3 AM654/J721E SoCs family, allows to switch any external port to MAC only mode. When MAC only mode enabled this port be treated like a MAC port for the host. All traffic received is only sent to the host. The host must direct traffic to this port as the lookup engine will not send traffic to the ports with the p0_maconly bit set and the p0_no_learn also set. If p0_maconly bit is set and the p0_no_learn is not set, the host can send non-directed packets that can be sent to the destination of a MacOnly port. It is also possible that The host can broadcast to all ports including MacOnly ports in this mode. This patch add ALE supprt for MAC only mode. Signed-off-by: Grygorii Strashko <[email protected]> Tested-by: Murali Karicheri <[email protected]> Tested-by: Peter Ujfalusi <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 9d1f644 commit 6c0b849

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

drivers/net/ethernet/ti/cpsw_ale.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -779,6 +779,22 @@ static struct ale_control_info ale_controls[ALE_NUM_CONTROLS] = {
779779
.port_shift = 0,
780780
.bits = 1,
781781
},
782+
[ALE_PORT_MACONLY] = {
783+
.name = "mac_only_port_mode",
784+
.offset = ALE_PORTCTL,
785+
.port_offset = 4,
786+
.shift = 11,
787+
.port_shift = 0,
788+
.bits = 1,
789+
},
790+
[ALE_PORT_MACONLY_CAF] = {
791+
.name = "mac_only_port_caf",
792+
.offset = ALE_PORTCTL,
793+
.port_offset = 4,
794+
.shift = 13,
795+
.port_shift = 0,
796+
.bits = 1,
797+
},
782798
[ALE_PORT_MCAST_LIMIT] = {
783799
.name = "mcast_limit",
784800
.offset = ALE_PORTCTL,

drivers/net/ethernet/ti/cpsw_ale.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ enum cpsw_ale_control {
6262
ALE_PORT_UNKNOWN_MCAST_FLOOD,
6363
ALE_PORT_UNKNOWN_REG_MCAST_FLOOD,
6464
ALE_PORT_UNTAGGED_EGRESS,
65+
ALE_PORT_MACONLY,
66+
ALE_PORT_MACONLY_CAF,
6567
ALE_PORT_BCAST_LIMIT,
6668
ALE_PORT_MCAST_LIMIT,
6769
ALE_NUM_CONTROLS,

0 commit comments

Comments
 (0)