linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Grygorii Strashko <grygorii.strashko@ti.com>
To: Peter Ujfalusi <peter.ujfalusi@ti.com>,
	Rob Herring <robh@kernel.org>, Tero Kristo <t-kristo@ti.com>,
	"David S . Miller" <davem@davemloft.net>,
	netdev <netdev@vger.kernel.org>, Roger Quadros <rogerq@ti.com>,
	<devicetree@vger.kernel.org>, Jakub Kicinski <kuba@kernel.org>
Cc: Grygorii Strashko <grygorii.strashko@ti.com>,
	Sekhar Nori <nsekhar@ti.com>,
	linux-kernel@vger.kernel.org,
	Kishon Vijay Abraham I <kishon@ti.com>,
	Murali Karicheri <m-karicheri2@ti.com>,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH net-next v6 03/11] net: ethernet: ti: ale: add support for mac-only mode
Date: Tue, 24 Mar 2020 00:52:46 +0200	[thread overview]
Message-ID: <20200323225254.12759-4-grygorii.strashko@ti.com> (raw)
In-Reply-To: <20200323225254.12759-1-grygorii.strashko@ti.com>

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 <grygorii.strashko@ti.com>
Tested-by: Murali Karicheri <m-karicheri2@ti.com>
Tested-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 drivers/net/ethernet/ti/cpsw_ale.c | 16 ++++++++++++++++
 drivers/net/ethernet/ti/cpsw_ale.h |  2 ++
 2 files changed, 18 insertions(+)

diff --git a/drivers/net/ethernet/ti/cpsw_ale.c b/drivers/net/ethernet/ti/cpsw_ale.c
index 5815225c000c..719e7846127c 100644
--- a/drivers/net/ethernet/ti/cpsw_ale.c
+++ b/drivers/net/ethernet/ti/cpsw_ale.c
@@ -779,6 +779,22 @@ static struct ale_control_info ale_controls[ALE_NUM_CONTROLS] = {
 		.port_shift	= 0,
 		.bits		= 1,
 	},
+	[ALE_PORT_MACONLY]	= {
+		.name		= "mac_only_port_mode",
+		.offset		= ALE_PORTCTL,
+		.port_offset	= 4,
+		.shift		= 11,
+		.port_shift	= 0,
+		.bits		= 1,
+	},
+	[ALE_PORT_MACONLY_CAF]	= {
+		.name		= "mac_only_port_caf",
+		.offset		= ALE_PORTCTL,
+		.port_offset	= 4,
+		.shift		= 13,
+		.port_shift	= 0,
+		.bits		= 1,
+	},
 	[ALE_PORT_MCAST_LIMIT]	= {
 		.name		= "mcast_limit",
 		.offset		= ALE_PORTCTL,
diff --git a/drivers/net/ethernet/ti/cpsw_ale.h b/drivers/net/ethernet/ti/cpsw_ale.h
index 70d0955c2652..eaca73c17ae7 100644
--- a/drivers/net/ethernet/ti/cpsw_ale.h
+++ b/drivers/net/ethernet/ti/cpsw_ale.h
@@ -62,6 +62,8 @@ enum cpsw_ale_control {
 	ALE_PORT_UNKNOWN_MCAST_FLOOD,
 	ALE_PORT_UNKNOWN_REG_MCAST_FLOOD,
 	ALE_PORT_UNTAGGED_EGRESS,
+	ALE_PORT_MACONLY,
+	ALE_PORT_MACONLY_CAF,
 	ALE_PORT_BCAST_LIMIT,
 	ALE_PORT_MCAST_LIMIT,
 	ALE_NUM_CONTROLS,
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2020-03-23 22:53 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-23 22:52 [PATCH net-next v6 00/11] net: ethernet: ti: add networking support for k3 am65x/j721e soc Grygorii Strashko
2020-03-23 22:52 ` [PATCH net-next v6 01/11] phy: ti: gmii-sel: simplify config dependencies between net drivers and gmii phy Grygorii Strashko
2020-03-23 22:52 ` [PATCH net-next v6 02/11] net: ethernet: ti: ale: fix seeing unreg mcast packets with promisc and allmulti disabled Grygorii Strashko
2020-03-23 22:52 ` Grygorii Strashko [this message]
2020-03-23 22:52 ` [PATCH net-next v6 04/11] net: ethernet: ti: ale: am65: add support for default thread cfg Grygorii Strashko
2020-03-23 22:52 ` [PATCH net-next v6 05/11] dt-binding: ti: am65x: document mcu cpsw nuss Grygorii Strashko
2020-03-23 22:52 ` [PATCH net-next v6 06/11] net: ethernet: ti: introduce am65x/j721e gigabit eth subsystem driver Grygorii Strashko
2020-03-23 22:52 ` [PATCH net-next v6 07/11] arm64: dts: ti: k3-am65-mcu: add cpsw nuss node Grygorii Strashko
2020-03-23 22:52 ` [PATCH net-next v6 08/11] arm64: dts: k3-am654-base-board: add mcu cpsw nuss pinmux and phy defs Grygorii Strashko
2020-03-23 22:52 ` [PATCH net-next v6 09/11] arm64: dts: ti: k3-j721e-mcu: add mcu cpsw nuss node Grygorii Strashko
2020-03-23 22:52 ` [PATCH net-next v6 10/11] arm64: dts: ti: k3-j721e-common-proc-board: add mcu cpsw nuss pinmux and phy defs Grygorii Strashko
2020-03-23 22:52 ` [PATCH net-next v6 11/11] arm64: defconfig: ti: k3: enable dma and networking Grygorii Strashko
2020-03-27  3:01 ` [PATCH net-next v6 00/11] net: ethernet: ti: add networking support for k3 am65x/j721e soc David Miller
2020-03-28  1:53   ` Vladimir Oltean
2020-03-30  7:15     ` Tero Kristo
2020-03-30  7:36       ` Sekhar Nori
2020-03-30  8:28         ` Sekhar Nori
2020-03-30 18:14           ` Grygorii Strashko
2020-04-01 18:27             ` Vladimir Oltean
2020-04-01 18:36               ` David Miller
2020-04-01 22:35                 ` Nick Desaulniers
2020-04-02  9:42                   ` Will Deacon
2020-04-02 11:05                     ` Grygorii Strashko
2020-04-02 17:27                       ` Nick Desaulniers
2020-04-03  5:11                         ` Sekhar Nori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200323225254.12759-4-grygorii.strashko@ti.com \
    --to=grygorii.strashko@ti.com \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=kishon@ti.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m-karicheri2@ti.com \
    --cc=netdev@vger.kernel.org \
    --cc=nsekhar@ti.com \
    --cc=peter.ujfalusi@ti.com \
    --cc=robh@kernel.org \
    --cc=rogerq@ti.com \
    --cc=t-kristo@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).