From patchwork Fri Feb 21 10:28:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 13985194 X-Patchwork-Delegate: kuba@kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E6D0A205ADC; Fri, 21 Feb 2025 10:28:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740133723; cv=none; b=oVqZzC2J5ZpUsNOnGwysqlojFBuS4I5o0I7D5La3QAPtSp3L84W326QJz1bCfepjG7xVW8ubFBUSQtOZOIRnu513/zi9aG+WLGXbWTlJ69lIUZUP5ilXu0/MFbEmSvYXuM5RmZbgpgo0PgXUKNvs7KWeO1T9KHHdLt5im5L9H/k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740133723; c=relaxed/simple; bh=Syook/k3osDoz8HpkUWZ96mxKRz3XOL/uBmVWEWdJH4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BV4CcoWSgt5mQNY/ndtIX3mK+gbsvmP3bg+xHdkcUqG+LPia06H2ntVwNyHY+6qdLWlCfvjfJIEmCbPXWFiMkzQol0iDtwY6W7GG/rlzM4lcQnu5mbWw3l7qsID/VJn3gphGmJtVP2UTu632G/fGuTRiGhLipS7qOrXfq9yHyLQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=m2mueItp; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="m2mueItp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0CD26C4CED6; Fri, 21 Feb 2025 10:28:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1740133722; bh=Syook/k3osDoz8HpkUWZ96mxKRz3XOL/uBmVWEWdJH4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=m2mueItpaPGvYsuixu/q1cyWqIbctGDtfbI1IgjxolFRi7SCTFkfp6cS0pvrDGQzA Fk2iyuY4cn6MNp+al7PRN198kHVXt4G/J1AVHh6ekGDUGDVoDENmiU34PQFKwezwCz 6vdt2xncwH+oN0DqhdeGs6m8xyL6EHERqB65MEZqU1GjvGvBrRtupVMfK3kVQ+LUfi 05HZiqGqdMEplA+p/7aXWeWWPEqWAUw9SrZqnHwNNSvHv+V0xybLimkvM71DLzzMsz da3YHiLsdCxCjsH3i2ngBWa6zYRARkSKzRR/uJ1cLBI/0EoTC4IPi0/qVekRqEmajm 385zY8hmUjJZA== From: Lorenzo Bianconi Date: Fri, 21 Feb 2025 11:28:07 +0100 Subject: [PATCH net-next v6 06/15] net: dsa: mt7530: Enable Rx sptag for EN7581 SoC Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250221-airoha-en7581-flowtable-offload-v6-6-d593af0e9487@kernel.org> References: <20250221-airoha-en7581-flowtable-offload-v6-0-d593af0e9487@kernel.org> In-Reply-To: <20250221-airoha-en7581-flowtable-offload-v6-0-d593af0e9487@kernel.org> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Felix Fietkau , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Philipp Zabel , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Lorenzo Bianconi , "Chester A. Unal" , Daniel Golle , DENG Qingfang , Andrew Lunn , Vladimir Oltean Cc: netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, upstream@airoha.com X-Mailer: b4 0.14.2 X-Patchwork-Delegate: kuba@kernel.org Packet Processor Engine (PPE) module used for hw acceleration on EN7581 mac block, in order to properly parse packets, requires DSA untagged packets on TX side and read DSA tag from DMA descriptor on RX side. For this reason, enable RX Special Tag (SPTAG) for EN7581 SoC. This is a preliminary patch to enable netfilter flowtable hw offloading on EN7581 SoC. Signed-off-by: Lorenzo Bianconi --- drivers/net/dsa/mt7530.c | 5 +++++ drivers/net/dsa/mt7530.h | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c index 8422262febaf73821887e660c4db77047a91cffb..aaa36c27b0f9f6543db810a135b371bf1d326fa8 100644 --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -2586,6 +2586,11 @@ mt7531_setup_common(struct dsa_switch *ds) /* Allow mirroring frames received on the local port (monitor port). */ mt7530_set(priv, MT753X_AGC, LOCAL_EN); + /* Enable Special Tag for rx frames */ + if (priv->id == ID_EN7581) + mt7530_write(priv, MT753X_CPORT_SPTAG_CFG, + CPORT_SW2FE_STAG_EN | CPORT_FE2SW_STAG_EN); + /* Flush the FDB table */ ret = mt7530_fdb_cmd(priv, MT7530_FDB_FLUSH, NULL); if (ret < 0) diff --git a/drivers/net/dsa/mt7530.h b/drivers/net/dsa/mt7530.h index 448200689f492dcb73ef056d7284090c1c662e67..349d72a35771f35d478244ab29be1801b3466a5f 100644 --- a/drivers/net/dsa/mt7530.h +++ b/drivers/net/dsa/mt7530.h @@ -627,6 +627,10 @@ enum mt7531_xtal_fsel { #define MT7531_GPIO12_RG_RXD3_MASK GENMASK(19, 16) #define MT7531_EXT_P_MDIO_12 (2 << 16) +#define MT753X_CPORT_SPTAG_CFG 0x7c10 +#define CPORT_SW2FE_STAG_EN BIT(1) +#define CPORT_FE2SW_STAG_EN BIT(0) + /* Registers for LED GPIO control (MT7530 only) * All registers follow this pattern: * [ 2: 0] port 0