From patchwork Sun Nov 24 22:42:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Petrous via B4 Relay X-Patchwork-Id: 13884270 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C1112D3B7C3 for ; Sun, 24 Nov 2024 22:44:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Reply-To:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To: References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version: Subject:Date:From:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=CGNlAokFjmhN1EyWyvNQ13rV62s826Uf7N3aP5+qRgI=; b=ArKFJXL8aevk4VGbzhIUlEwsKQ /K5QI/mUlcrLzUe2AKTOpGju3B3jTRavxf2wFtoUJQdFmPJ69B6b0uN0F4YGZ69UCo8tevy+lfBho qvOhJ8wJJq7KL2kuM7aYw8TNrr5cSrAn/yRNW7+Ph26hxCsM8XSfP5lSvuHGrWlcruufJh4hkgfGj 07av5cCjfRL5mUBio6v4LUKDB0SjsRjEICkF7hx4rvAPsRgQoXA1knXBv/YE/7QBEtYL+TVPowSJi 8yxbvVIQNlmfUFLpDiGxIqNwOm1NdLamokqqG3xhdBEG3093F7IwukO02BNOCyixNfEokU5MqTs5a WBwgPwSQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tFLKx-00000006jKa-1wcy; Sun, 24 Nov 2024 22:44:15 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tFLJz-00000006j58-3YXi for linux-arm-kernel@lists.infradead.org; Sun, 24 Nov 2024 22:43:16 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id D76005C5788; Sun, 24 Nov 2024 22:42:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id B488BC4CED3; Sun, 24 Nov 2024 22:43:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732488193; bh=zonr3mCcTyCgwR7d1gZNImuy1doROORC9hQH8Wi0Qyg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=dZyPbFAFDce1m//6kMr24W402SywT46yKFczk4gubVrswBIndWx8seqh3HGdY0ZpR h49r2/jEkTowjhbnJAwgSoL9uJ1NTn7/FoXUXi8NjJ9g61F6jL3IRajzDWO8q2noTq zE953E2RfK9yU8zfM9YyxRRiACGQU5Dpvvu1K2047SLCAYARr5wFL5k/3zIidiVFju RqMGt37MTrq/dvgOXqOWn5oLpJNJHmIfL6rVjeRPx18DhvXuXYyZDXYWd0MlSrPMI4 WeKxUJ83QeRb9XBfqDJnm02xsyYd0DDf+FvinqFp8nyXekz+VjGGcXM8XEQdcRuTyM xyXl4JazeJ96Q== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C1CCD3B7C1; Sun, 24 Nov 2024 22:43:13 +0000 (UTC) From: Jan Petrous via B4 Relay Date: Sun, 24 Nov 2024 23:42:32 +0100 Subject: [PATCH RFC net-next v6 01/15] net: driver: stmmac: Fix CSR divider comment MIME-Version: 1.0 Message-Id: <20241124-upstream_s32cc_gmac-v6-1-dc5718ccf001@oss.nxp.com> References: <20241124-upstream_s32cc_gmac-v6-0-dc5718ccf001@oss.nxp.com> In-Reply-To: <20241124-upstream_s32cc_gmac-v6-0-dc5718ccf001@oss.nxp.com> To: Maxime Coquelin , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Vinod Koul , Richard Cochran , Andrew Lunn , Heiner Kallweit , Russell King , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Emil Renner Berthing , Minda Chen , Nicolas Ferre , Claudiu Beznea , Iyappan Subramanian , Keyur Chudgar , Quan Nguyen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Giuseppe Cavallaro , Andrew Lunn Cc: linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, imx@lists.linux.dev, devicetree@vger.kernel.org, NXP S32 Linux Team , "Jan Petrous (OSS)" , Jacob Keller X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1732488190; l=958; i=jan.petrous@oss.nxp.com; s=20240922; h=from:subject:message-id; bh=2KaIHv/oSTo3FOtKPvkHjEF7Z3D3rI5ymtYbTqdzAuo=; b=VeQTUt7bpyeUnOUMlwx/qJ3/IOpuR0SPvnz4wyFi1qJmnGWXSSPrMgs+83RE4BxrJPpFPPRnc mxLHaVNrZ6lBd8WddOX58/LTOeOjFih/Xh72VNtk8jiGb9VzP+/bLH0 X-Developer-Key: i=jan.petrous@oss.nxp.com; a=ed25519; pk=Ke3wwK7rb2Me9UQRf6vR8AsfJZfhTyoDaxkUCqmSWYY= X-Endpoint-Received: by B4 Relay for jan.petrous@oss.nxp.com/20240922 with auth_id=217 X-Original-From: "Jan Petrous (OSS)" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241124_144315_981171_54B4CA58 X-CRM114-Status: GOOD ( 11.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: jan.petrous@oss.nxp.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: "Jan Petrous (OSS)" The comment in declaration of STMMAC_CSR_250_300M incorrectly describes the constant as '/* MDC = clk_scr_i/122 */' but the DWC Ether QOS Handbook version 5.20a says it is CSR clock/124. Signed-off-by: Jan Petrous (OSS) Reviewed-by: Jacob Keller --- include/linux/stmmac.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index d79ff252cfdc..75cbfb576358 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -33,7 +33,7 @@ #define STMMAC_CSR_20_35M 0x2 /* MDC = clk_scr_i/16 */ #define STMMAC_CSR_35_60M 0x3 /* MDC = clk_scr_i/26 */ #define STMMAC_CSR_150_250M 0x4 /* MDC = clk_scr_i/102 */ -#define STMMAC_CSR_250_300M 0x5 /* MDC = clk_scr_i/122 */ +#define STMMAC_CSR_250_300M 0x5 /* MDC = clk_scr_i/124 */ /* MTL algorithms identifiers */ #define MTL_TX_ALGORITHM_WRR 0x0 From patchwork Sun Nov 24 22:42:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Petrous via B4 Relay X-Patchwork-Id: 13884273 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D3844D3B7C2 for ; Sun, 24 Nov 2024 22:47:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Reply-To:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To: References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version: Subject:Date:From:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=QSIK7NGK6jotaiJULOg5Z7yk2qqC44+FoKWEDmQYxJo=; b=A8KnYOFfY1MNazQWYzG/3mHYI/ Cxq7nk1MDQ5D7DFvYPcuawI7nITKrYKzEt2YYMi/HI66hI0Kuz3l25uIgFD/DeF7Wu8lpvA0ZgcPJ F5+GLPUdMG8O8/PfXgy7AlrelSjjs+IaRMcFL8zrU4gWhqn/Kmn8P1YStarhq3W8QzY/Cmi7WdWd9 FmmlyiP/w0Gi0GwSQn3Q23lFWdAOUOFx/8W1Y2W5zxaBpB59QLnQOVNIYhy8+ABBUsLpkrYRNmD51 468/JkKdeYAGSIb88R2zK626v96ogRu82wOsuurO5038SkZvs+bG3kbjzhXXzjMthc/JyXuLVq2GM bc8XjH6w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tFLNl-00000006kBK-1F7m; Sun, 24 Nov 2024 22:47:09 +0000 Received: from nyc.source.kernel.org ([2604:1380:45d1:ec00::3]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tFLJz-00000006j5D-3tYy for linux-arm-kernel@lists.infradead.org; Sun, 24 Nov 2024 22:43:18 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 9F137A41009; Sun, 24 Nov 2024 22:41:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id C579BC4CED1; Sun, 24 Nov 2024 22:43:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732488193; bh=NzNnR4GIKVZyHfo3hHmIgfUcE7ydDOgKghMULW6fcWA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=HPdLj9mpHaEyDC6qtlF88wz7FyL625BhiTn8L+Hb7BL0JCj8ZqjDvWxw5uVmaaFu2 qhIU+UfMXAc8R6cnLRfHXGGhN1gTzvtMnlActLZCpLTc5vt/cWXNBZ1dIo4cwj/fpe bvaSILMNA/V4g0it2grCZl8iwwv8j71q8aV5ZTUG1c1Aa3OuIC3ovQBphNChHCwxLs TWEZ6LUBzcqu1efuGg4OmJSdEUoWmss8dra9OKfwPCgLZf8zne5/SuMM7KCszcIG+3 Zt/cmjWnB1SBEOZYVdRVKiTV0nLpa+FFFzx40oy2IDSioehb5FpK8hlfxIUvGLp7dn 2FjAy6UMs+kWA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3436D3B7C0; Sun, 24 Nov 2024 22:43:13 +0000 (UTC) From: Jan Petrous via B4 Relay Date: Sun, 24 Nov 2024 23:42:33 +0100 Subject: [PATCH RFC net-next v6 02/15] net: driver: stmmac: Extend CSR calc support MIME-Version: 1.0 Message-Id: <20241124-upstream_s32cc_gmac-v6-2-dc5718ccf001@oss.nxp.com> References: <20241124-upstream_s32cc_gmac-v6-0-dc5718ccf001@oss.nxp.com> In-Reply-To: <20241124-upstream_s32cc_gmac-v6-0-dc5718ccf001@oss.nxp.com> To: Maxime Coquelin , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Vinod Koul , Richard Cochran , Andrew Lunn , Heiner Kallweit , Russell King , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Emil Renner Berthing , Minda Chen , Nicolas Ferre , Claudiu Beznea , Iyappan Subramanian , Keyur Chudgar , Quan Nguyen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Giuseppe Cavallaro , Andrew Lunn Cc: linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, imx@lists.linux.dev, devicetree@vger.kernel.org, NXP S32 Linux Team , "Jan Petrous (OSS)" , Jacob Keller , "Russell King (Oracle)" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1732488190; l=2290; i=jan.petrous@oss.nxp.com; s=20240922; h=from:subject:message-id; bh=XFymp62H65MIRcMwAf+jhdS6qH2oPC0Qen8xklC1jkk=; b=c9a5nzfuK5IyCHSrZGqtaogzMVPqXPCKa8rHrvGWLbTHrqaYtqctToHXJKpf7unrfsIykOTKP cCVOwi8v22tDDRN+aELroJT/jx5qHPTCxmKarQxZLJXfvm+7RKXNish X-Developer-Key: i=jan.petrous@oss.nxp.com; a=ed25519; pk=Ke3wwK7rb2Me9UQRf6vR8AsfJZfhTyoDaxkUCqmSWYY= X-Endpoint-Received: by B4 Relay for jan.petrous@oss.nxp.com/20240922 with auth_id=217 X-Original-From: "Jan Petrous (OSS)" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241124_144316_109164_41FAF3CB X-CRM114-Status: GOOD ( 11.80 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: jan.petrous@oss.nxp.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: "Jan Petrous (OSS)" Add support for CSR clock range up to 800 MHz. Reviewed-by: Jacob Keller Reviewed-by: Russell King (Oracle) Signed-off-by: Jan Petrous (OSS) --- drivers/net/ethernet/stmicro/stmmac/common.h | 2 ++ drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++++ include/linux/stmmac.h | 2 ++ 3 files changed, 8 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/common.h b/drivers/net/ethernet/stmicro/stmmac/common.h index 1367fa5c9b8e..70d601f45481 100644 --- a/drivers/net/ethernet/stmicro/stmmac/common.h +++ b/drivers/net/ethernet/stmicro/stmmac/common.h @@ -257,6 +257,8 @@ struct stmmac_safety_stats { #define CSR_F_150M 150000000 #define CSR_F_250M 250000000 #define CSR_F_300M 300000000 +#define CSR_F_500M 500000000 +#define CSR_F_800M 800000000 #define MAC_CSR_H_FRQ_MASK 0x20 diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 3cdc3910f3a0..8304f82b3a50 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -325,6 +325,10 @@ static void stmmac_clk_csr_set(struct stmmac_priv *priv) priv->clk_csr = STMMAC_CSR_150_250M; else if ((clk_rate >= CSR_F_250M) && (clk_rate <= CSR_F_300M)) priv->clk_csr = STMMAC_CSR_250_300M; + else if ((clk_rate >= CSR_F_300M) && (clk_rate < CSR_F_500M)) + priv->clk_csr = STMMAC_CSR_300_500M; + else if ((clk_rate >= CSR_F_500M) && (clk_rate < CSR_F_800M)) + priv->clk_csr = STMMAC_CSR_500_800M; } if (priv->plat->flags & STMMAC_FLAG_HAS_SUN8I) { diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 75cbfb576358..865d0fe26f98 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -34,6 +34,8 @@ #define STMMAC_CSR_35_60M 0x3 /* MDC = clk_scr_i/26 */ #define STMMAC_CSR_150_250M 0x4 /* MDC = clk_scr_i/102 */ #define STMMAC_CSR_250_300M 0x5 /* MDC = clk_scr_i/124 */ +#define STMMAC_CSR_300_500M 0x6 /* MDC = clk_scr_i/204 */ +#define STMMAC_CSR_500_800M 0x7 /* MDC = clk_scr_i/324 */ /* MTL algorithms identifiers */ #define MTL_TX_ALGORITHM_WRR 0x0 From patchwork Sun Nov 24 22:42:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Petrous via B4 Relay X-Patchwork-Id: 13884272 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7D22AD3B7C3 for ; Sun, 24 Nov 2024 22:46:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Reply-To:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To: References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version: Subject:Date:From:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=QsDW20cFRpJQLdZBt1cW3CzhTlgjogfBe8v/rkUBxgo=; b=cVwjcM33flLgdXW/PfneR8KM9i jjgVJHgK1JYHca1a3PogDJUM/GrFm/lK64H1TCHLiEb0YLxhr19yfxtjVQUcKkaP9f977fuhPznK2 sS9A0g8gmyksyzIwacFx6YyM01N4+hdZjA2nxVGO75vlmD9iIePsLsBAOGjjyc45nnDo0roYH3/qc K36EhiUswSkbGCKvVBQN2rKmj9wEAU7T77UUfkoRF6lUof/mNuAIR8BEBkcaco9uSS3auHIFxCzHY yZrKYECMssihDq8hCwNPCu2yRSkAnIUqSCPLs0jHk1U857YuTR9wnaBljDzL1KkuvOOl9rqbHwkbT 9dVKZuTA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tFLMo-00000006jst-2wLV; Sun, 24 Nov 2024 22:46:10 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tFLJz-00000006j5E-3uBC for linux-arm-kernel@lists.infradead.org; Sun, 24 Nov 2024 22:43:18 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 2F6925C579E; Sun, 24 Nov 2024 22:42:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id D5805C4CEDB; Sun, 24 Nov 2024 22:43:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732488193; bh=n/Zmpn1SW9SKnUGt+nFAHEbVDk6vv8Ps2OCoF2nXL94=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=IXW1odbDEeRnoPfClYmnuoo1UwdToSgEB/2rI873KI50zqjpomMbmAryDW+5iN5Gu adESSrC55zgnYgJyN3rgkwMnCF6ZMJJUthv1DE5hBM0qGDNUs12TTdQNJwpToTn3l2 x0f9T7Oc2paqp+m6F1hv8EhuTfruEdAKZx7UpL1JhF0g06r4Zst7cRypJhoE9M1OPl 0uWlUF1BXiomy/luhzIAeDO1Rt2MBdKAWKZNgQH75gyarVKukaTFKosDIRJN+sv607 akVjX/S7T0NBeT12y5hBpIU84FOfkRi5OYkvbyzoKWafPpZJRNEUYol/R//41/cMEN 2cHZGpfbZ3row== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id C700ED3B7C2; Sun, 24 Nov 2024 22:43:13 +0000 (UTC) From: Jan Petrous via B4 Relay Date: Sun, 24 Nov 2024 23:42:34 +0100 Subject: [PATCH RFC net-next v6 03/15] net: stmmac: Fix clock rate variables size MIME-Version: 1.0 Message-Id: <20241124-upstream_s32cc_gmac-v6-3-dc5718ccf001@oss.nxp.com> References: <20241124-upstream_s32cc_gmac-v6-0-dc5718ccf001@oss.nxp.com> In-Reply-To: <20241124-upstream_s32cc_gmac-v6-0-dc5718ccf001@oss.nxp.com> To: Maxime Coquelin , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Vinod Koul , Richard Cochran , Andrew Lunn , Heiner Kallweit , Russell King , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Emil Renner Berthing , Minda Chen , Nicolas Ferre , Claudiu Beznea , Iyappan Subramanian , Keyur Chudgar , Quan Nguyen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Giuseppe Cavallaro , Andrew Lunn Cc: linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, imx@lists.linux.dev, devicetree@vger.kernel.org, NXP S32 Linux Team , "Jan Petrous (OSS)" , Serge Semin , "Russell King (Oracle)" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1732488190; l=4080; i=jan.petrous@oss.nxp.com; s=20240922; h=from:subject:message-id; bh=PjyG/bciJnCl1zgeP+KpvNNgB+qJrOmgZuJqhRBWPuo=; b=znvrXADUMs7BxpCCyJgP1HuR3JqECd26+Chy+zoixcHYROslkHXw/fTTAB+uowr5PemF3CLtK 01+r6V+Ys4WB5tuqI6/KCRdJHwt2810f73zX4oeBSttpiWq16dO6c9R X-Developer-Key: i=jan.petrous@oss.nxp.com; a=ed25519; pk=Ke3wwK7rb2Me9UQRf6vR8AsfJZfhTyoDaxkUCqmSWYY= X-Endpoint-Received: by B4 Relay for jan.petrous@oss.nxp.com/20240922 with auth_id=217 X-Original-From: "Jan Petrous (OSS)" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241124_144316_061534_3B2671DC X-CRM114-Status: GOOD ( 13.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: jan.petrous@oss.nxp.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: "Jan Petrous (OSS)" The clock API clk_get_rate() returns unsigned long value. Expand affected members of stmmac platform data and convert the stmmac_clk_csr_set() and dwmac4_core_init() methods to defining the unsigned long clk_rate local variables. Reviewed-by: Andrew Lunn Reviewed-by: Serge Semin Reviewed-by: Russell King (Oracle) Signed-off-by: Jan Petrous (OSS) --- drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 2 +- drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 2 +- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 2 +- include/linux/stmmac.h | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index 901a3c1959fa..2a5b38723635 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -777,7 +777,7 @@ static void ethqos_ptp_clk_freq_config(struct stmmac_priv *priv) netdev_err(priv->dev, "Failed to max out clk_ptp_ref: %d\n", err); plat_dat->clk_ptp_rate = clk_get_rate(plat_dat->clk_ptp_ref); - netdev_dbg(priv->dev, "PTP rate %d\n", plat_dat->clk_ptp_rate); + netdev_dbg(priv->dev, "PTP rate %lu\n", plat_dat->clk_ptp_rate); } static int qcom_ethqos_probe(struct platform_device *pdev) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c index c25781874aa7..c36f90a782c5 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c @@ -27,7 +27,7 @@ static void dwmac4_core_init(struct mac_device_info *hw, struct stmmac_priv *priv = netdev_priv(dev); void __iomem *ioaddr = hw->pcsr; u32 value = readl(ioaddr + GMAC_CONFIG); - u32 clk_rate; + unsigned long clk_rate; value |= GMAC_CORE_INIT; diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 8304f82b3a50..efbf34456612 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -301,7 +301,7 @@ static void stmmac_global_err(struct stmmac_priv *priv) */ static void stmmac_clk_csr_set(struct stmmac_priv *priv) { - u32 clk_rate; + unsigned long clk_rate; clk_rate = clk_get_rate(priv->plat->stmmac_clk); diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index 3ac32444e492..06e07e6e180b 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c @@ -640,7 +640,7 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac) dev_info(&pdev->dev, "PTP uses main clock\n"); } else { plat->clk_ptp_rate = clk_get_rate(plat->clk_ptp_ref); - dev_dbg(&pdev->dev, "PTP rate %d\n", plat->clk_ptp_rate); + dev_dbg(&pdev->dev, "PTP rate %lu\n", plat->clk_ptp_rate); } plat->stmmac_rst = devm_reset_control_get_optional(&pdev->dev, diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 865d0fe26f98..c9878a612e53 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -252,8 +252,8 @@ struct plat_stmmacenet_data { struct clk *stmmac_clk; struct clk *pclk; struct clk *clk_ptp_ref; - unsigned int clk_ptp_rate; - unsigned int clk_ref_rate; + unsigned long clk_ptp_rate; + unsigned long clk_ref_rate; unsigned int mult_fact_100ns; s32 ptp_max_adj; u32 cdc_error_adj; @@ -265,7 +265,7 @@ struct plat_stmmacenet_data { int mac_port_sel_speed; int has_xgmac; u8 vlan_fail_q; - unsigned int eee_usecs_rate; + unsigned long eee_usecs_rate; struct pci_dev *pdev; int int_snapshot_num; int msi_mac_vec; From patchwork Sun Nov 24 22:42:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Petrous via B4 Relay X-Patchwork-Id: 13884276 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C8F20D3B7C2 for ; Sun, 24 Nov 2024 22:49:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Reply-To:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To: References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version: Subject:Date:From:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=4UuJeCai5tiWosHWBozDPvC6IfFLgO2kYlWjyCFqxDc=; b=PQirh4C9xoZUkcAtKaeD9hXwcm GhGDXBEee4zILEUr0MIdsLgM7duBqEPc0WRzrYMA9Dh3jXazE2JQ7votIU1EfWJGZa+QHPOVbhR8H EPsfD4fBkFN2MA5nKLzo9NngpF3Rphe3ZBpUKYo+Z1aPuoe75mhbDJJvC+0f+BwXhAkw78oEKVkBh El/tiOvCcFeKeaZUb9jnZqQ3oclgCMqmL2O250h1wTfTCxx6Yp4hl5JNv+PGqy5YAwKBLCkPIiCR6 pYv9BsVKg6KblluEsavWhYkJ65mSMElfMKMsjvxixkx8CF7i51l+OHMsFVWhjBesH7sClkzjY7vHL B6rP30ZQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tFLPc-00000006kdz-2csP; Sun, 24 Nov 2024 22:49:04 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tFLK0-00000006j5W-1JpZ for linux-arm-kernel@lists.infradead.org; Sun, 24 Nov 2024 22:43:18 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 4264D5C57A3; Sun, 24 Nov 2024 22:42:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id EDF25C4CEE2; Sun, 24 Nov 2024 22:43:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732488194; bh=ASdzTe34Z+d59Brp4wy1vpf4xly9YpxzqxiqU7BbVP0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=shGXhO9qj4Vod1iK+HMfXSDtqQM9s5/H9cVNvy9RVzvhnza9IjZ027ogdED4byS5t s+MJfWb+EDnSjLCrQE2wkRMpy2r+OT48KiIvxre5hd/5jRTpuVzNTGxXvleFFsPJ/s twNYGcGnOdfSSA4U92WGbF+F1BfSSTx/aUIHBvq4PQDUQFMgjgmiU+yahbdvA2m3BP OwzxwkFlUzZuQyGMhKzAMDNxInvEU0t75cAPpm0UB+6r/9H+SXmRUZ+u0b+E1UutWI xX+WUhbR06ib5z6Rv1oYqcUunJUV5uebXwulyGyLs5F+WHyZqfwE2Yi1KUDX4nKw7n ZgYsYAVZZsJSw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id DA9EED3B7C4; Sun, 24 Nov 2024 22:43:13 +0000 (UTC) From: Jan Petrous via B4 Relay Date: Sun, 24 Nov 2024 23:42:35 +0100 Subject: [PATCH RFC net-next v6 04/15] net: phy: Add helper for mapping RGMII link speed to clock rate MIME-Version: 1.0 Message-Id: <20241124-upstream_s32cc_gmac-v6-4-dc5718ccf001@oss.nxp.com> References: <20241124-upstream_s32cc_gmac-v6-0-dc5718ccf001@oss.nxp.com> In-Reply-To: <20241124-upstream_s32cc_gmac-v6-0-dc5718ccf001@oss.nxp.com> To: Maxime Coquelin , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Vinod Koul , Richard Cochran , Andrew Lunn , Heiner Kallweit , Russell King , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Emil Renner Berthing , Minda Chen , Nicolas Ferre , Claudiu Beznea , Iyappan Subramanian , Keyur Chudgar , Quan Nguyen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Giuseppe Cavallaro , Andrew Lunn Cc: linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, imx@lists.linux.dev, devicetree@vger.kernel.org, NXP S32 Linux Team , "Jan Petrous (OSS)" , "Russell King (Oracle)" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1732488190; l=1509; i=jan.petrous@oss.nxp.com; s=20240922; h=from:subject:message-id; bh=fpWmpczGATKRZSZUfvD41WjUjGR83jNPIPJUZeOtjsk=; b=n+FUBIb08C4MW29U1TwIN+jAnwb5gQDX3x+iM8uBEh3wGvLkmbG8sYsamLmxZ3aCohoJLLMAT Zv6nMCNB+zzDPC7y7MBxFnFTGp/4Qv7JsyO2YTO7YrQKqRXCBCU24Ks X-Developer-Key: i=jan.petrous@oss.nxp.com; a=ed25519; pk=Ke3wwK7rb2Me9UQRf6vR8AsfJZfhTyoDaxkUCqmSWYY= X-Endpoint-Received: by B4 Relay for jan.petrous@oss.nxp.com/20240922 with auth_id=217 X-Original-From: "Jan Petrous (OSS)" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241124_144316_441120_4EAFDB74 X-CRM114-Status: GOOD ( 10.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: jan.petrous@oss.nxp.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: "Jan Petrous (OSS)" The RGMII interface supports three data rates: 10/100 Mbps and 1 Gbps. These speeds correspond to clock frequencies of 2.5/25 MHz and 125 MHz, respectively. Many Ethernet drivers, including glues in stmmac, follow a similar pattern of converting RGMII speed to clock frequency. To simplify code, define the helper rgmii_clock(speed) to convert connection speed to clock frequency. Suggested-by: Russell King (Oracle) Reviewed-by: Andrew Lunn Reviewed-by: Russell King (Oracle) Signed-off-by: Jan Petrous (OSS) --- include/linux/phy.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/include/linux/phy.h b/include/linux/phy.h index 77c6d6451638..9d0717ccd5c0 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -298,6 +298,29 @@ static inline const char *phy_modes(phy_interface_t interface) } } +/** + * rgmii_clock - map link speed to the clock rate + * @speed: link speed value + * + * Description: maps RGMII supported link speeds + * into the clock rates. + * + * Returns: clock rate or negative errno + */ +static inline long rgmii_clock(int speed) +{ + switch (speed) { + case SPEED_10: + return 2500000; + case SPEED_100: + return 25000000; + case SPEED_1000: + return 125000000; + default: + return -EINVAL; + } +} + #define PHY_INIT_TIMEOUT 100000 #define PHY_FORCE_TIMEOUT 10 From patchwork Sun Nov 24 22:42:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Petrous via B4 Relay X-Patchwork-Id: 13884277 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 49DAAD3B7C3 for ; Sun, 24 Nov 2024 22:50:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Reply-To:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To: References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version: Subject:Date:From:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=czEMZ2LYZ7yn4W/XpL9xxgwSyAv54G8CxWzNOcpEJ10=; b=JRvSV4R2sJi5dTpdBF75z9XUwN zDqnhw1hM6V4ctrzNEjNHRlRdiG9aWt9Bb2P5QIhU5rEb7j7T/bDLdBWtUujPz9hYFVMiHSb9bglC GyQSPLv6l29i/hHWPySyfRgCEXVm0+jl21AbKZcsgBcb549NIkYVNvgRqNQjfk+EvXSltyzVqRx5N Dwen4GjDGxpa6OID4mrPJeaKAtu5IShNXsOdQABGbaSuglRQ/8czXGRQz9RAZcb7BeW5E4WxhWGks mJrirmCYMkbhDJQGL0xrmR/HhsdKqK4D3dNU7a55bRGCr1xvphgzrT2yAjEh/nfSNZY0iOs1hkxZs 5M/7ulYQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tFLQX-00000006kmI-0xdF; Sun, 24 Nov 2024 22:50:01 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tFLK0-00000006j6O-3KOa for linux-arm-kernel@lists.infradead.org; Sun, 24 Nov 2024 22:43:18 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 7A32F5C57CE; Sun, 24 Nov 2024 22:42:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 0D933C4CEE5; Sun, 24 Nov 2024 22:43:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732488194; bh=cDLcuBxu4MlG3S8lQE9mNu4I9S677lFh6lW7mFum0/A=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=NdfMb726ww0KfATG3uJuXG93d5eFU7hJ/kXKPSco/6uKIGr0970+aOTcElAOPaI6E zUp+GONdgCXRRFgT2a4vXKVAi1pYsKCJOsUBJCAIAqpBMr0HE56OkHj0AHG6VhX8fI sUKdbq619MuK+ucfVzMWw7hCktO0UQP/ofX2pDJrjfnYiLLcoar15RB1H3PP1WJ4/m KbJsO/gqsKNj1TbZFTF0zmtAZmJxGQD/TqQnoPeiw4rpxxyP3jmyWdR+pa7zLQdLA/ vO0/LWlF5u3vhxyK3S1/S6/ruEQv6FO5Itp9LD18z1moGqgwc5EpDTRINaOXvNkf+X zZ0xbDlD14wrg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2859D3B7C3; Sun, 24 Nov 2024 22:43:13 +0000 (UTC) From: Jan Petrous via B4 Relay Date: Sun, 24 Nov 2024 23:42:36 +0100 Subject: [PATCH RFC net-next v6 05/15] net: dwmac-dwc-qos-eth: Use helper rgmii_clock MIME-Version: 1.0 Message-Id: <20241124-upstream_s32cc_gmac-v6-5-dc5718ccf001@oss.nxp.com> References: <20241124-upstream_s32cc_gmac-v6-0-dc5718ccf001@oss.nxp.com> In-Reply-To: <20241124-upstream_s32cc_gmac-v6-0-dc5718ccf001@oss.nxp.com> To: Maxime Coquelin , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Vinod Koul , Richard Cochran , Andrew Lunn , Heiner Kallweit , Russell King , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Emil Renner Berthing , Minda Chen , Nicolas Ferre , Claudiu Beznea , Iyappan Subramanian , Keyur Chudgar , Quan Nguyen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Giuseppe Cavallaro , Andrew Lunn Cc: linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, imx@lists.linux.dev, devicetree@vger.kernel.org, NXP S32 Linux Team , "Jan Petrous (OSS)" , "Russell King (Oracle)" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1732488190; l=1290; i=jan.petrous@oss.nxp.com; s=20240922; h=from:subject:message-id; bh=ZX+NwH2HQko3cIWDQjmmck130Lb3TijMXiPn59w6r/U=; b=5f2wvoUkBkxm9GyZz8o8nQ+XG6DNA+DUtQv3u0hsNIs6JY1TmH2rxm9R/RkqWpXkI20dNIQCq 7op/XU1+JoaBWyiiCiwiurfYiH4ioAXYvhDBA5EMT4R/OLIVS2kAzsX X-Developer-Key: i=jan.petrous@oss.nxp.com; a=ed25519; pk=Ke3wwK7rb2Me9UQRf6vR8AsfJZfhTyoDaxkUCqmSWYY= X-Endpoint-Received: by B4 Relay for jan.petrous@oss.nxp.com/20240922 with auth_id=217 X-Original-From: "Jan Petrous (OSS)" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241124_144316_919894_04E85622 X-CRM114-Status: GOOD ( 10.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: jan.petrous@oss.nxp.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: "Jan Petrous (OSS)" Utilize a new helper function rgmii_clock(). Reviewed-by: Andrew Lunn Reviewed-by: Russell King (Oracle) Signed-off-by: Jan Petrous (OSS) --- drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c index 83290e707df5..bd4eb187f8c6 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c @@ -181,24 +181,19 @@ static void dwc_qos_remove(struct platform_device *pdev) static void tegra_eqos_fix_speed(void *priv, unsigned int speed, unsigned int mode) { struct tegra_eqos *eqos = priv; - unsigned long rate = 125000000; bool needs_calibration = false; + long rate = 125000000; u32 value; int err; switch (speed) { case SPEED_1000: - needs_calibration = true; - rate = 125000000; - break; - case SPEED_100: needs_calibration = true; - rate = 25000000; - break; + fallthrough; case SPEED_10: - rate = 2500000; + rate = rgmii_clock(speed); break; default: From patchwork Sun Nov 24 22:42:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Petrous via B4 Relay X-Patchwork-Id: 13884280 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AC1C4D3B7C3 for ; Sun, 24 Nov 2024 22:53:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Reply-To:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To: References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version: Subject:Date:From:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Ts35rcKCuatC08lXoSSuzq3DRWdEbfMfyrqLNSbugOw=; b=pf2ijRQ7/5is3uDlAkd3Fn5EXi nXsMcIDP+dKtQZtcrHTgs3LdxNtRsFHLAHiIjcKHMEnfBEIghEeGCP/aQqJlwkLwnkfvc2c9tViaQ UlPqFtqkVfB7C/L7d6+WjTt/Cu1PEMHAq7EwVdD30qIXolTdfp2rGeuHsR0RyOB/t/M0sYl+ptBpq akd0QpgCionmuJi/OopbYqsJjbXWuNkZgDlYMgRAGDL5HAfckr3A3O1HFRNHFWfDSayFZgAmtXfsV Iwpl6srRzn/6abxtwLuxdKJ7kt2/Q+S/x5IrRL/vOSZoFpYJ6Wf22901rxFgJe54ScZOr+f4QJhBl 1xJeHvDw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tFLTJ-00000006l3b-0Fa5; Sun, 24 Nov 2024 22:52:53 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tFLK1-00000006j71-1r8N for linux-arm-kernel@lists.infradead.org; Sun, 24 Nov 2024 22:43:19 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 689455C57C8; Sun, 24 Nov 2024 22:42:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 1F2C5C4CEE9; Sun, 24 Nov 2024 22:43:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732488194; bh=2tMu+v0wz2kD7vp6+Ltgu032C6Y9FI2iXPc3O/OTgDs=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=H9SZAW9zELbxIdRU9KWs7yzW7IBIUu6Khvb13uuuQz6rWhHsYZbcbK+s5REIMCR98 Wf7IvR/rP1G7Bx4s0J33UBv28/UuVtt6Ujj/qt0ok6oAv09d5dTK3eF9rXWRKVDMjf gllUAYFswYlkTd7dm2T+O4Z9yXtIgZF5i8O/lm/ZfBtUkcmjQuAf7EiDgwgHPcnSh6 whhgo6xlR2tfSFwP9xjnNgnKDOV48Bt5yff6m+RiofZLwRRuwSkKO2oitDdP4/RmbZ Mj0RXlcaz3uQ39ScsjV3POsbA7HTR0AR+0C/vYFv/0jdHw/Q/hyUcjOXyYbVaeVIo+ kxnNS4ReV+x1Q== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14AD3D3B7C0; Sun, 24 Nov 2024 22:43:14 +0000 (UTC) From: Jan Petrous via B4 Relay Date: Sun, 24 Nov 2024 23:42:37 +0100 Subject: [PATCH RFC net-next v6 06/15] net: dwmac-imx: Use helper rgmii_clock MIME-Version: 1.0 Message-Id: <20241124-upstream_s32cc_gmac-v6-6-dc5718ccf001@oss.nxp.com> References: <20241124-upstream_s32cc_gmac-v6-0-dc5718ccf001@oss.nxp.com> In-Reply-To: <20241124-upstream_s32cc_gmac-v6-0-dc5718ccf001@oss.nxp.com> To: Maxime Coquelin , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Vinod Koul , Richard Cochran , Andrew Lunn , Heiner Kallweit , Russell King , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Emil Renner Berthing , Minda Chen , Nicolas Ferre , Claudiu Beznea , Iyappan Subramanian , Keyur Chudgar , Quan Nguyen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Giuseppe Cavallaro , Andrew Lunn Cc: linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, imx@lists.linux.dev, devicetree@vger.kernel.org, NXP S32 Linux Team , "Jan Petrous (OSS)" , "Russell King (Oracle)" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1732488190; l=1376; i=jan.petrous@oss.nxp.com; s=20240922; h=from:subject:message-id; bh=SsszkUP8I3NbcQMnOnyLygQGzFscaLh2fXkadRBQwQg=; b=SCSns3Qip+S8U2y2jO9SHEBK6YW4GKIwkZvJecmvH34A/QUaKJqmj67/CGbqjKMUpMz1GgqMe L1hL4ZOm+gYDJyeY+1mo5u69+NHXhGQ3t3EKpomRPVKe8Yz9zFDSNJZ X-Developer-Key: i=jan.petrous@oss.nxp.com; a=ed25519; pk=Ke3wwK7rb2Me9UQRf6vR8AsfJZfhTyoDaxkUCqmSWYY= X-Endpoint-Received: by B4 Relay for jan.petrous@oss.nxp.com/20240922 with auth_id=217 X-Original-From: "Jan Petrous (OSS)" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241124_144317_608870_CDACF6E7 X-CRM114-Status: GOOD ( 11.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: jan.petrous@oss.nxp.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: "Jan Petrous (OSS)" Utilize a new helper function rgmii_clock(). Reviewed-by: Andrew Lunn Reviewed-by: Russell King (Oracle) Signed-off-by: Jan Petrous (OSS) --- drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c index 641f3cd019a3..43e0fbba4f77 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c @@ -186,7 +186,7 @@ static void imx_dwmac_fix_speed(void *priv, unsigned int speed, unsigned int mod { struct plat_stmmacenet_data *plat_dat; struct imx_priv_data *dwmac = priv; - unsigned long rate; + long rate; int err; plat_dat = dwmac->plat_dat; @@ -196,17 +196,8 @@ static void imx_dwmac_fix_speed(void *priv, unsigned int speed, unsigned int mod (plat_dat->mac_interface == PHY_INTERFACE_MODE_MII)) return; - switch (speed) { - case SPEED_1000: - rate = 125000000; - break; - case SPEED_100: - rate = 25000000; - break; - case SPEED_10: - rate = 2500000; - break; - default: + rate = rgmii_clock(speed); + if (rate < 0) { dev_err(dwmac->dev, "invalid speed %u\n", speed); return; } From patchwork Sun Nov 24 22:42:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Petrous via B4 Relay X-Patchwork-Id: 13884278 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5C398D3B7C2 for ; Sun, 24 Nov 2024 22:51:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Reply-To:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To: References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version: Subject:Date:From:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=XWu6Z5v7RGtsxQryvFIF5ARBAtAKsVetYj8/dSX2OYc=; b=H+qF9wYvgpbM9IPBrzTqt/5aUJ N20fp6xE3sb9kC9a/5JPArJFfoW7maOvD6WS1H+FY3QWItkMjjQgCu/jScNuO7cjr8rX+Mt1K7qY8 bA4O9lDJkOS2Oh1K+RQ6LU2zSM60u6jijNf7+7r9K/wXU3eF0FVUGo6vxmskpDPtrPtyPc7Q/+CX2 L80WFHvcau15yA3QcCAHV+rHlOek8qDpTPTKroiBEvuuvNPkEhLEJ0JfUwdlLj7Ft+JQjZNMqDdoN RWAgbup8saGjGlAAuW2WAIgo/M1Cny96DE/3538MYRkIb9huvI8a1F3rzQ6zvHDjV3SBvEgpPr7oy YKOiMRjQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tFLRS-00000006krk-3Sk8; Sun, 24 Nov 2024 22:50:58 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tFLK1-00000006j6Q-0aiU for linux-arm-kernel@lists.infradead.org; Sun, 24 Nov 2024 22:43:19 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 800245C57CF; Sun, 24 Nov 2024 22:42:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 338B9C4CEED; Sun, 24 Nov 2024 22:43:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732488194; bh=MdqsHWxoEbswm9BrGX6SpwNbcHkCUMsgVrFUDFuO4JM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=Whr7N3ipxGRqqEqURMRpVsMLIslzEgpMpOC4sqQPvCrTYf9c1uzIqchtVgoco7MdS JYYzGNXJJ3HoFumZpip9TbKU8w4bxE+jptktdVOwbupex1DMtMgG/X8KR/aU5JT5BN JgoBLG+Tf+GjV2CKpyNfaUcNQtaTfX2xh1f3ZD5Ql5k03Ae5ZKXKO5GHJCosL1mHVG 2/xIPuo0thMbal833i/EvBAfFepn8pEv6xeO8G95zjAMzSSdBhQcgH3GsCzj9zIPUj U6KudhaD6et2bekCK4S9tHqUGaeMEndrSqsUmK5Pc0K1novCW+FKvAED7KyLSbkXi3 dniP/PkpHbKKg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27DF1D3B7C3; Sun, 24 Nov 2024 22:43:14 +0000 (UTC) From: Jan Petrous via B4 Relay Date: Sun, 24 Nov 2024 23:42:38 +0100 Subject: [PATCH RFC net-next v6 07/15] net: dwmac-intel-plat: Use helper rgmii_clock MIME-Version: 1.0 Message-Id: <20241124-upstream_s32cc_gmac-v6-7-dc5718ccf001@oss.nxp.com> References: <20241124-upstream_s32cc_gmac-v6-0-dc5718ccf001@oss.nxp.com> In-Reply-To: <20241124-upstream_s32cc_gmac-v6-0-dc5718ccf001@oss.nxp.com> To: Maxime Coquelin , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Vinod Koul , Richard Cochran , Andrew Lunn , Heiner Kallweit , Russell King , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Emil Renner Berthing , Minda Chen , Nicolas Ferre , Claudiu Beznea , Iyappan Subramanian , Keyur Chudgar , Quan Nguyen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Giuseppe Cavallaro , Andrew Lunn Cc: linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, imx@lists.linux.dev, devicetree@vger.kernel.org, NXP S32 Linux Team , "Jan Petrous (OSS)" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1732488190; l=1284; i=jan.petrous@oss.nxp.com; s=20240922; h=from:subject:message-id; bh=Ku8xMy0eJs5aGJR44zqrL9wRlkD9lntzlgmaMXGJpvg=; b=lQUMy7QkAQV8NCwY52bjKCRewMJ8T4N6STfXoLSk/WDrP30M3VpLBry2Iov1TxfzTcysTxmPw 5qI9EaIz/mXBEV/DnpdGYcoQ+FQIlqCJlhohBJp/DJoz2RJMm0AuzBY X-Developer-Key: i=jan.petrous@oss.nxp.com; a=ed25519; pk=Ke3wwK7rb2Me9UQRf6vR8AsfJZfhTyoDaxkUCqmSWYY= X-Endpoint-Received: by B4 Relay for jan.petrous@oss.nxp.com/20240922 with auth_id=217 X-Original-From: "Jan Petrous (OSS)" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241124_144317_300530_F5E81D16 X-CRM114-Status: GOOD ( 11.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: jan.petrous@oss.nxp.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: "Jan Petrous (OSS)" Utilize a new helper function rgmii_clock(). When in, remove dead code in kmb_eth_fix_mac_speed(). Reviewed-by: Andrew Lunn Signed-off-by: Jan Petrous (OSS) --- .../net/ethernet/stmicro/stmmac/dwmac-intel-plat.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c index d94f0a150e93..ddee6154d40b 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c @@ -31,27 +31,13 @@ struct intel_dwmac_data { static void kmb_eth_fix_mac_speed(void *priv, unsigned int speed, unsigned int mode) { struct intel_dwmac *dwmac = priv; - unsigned long rate; + long rate; int ret; - rate = clk_get_rate(dwmac->tx_clk); - - switch (speed) { - case SPEED_1000: - rate = 125000000; - break; - - case SPEED_100: - rate = 25000000; - break; - - case SPEED_10: - rate = 2500000; - break; - - default: + rate = rgmii_clock(speed); + if (rate < 0) { dev_err(dwmac->dev, "Invalid speed\n"); - break; + return; } ret = clk_set_rate(dwmac->tx_clk, rate); From patchwork Sun Nov 24 22:42:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Petrous via B4 Relay X-Patchwork-Id: 13884283 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BDA2DD3B7C7 for ; Sun, 24 Nov 2024 22:55:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Reply-To:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To: References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version: Subject:Date:From:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=idcXtrY2wMDq7fT2DhHNi1p2L8LAbPUxMtyDpo9U+f0=; b=3Gi/m1avrZFjuz04EOEJEwzoHh 3MbTHQK7fJ/t4/HHXxU3ZotYAqoLlDtOsxANKy8fEGECE5UYWMqDvOsTAN9wE/WqqBpS0o+PyLMLD 50BiWQmztUnt5+yW124GhnOQ8HQDQOi5ZyW16GfodYS97D8nYGgzkoCJWOWwQlDu5UyLmSlQdMF6K SOBgi++A2ZA0foKQlaf86TJ67XmcfZiVzdHldgyj/0iRSY8xaheb/4g5X7uIMSBD2YhrivVl33xW7 S1SfX2RJTaVtrUQINioh1AHg6h0e6WarC9ADm0QTaSzebQzYQx2VxOX1NFYGSASkYTsZ/7/BM3OkD QeeY8OKg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tFLW4-00000006lJ7-4135; Sun, 24 Nov 2024 22:55:45 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tFLK2-00000006j8N-24bD for linux-arm-kernel@lists.infradead.org; Sun, 24 Nov 2024 22:43:20 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id ADC2D5C57F4; Sun, 24 Nov 2024 22:42:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 4482FC4CEF1; Sun, 24 Nov 2024 22:43:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732488194; bh=8EXZPVBYXlmWobRbQGHWVYHGGh1m+iUrmdn4povZRwc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=sBJYrqYJFepTz0SX78ofaXO2svImArXHzGu7drmHbMGWq+RAdeyiVNhqglHz6S/Pk ibK71Pf3UsyNP1B2adt8KYGX7lWyVVJW3FJrS96A9hOS8t4GLFRaBJUS2DyXdb5lwR RGCnNMWJyTYUg33wevr2iGjSjApe7Dd4Dx0ljuClmHLvo3wErnxu04tm9Hg2oCb97C 0otIILVgTfhZDePOYtg8XeEsYuJHgkuy57w3LWadmTAkZcSCYQSOamT69ON2zyztsn 8e2cDOOZWUKV42a89g6VEK7/ELH2c+VO3VD8WxAWvOydISWAA8+xC1IsUczbkRLdfn gOZqUqqPUTs1g== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A0E9D3B7C0; Sun, 24 Nov 2024 22:43:14 +0000 (UTC) From: Jan Petrous via B4 Relay Date: Sun, 24 Nov 2024 23:42:39 +0100 Subject: [PATCH RFC net-next v6 08/15] net: dwmac-rk: Use helper rgmii_clock MIME-Version: 1.0 Message-Id: <20241124-upstream_s32cc_gmac-v6-8-dc5718ccf001@oss.nxp.com> References: <20241124-upstream_s32cc_gmac-v6-0-dc5718ccf001@oss.nxp.com> In-Reply-To: <20241124-upstream_s32cc_gmac-v6-0-dc5718ccf001@oss.nxp.com> To: Maxime Coquelin , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Vinod Koul , Richard Cochran , Andrew Lunn , Heiner Kallweit , Russell King , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Emil Renner Berthing , Minda Chen , Nicolas Ferre , Claudiu Beznea , Iyappan Subramanian , Keyur Chudgar , Quan Nguyen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Giuseppe Cavallaro , Andrew Lunn Cc: linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, imx@lists.linux.dev, devicetree@vger.kernel.org, NXP S32 Linux Team , "Jan Petrous (OSS)" , "Russell King (Oracle)" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1732488190; l=1773; i=jan.petrous@oss.nxp.com; s=20240922; h=from:subject:message-id; bh=gyls2APUKHLlHqQNKqSG/VCF+Tkp2Zbsb4S51j4pUXE=; b=xSZdebTBnRwzkIW43g/IHgIaDBPPwjUWe94QrgLmpf/irmPTFMvk0TByUBw0jjAokM4VUgU/B LuuP5w+Ey7SBMgoeRRnbKAboBIxiSfui3HJne4+oSSMyedLl9Rn4Rps X-Developer-Key: i=jan.petrous@oss.nxp.com; a=ed25519; pk=Ke3wwK7rb2Me9UQRf6vR8AsfJZfhTyoDaxkUCqmSWYY= X-Endpoint-Received: by B4 Relay for jan.petrous@oss.nxp.com/20240922 with auth_id=217 X-Original-From: "Jan Petrous (OSS)" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241124_144318_648290_BD09A472 X-CRM114-Status: GOOD ( 11.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: jan.petrous@oss.nxp.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: "Jan Petrous (OSS)" Utilize a new helper function rgmii_clock(). Reviewed-by: Andrew Lunn Reviewed-by: Russell King (Oracle) Signed-off-by: Jan Petrous (OSS) --- drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 30 ++++++-------------------- 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c index 8cb374668b74..a4dc89e23a68 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c @@ -1079,20 +1079,11 @@ static void rk3568_set_gmac_speed(struct rk_priv_data *bsp_priv, int speed) { struct clk *clk_mac_speed = bsp_priv->clks[RK_CLK_MAC_SPEED].clk; struct device *dev = &bsp_priv->pdev->dev; - unsigned long rate; + long rate; int ret; - switch (speed) { - case 10: - rate = 2500000; - break; - case 100: - rate = 25000000; - break; - case 1000: - rate = 125000000; - break; - default: + rate = rgmii_clock(speed); + if (rate < 0) { dev_err(dev, "unknown speed value for GMAC speed=%d", speed); return; } @@ -1540,20 +1531,11 @@ static void rv1126_set_rgmii_speed(struct rk_priv_data *bsp_priv, int speed) { struct clk *clk_mac_speed = bsp_priv->clks[RK_CLK_MAC_SPEED].clk; struct device *dev = &bsp_priv->pdev->dev; - unsigned long rate; + long rate; int ret; - switch (speed) { - case 10: - rate = 2500000; - break; - case 100: - rate = 25000000; - break; - case 1000: - rate = 125000000; - break; - default: + rate = rgmii_clock(speed); + if (rate < 0) { dev_err(dev, "unknown speed value for RGMII speed=%d", speed); return; } From patchwork Sun Nov 24 22:42:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Petrous via B4 Relay X-Patchwork-Id: 13884274 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2B467D3B7C3 for ; Sun, 24 Nov 2024 22:48:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Reply-To:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To: References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version: Subject:Date:From:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=MmlCmuMPlIo/Q+zBFJ3kcGAH/uG2HIzfycUmqJYQy0w=; b=cuv53GwBj4hT7Ao5IjIXDuBOzJ JhTzeJ2iagDysjHCrK0gE5UEUp549gHmw2md1T4NFK/8AV9CXfjLRgg6QZpplAW2hI/wPzIadc0d6 OVlQdgcsyyRSeibMQjNtzRA3WKqVOB/bF4J4vxYxm/+LvpeBnzyeAO+Vus/4vCe/vqgAZoU9mnfle I//rFcmTZI6poq++f/aT9sO+k2g9irF1ggqyEjBo/A3OsclySxqYI3rHam5ONs7mPTwH4uYVcsXS4 j8vLvSwO3zv5U6KsjvI7gLTgr9So3xP3/JGrByw59ZWtz9UMvlOr68AXXyIZt7PB8IBeRMhRPKcWQ JCkctBIg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tFLOg-00000006kOW-3rr8; Sun, 24 Nov 2024 22:48:06 +0000 Received: from nyc.source.kernel.org ([147.75.193.91]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tFLK0-00000006j6A-3iZX for linux-arm-kernel@lists.infradead.org; Sun, 24 Nov 2024 22:43:18 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 3EF2CA40FFD; Sun, 24 Nov 2024 22:41:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 5ACB4C4CECC; Sun, 24 Nov 2024 22:43:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732488194; bh=KSQ/a7NqTpyosWEB/jr4bID1FonyDJV1OEBnEmOAv/0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=OPvJf0pNFWA0bLbeJxJytThTk309+zh4gErH8l0OycgyI2F6AANPSrLC2yML2eHuR bfkpAEfcCFkTmRXgXTGSdgMzekn6U7ccRG/ZvlfPEerqUvf7rG7N3CHZ9HbPeFSOq/ NAb5g73ip8mTjjE+pwjQnRoAgk4y8bm+VAFQQGnSQMg+/GOgaJOdLPkzk105gYmVFx sZrjFVpNUpCpcznjEG8a+ZVI4GNMNL7pHehTJ8nOdWqRZqhVK0GYNCaOBhotnjcglc SwSzsoE1iS7UkjOcjptPoT9uIzseuP2UWsCl+t9vAztEQTMNPxIX77YKUXbWHTegkg YqytbYqDq5mJw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D16FD3B7C1; Sun, 24 Nov 2024 22:43:14 +0000 (UTC) From: Jan Petrous via B4 Relay Date: Sun, 24 Nov 2024 23:42:40 +0100 Subject: [PATCH RFC net-next v6 09/15] net: dwmac-starfive: Use helper rgmii_clock MIME-Version: 1.0 Message-Id: <20241124-upstream_s32cc_gmac-v6-9-dc5718ccf001@oss.nxp.com> References: <20241124-upstream_s32cc_gmac-v6-0-dc5718ccf001@oss.nxp.com> In-Reply-To: <20241124-upstream_s32cc_gmac-v6-0-dc5718ccf001@oss.nxp.com> To: Maxime Coquelin , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Vinod Koul , Richard Cochran , Andrew Lunn , Heiner Kallweit , Russell King , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Emil Renner Berthing , Minda Chen , Nicolas Ferre , Claudiu Beznea , Iyappan Subramanian , Keyur Chudgar , Quan Nguyen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Giuseppe Cavallaro , Andrew Lunn Cc: linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, imx@lists.linux.dev, devicetree@vger.kernel.org, NXP S32 Linux Team , "Jan Petrous (OSS)" , "Russell King (Oracle)" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1732488190; l=1292; i=jan.petrous@oss.nxp.com; s=20240922; h=from:subject:message-id; bh=XVAWyqUUjd8nvrXhKQmMFKnUq2h/nlnHImM7aCwOPfU=; b=XFd3MbPMLeHASSvGCIQj9RIvkaQ0Eoy8HhjJQWFTpc3gGky9hlrOdGBo3y2X2G+2mrxL1HTOa yDe0j42c81JAVybxaaNJhDs6RuReYiWMnTQzOpl/uqcfZkBAUPCojUu X-Developer-Key: i=jan.petrous@oss.nxp.com; a=ed25519; pk=Ke3wwK7rb2Me9UQRf6vR8AsfJZfhTyoDaxkUCqmSWYY= X-Endpoint-Received: by B4 Relay for jan.petrous@oss.nxp.com/20240922 with auth_id=217 X-Original-From: "Jan Petrous (OSS)" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241124_144317_080586_A0446BE8 X-CRM114-Status: GOOD ( 11.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: jan.petrous@oss.nxp.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: "Jan Petrous (OSS)" Utilize a new helper function rgmii_clock(). Reviewed-by: Andrew Lunn Reviewed-by: Russell King (Oracle) Signed-off-by: Jan Petrous (OSS) Reviewed-by: Emil Renner Berthing --- drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c index 421666279dd3..0a0a363d3730 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c @@ -34,24 +34,13 @@ struct starfive_dwmac { static void starfive_dwmac_fix_mac_speed(void *priv, unsigned int speed, unsigned int mode) { struct starfive_dwmac *dwmac = priv; - unsigned long rate; + long rate; int err; - rate = clk_get_rate(dwmac->clk_tx); - - switch (speed) { - case SPEED_1000: - rate = 125000000; - break; - case SPEED_100: - rate = 25000000; - break; - case SPEED_10: - rate = 2500000; - break; - default: + rate = rgmii_clock(speed); + if (rate < 0) { dev_err(dwmac->dev, "invalid speed %u\n", speed); - break; + return; } err = clk_set_rate(dwmac->clk_tx, rate); From patchwork Sun Nov 24 22:42:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Petrous via B4 Relay X-Patchwork-Id: 13884284 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5682DD3B7C2 for ; Sun, 24 Nov 2024 22:56:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Reply-To:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To: References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version: Subject:Date:From:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=s4R9ZCznSvP7a9d+goJa7yTje1YRCtLV0iG5CivTw30=; b=maAtAmJ4BYRq6IK31UVQS57/GC weO745Cde6KsSsyGGASnIJtoRHaBSXtAm1cSnXZv38s4HKe3tefYmWaFwcNuT9bOiY3XTS59UQHmt xlNhocn/V+QPpICklZnF5k3oS/EgYXcWHEtNLOqkigltcYapr3QzSef9CFhX++6IW30+HK+s6nELD LMeTqCRjP6TFW17JJEycLMxzwcc1Cv08gZB1upbmfqBclwqMEVegRc9ghjVxn2I3WU0ukirE/thp4 vZ9hyCkwtjHDfc0zvcoKfVXO+Lsy2hTLnRiJkP/j2ym6s2L8f53uaHokfiYVmJJrJ1D/6MXT+bOHn Qj67E3BA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tFLWz-00000006lOO-2lSq; Sun, 24 Nov 2024 22:56:41 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tFLK1-00000006j7b-3NYK for linux-arm-kernel@lists.infradead.org; Sun, 24 Nov 2024 22:43:20 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id A85335C57EC; Sun, 24 Nov 2024 22:42:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 6D5F5C4CED6; Sun, 24 Nov 2024 22:43:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732488194; bh=AlRn+WZd6SfhWS2fa7bQSadmkZzrS2yhhKqX7aao6Sg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=oDiF3Ax3dMJzSz3bQajOW+0GvBW7D9THUaJzsJvYz4CtA5sgYOG48c7qWY7cOVGN6 iPjEZXXHRQgKSgxUvcc2NNs+vz+ScXTZUyBrr77GJ6BooKsmWrxZ9Ob7Tb8f+iX0bz XwMY/AbntIcrUpGhB+d65uTBrDNC1PzZXQvHuHkOm+WdUIg5/GuTkLQf6vcQEP9M3n c9dKBhh3bDWBa2xd2G+Erd3+nM9eIxowkO3POPtx2zu7Hcm7agUXDCYjDC1QD2wp60 lIbt6rWXXoOS/N/oLsQihIDULXqEb3zIIUpgdb7RDXK7kuBhJm5n+vn5LeEWyKMNaw RTD086adOVezA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63653D3B7C0; Sun, 24 Nov 2024 22:43:14 +0000 (UTC) From: Jan Petrous via B4 Relay Date: Sun, 24 Nov 2024 23:42:41 +0100 Subject: [PATCH RFC net-next v6 10/15] net: macb: Use helper rgmii_clock MIME-Version: 1.0 Message-Id: <20241124-upstream_s32cc_gmac-v6-10-dc5718ccf001@oss.nxp.com> References: <20241124-upstream_s32cc_gmac-v6-0-dc5718ccf001@oss.nxp.com> In-Reply-To: <20241124-upstream_s32cc_gmac-v6-0-dc5718ccf001@oss.nxp.com> To: Maxime Coquelin , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Vinod Koul , Richard Cochran , Andrew Lunn , Heiner Kallweit , Russell King , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Emil Renner Berthing , Minda Chen , Nicolas Ferre , Claudiu Beznea , Iyappan Subramanian , Keyur Chudgar , Quan Nguyen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Giuseppe Cavallaro , Andrew Lunn Cc: linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, imx@lists.linux.dev, devicetree@vger.kernel.org, NXP S32 Linux Team , "Jan Petrous (OSS)" , "Russell King (Oracle)" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1732488190; l=1061; i=jan.petrous@oss.nxp.com; s=20240922; h=from:subject:message-id; bh=lqge0TxoQLFiynEUre89U7vm4A38Pvil86ayrYiUui0=; b=lusr+SunX8FEHrDCn/OhAZlRWJhhVkvMXNMoGacnnL3DrNAExtv9Iqr7zOzvc210K6D5c+eya fpXKu2rKHspAwPhJ8AFt0o3wJp08KYiRY8hv4sU7ieEvLlIPO+bQBle X-Developer-Key: i=jan.petrous@oss.nxp.com; a=ed25519; pk=Ke3wwK7rb2Me9UQRf6vR8AsfJZfhTyoDaxkUCqmSWYY= X-Endpoint-Received: by B4 Relay for jan.petrous@oss.nxp.com/20240922 with auth_id=217 X-Original-From: "Jan Petrous (OSS)" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241124_144317_933623_36A4B4ED X-CRM114-Status: GOOD ( 10.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: jan.petrous@oss.nxp.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: "Jan Petrous (OSS)" Utilize a new helper function rgmii_clock(). Reviewed-by: Andrew Lunn Reviewed-by: Russell King (Oracle) Signed-off-by: Jan Petrous (OSS) --- drivers/net/ethernet/cadence/macb_main.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index daa416fb1724..640f500f989d 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -530,19 +530,9 @@ static void macb_set_tx_clk(struct macb *bp, int speed) if (bp->phy_interface == PHY_INTERFACE_MODE_MII) return; - switch (speed) { - case SPEED_10: - rate = 2500000; - break; - case SPEED_100: - rate = 25000000; - break; - case SPEED_1000: - rate = 125000000; - break; - default: + rate = rgmii_clock(speed); + if (rate < 0) return; - } rate_rounded = clk_round_rate(bp->tx_clk, rate); if (rate_rounded < 0) From patchwork Sun Nov 24 22:42:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Petrous via B4 Relay X-Patchwork-Id: 13884282 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 115EBD3B7C3 for ; Sun, 24 Nov 2024 22:54:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Reply-To:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To: References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version: Subject:Date:From:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=YdV8B8FrQyPertKrQMmuIzrsZcu2pgueLdXDLFnU0YI=; b=FnETAOGz8TfE09Uv+AuZpqBJb4 OCAuYToqUsUsERGaFp01k8Hg0/oqOx3oeK4AIbYrDee+b5JyZZ/zmryaOK9lhtn5YwrlDeGMZSI4F Eei+j4EjVpmR42vf2TPWsiJ/GiTVLxkHb7+STYrQWfMdeXrfnmeqhYsi9T3U9RBk3BzJ4ZnwWf2wh SU4tvTbat9ZDW/P9Y+LS+E+LoIBXa+CTPfQjA4eW1Z18NyA7nA+YshG8b7iKv/tHqQbnveerUu92R zpEgD0UmuP/oFBiUZeomgipRuq1GDs/FvyOLIw3+aJjL7sNIzqZQD6c1ODjfCuQZ63DLQyn9X2Q2H zFi9S79g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tFLVA-00000006lDk-1Tc6; Sun, 24 Nov 2024 22:54:48 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tFLK2-00000006j8O-2EGt for linux-arm-kernel@lists.infradead.org; Sun, 24 Nov 2024 22:43:20 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id BB4C55C5800; Sun, 24 Nov 2024 22:42:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 7FABDC4CEF8; Sun, 24 Nov 2024 22:43:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732488194; bh=zUEz2ANM1tWrM6cItHLJ+CI7tAh+sUssEFYL0gzJjUo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=NNsGwKy0mzN9a4VzQsvlFpD/lBDfL9w8NOeHzHyzlB0rO3t4Hilr9jdbrCrDk0a6j 1fD6E45XnNb/KcO6cSlDNVFayOdzbmjDCsKCHNXrxpGbmU6fLWaeEUCnus43mKdcZe +N3xaoeIbozcArlDSFenR4tVuJf4k9H7loN0w2dAQHC3Br7XfzjmQmgmIKlz6WNT9q jEIs+UWGW5N2un0CqFU8v4hifQEGDQjXlNPLcKSKgku2ytppV9cAe1o4tRkH09tgpN hPKva/MHpnGn86xKRO32HXY4p31fPPHI1rK4ENFzoJnkDiiSsjuIOY8yY/jIuib7I7 DRMDEd7k4aJuw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75F3FD3B7C2; Sun, 24 Nov 2024 22:43:14 +0000 (UTC) From: Jan Petrous via B4 Relay Date: Sun, 24 Nov 2024 23:42:42 +0100 Subject: [PATCH RFC net-next v6 11/15] net: xgene_enet: Use helper rgmii_clock MIME-Version: 1.0 Message-Id: <20241124-upstream_s32cc_gmac-v6-11-dc5718ccf001@oss.nxp.com> References: <20241124-upstream_s32cc_gmac-v6-0-dc5718ccf001@oss.nxp.com> In-Reply-To: <20241124-upstream_s32cc_gmac-v6-0-dc5718ccf001@oss.nxp.com> To: Maxime Coquelin , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Vinod Koul , Richard Cochran , Andrew Lunn , Heiner Kallweit , Russell King , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Emil Renner Berthing , Minda Chen , Nicolas Ferre , Claudiu Beznea , Iyappan Subramanian , Keyur Chudgar , Quan Nguyen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Giuseppe Cavallaro , Andrew Lunn Cc: linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, imx@lists.linux.dev, devicetree@vger.kernel.org, NXP S32 Linux Team , "Jan Petrous (OSS)" , "Russell King (Oracle)" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1732488190; l=1191; i=jan.petrous@oss.nxp.com; s=20240922; h=from:subject:message-id; bh=yT5e9PnijROcL6qGdZBMgaJx1+AeFQufN+me46lPuTM=; b=MWwT+YAn1OtfqT3jNEoFInoa7erkRTCAewBp6BEfx7ysV1e5kVmbleVqtH268TLZwUjSNPQ82 FH+lOEu1JTND2EKGP4BKsFDPtTzzCexLodYOiIY3j4pAImCvzuelPG8 X-Developer-Key: i=jan.petrous@oss.nxp.com; a=ed25519; pk=Ke3wwK7rb2Me9UQRf6vR8AsfJZfhTyoDaxkUCqmSWYY= X-Endpoint-Received: by B4 Relay for jan.petrous@oss.nxp.com/20240922 with auth_id=217 X-Original-From: "Jan Petrous (OSS)" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241124_144318_694483_A154306B X-CRM114-Status: GOOD ( 11.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: jan.petrous@oss.nxp.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: "Jan Petrous (OSS)" Utilize a new helper function rgmii_clock(). Reviewed-by: Andrew Lunn Reviewed-by: Russell King (Oracle) Signed-off-by: Jan Petrous (OSS) --- drivers/net/ethernet/apm/xgene/xgene_enet_hw.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_hw.c b/drivers/net/ethernet/apm/xgene/xgene_enet_hw.c index e641dbbea1e2..b854b6b42d77 100644 --- a/drivers/net/ethernet/apm/xgene/xgene_enet_hw.c +++ b/drivers/net/ethernet/apm/xgene/xgene_enet_hw.c @@ -421,18 +421,12 @@ static void xgene_enet_configure_clock(struct xgene_enet_pdata *pdata) if (dev->of_node) { struct clk *parent = clk_get_parent(pdata->clk); + long rate = rgmii_clock(pdata->phy_speed); - switch (pdata->phy_speed) { - case SPEED_10: - clk_set_rate(parent, 2500000); - break; - case SPEED_100: - clk_set_rate(parent, 25000000); - break; - default: - clk_set_rate(parent, 125000000); - break; - } + if (rate < 0) + rate = 125000000; + + clk_set_rate(parent, rate); } #ifdef CONFIG_ACPI else { From patchwork Sun Nov 24 22:42:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Petrous via B4 Relay X-Patchwork-Id: 13884286 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C2230D3B7C3 for ; Sun, 24 Nov 2024 22:58:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Reply-To:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To: References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version: Subject:Date:From:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=vLOQaL4VwkGwmmyBjTxl0a8isrwBxSjC7W+8IS5dpbU=; b=5Ct/gEg3Gv9Kc5Zo03FhLUBShB rCALtbCU79D6+oLvTQk8PpwbiAJ7zAf/J/bWKi3lalfo61pXON/5b3SbFFMSt5K6aaj6OhSzzTuB0 PklB2vGOo+UaNPpClUTGk3eA5HJDsA0jVaHZUN/+SmXnwaw/CGjvUsUoGd8Ost6jRAkZ6SQpRHZWO +kHDJ2JomxJuGgatEMiky9DlcoU5sVDljhPocgNGx9QaV89JLkvpFMojR11/U83z8JYudnKEV7kyz Vro3Ycq4xdl6pKr8czIac6cB5eLQm2bLVCOt4lf9EgCsHbQbQk1l2gBJOcgpkhpteMs3W7+0t3ZAX NmshwngA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tFLYq-00000006lZ3-3iko; Sun, 24 Nov 2024 22:58:36 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tFLK3-00000006j8z-030B for linux-arm-kernel@lists.infradead.org; Sun, 24 Nov 2024 22:43:24 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id DE1615C5824; Sun, 24 Nov 2024 22:42:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id B04F2C4CEFC; Sun, 24 Nov 2024 22:43:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732488194; bh=F4cbjF/9M6ITcKCkPhkzEDR5HNiIhwkdl+T79A6mE8Q=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=dO1OK+CHRIdhUEKNX152EQe6yz1gpuk0jYB+JYyrquDutn4mIgCzmZF5KRa6ECRNh Fmd3Hk2DeXmRmOQP1DbNFzjKNJoQtnvDObNd5On+Molg1phcI3N47JjdL6TbM7/fql v9Kj4L7VW6XOD9fVep1QrS0IQFs/DXmGe562rLof2JNgrKMSDIKDvF6wTlrNO/ynuG Tsi0atkBSVrdOIt+ZsIIQ4rxyzuPQuUF9qtvDSqb0hOZGoEvv1agNw8GJpo99IhXYx w6ZMjSs0S8jTfgeBZTMDUqOUafIRBdEt/IjdwtBAn3NRMMRo8tSai7tCCG62+A1z2X 8bX2A+z4XhvoA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9DB7CD3B7C1; Sun, 24 Nov 2024 22:43:14 +0000 (UTC) From: Jan Petrous via B4 Relay Date: Sun, 24 Nov 2024 23:42:43 +0100 Subject: [PATCH RFC net-next v6 12/15] net: dwmac-sti: Use helper rgmii_clock MIME-Version: 1.0 Message-Id: <20241124-upstream_s32cc_gmac-v6-12-dc5718ccf001@oss.nxp.com> References: <20241124-upstream_s32cc_gmac-v6-0-dc5718ccf001@oss.nxp.com> In-Reply-To: <20241124-upstream_s32cc_gmac-v6-0-dc5718ccf001@oss.nxp.com> To: Maxime Coquelin , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Vinod Koul , Richard Cochran , Andrew Lunn , Heiner Kallweit , Russell King , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Emil Renner Berthing , Minda Chen , Nicolas Ferre , Claudiu Beznea , Iyappan Subramanian , Keyur Chudgar , Quan Nguyen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Giuseppe Cavallaro , Andrew Lunn Cc: linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, imx@lists.linux.dev, devicetree@vger.kernel.org, NXP S32 Linux Team , "Jan Petrous (OSS)" , "Russell King (Oracle)" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1732488190; l=2017; i=jan.petrous@oss.nxp.com; s=20240922; h=from:subject:message-id; bh=E3dKlyRUyP013sEwa3YoW1YOIguttVezMK0ReGNP/J8=; b=7TI9v5gtH2+5g+ELTpHWN8eoSrIn96kvVzQMjpQ1goz/OqMYGm8aibb0Nlkrxap2hSB6FoSZZ Jb5xHhKopt5ChRc+N67Pf6oDqDHiU6a3BPeD4hgYAmLLZ5Cbu+HtJX2 X-Developer-Key: i=jan.petrous@oss.nxp.com; a=ed25519; pk=Ke3wwK7rb2Me9UQRf6vR8AsfJZfhTyoDaxkUCqmSWYY= X-Endpoint-Received: by B4 Relay for jan.petrous@oss.nxp.com/20240922 with auth_id=217 X-Original-From: "Jan Petrous (OSS)" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241124_144319_144441_9ED67AD9 X-CRM114-Status: GOOD ( 14.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: jan.petrous@oss.nxp.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: "Jan Petrous (OSS)" Utilize a new helper function rgmii_clock(). Reviewed-by: Andrew Lunn Reviewed-by: Russell King (Oracle) Signed-off-by: Jan Petrous (OSS) --- drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c index a6ff02d905a9..eabc4da9e1a9 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c @@ -21,10 +21,7 @@ #include "stmmac_platform.h" -#define DWMAC_125MHZ 125000000 #define DWMAC_50MHZ 50000000 -#define DWMAC_25MHZ 25000000 -#define DWMAC_2_5MHZ 2500000 #define IS_PHY_IF_MODE_RGMII(iface) (iface == PHY_INTERFACE_MODE_RGMII || \ iface == PHY_INTERFACE_MODE_RGMII_ID || \ @@ -140,7 +137,7 @@ static void stih4xx_fix_retime_src(void *priv, u32 spd, unsigned int mode) struct sti_dwmac *dwmac = priv; u32 src = dwmac->tx_retime_src; u32 reg = dwmac->ctrl_reg; - u32 freq = 0; + long freq = 0; if (dwmac->interface == PHY_INTERFACE_MODE_MII) { src = TX_RETIME_SRC_TXCLK; @@ -153,19 +150,14 @@ static void stih4xx_fix_retime_src(void *priv, u32 spd, unsigned int mode) } } else if (IS_PHY_IF_MODE_RGMII(dwmac->interface)) { /* On GiGa clk source can be either ext or from clkgen */ - if (spd == SPEED_1000) { - freq = DWMAC_125MHZ; - } else { + freq = rgmii_clock(spd); + + if (spd != SPEED_1000 && freq > 0) /* Switch to clkgen for these speeds */ src = TX_RETIME_SRC_CLKGEN; - if (spd == SPEED_100) - freq = DWMAC_25MHZ; - else if (spd == SPEED_10) - freq = DWMAC_2_5MHZ; - } } - if (src == TX_RETIME_SRC_CLKGEN && freq) + if (src == TX_RETIME_SRC_CLKGEN && freq > 0) clk_set_rate(dwmac->clk, freq); regmap_update_bits(dwmac->regmap, reg, STIH4XX_RETIME_SRC_MASK, From patchwork Sun Nov 24 22:42:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Petrous via B4 Relay X-Patchwork-Id: 13884285 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F3DF1D3B7C3 for ; Sun, 24 Nov 2024 22:57:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Reply-To:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To: References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version: Subject:Date:From:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=XlO2AsznqGHvnCu1qZjIsNLjWqOeodvd8IUDNjUrjpQ=; b=S7M2D0Z130VKsIIJZbPD0ZekWv TL5cluuYjnXQ6Kx/bZKX6wjY8H5pNI3xvknuskcOq66pE+TuGdVqyPy3rx7/FMFvFo0cVLUqVK7P/ AbmOPuBpwzj3vQrT4cWpz3P6CPDXZ1NzfPKqxkwcut9RQko84Kz/9rUvsVAp5BQmNQABkBB+h1OtW H39l9YGVBZCcD/YM095Ddy0lr15nxKZzkSUcM2hfr1S6Fmbnpck5ujbZI4l+kj4XScAlGhuF/2hun t9qEr/ZOHcphVkdjDb5EzVDTo6SCiXu9cVg3w/zss6LRMRJxPViz1BZLVmKlWDgnzA4TDxANOL14e TTbfcPqA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tFLXv-00000006lTr-1BgB; Sun, 24 Nov 2024 22:57:39 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tFLK3-00000006j9B-0OPo for linux-arm-kernel@lists.infradead.org; Sun, 24 Nov 2024 22:43:20 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 05E295C5846; Sun, 24 Nov 2024 22:42:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id CFEC7C4CEFD; Sun, 24 Nov 2024 22:43:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732488194; bh=hRTYBgd5aMrqxBD9zYQNvdPGPWcLGVS6g40811SQlp8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=QCz9u3tmUFHogfZS3qKISq0+bRstWs/Kh200xJwjhOx8mAHbymH4NiQSrfe/aW5R2 xSPutVkaw4ndppgCNITJTYAybDU01ek/XP9NtvHIrrgNM/cKpx8hImJEVVHHiIctWo vXlkK25DxOOxOR5bG8m8/bteshniMcDD+VlXapavqLyibyxs8RrqwHu0/rq+nr2oMM 8rqgh9n0ZJmNcWtc1MKJzt1tXO9o8094X/Q1m2etzl/uf0Cn6LlKtfFTAVc0nRWpae eUKFeAwAiEKF5prGGKDZqX4J+1Lo4wjXukcseH1/Jax7xfKgk/HcQZHU5u4y1HgT2Z yQ/ITPL7zRqbw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id BAE7ED3B7C3; Sun, 24 Nov 2024 22:43:14 +0000 (UTC) From: Jan Petrous via B4 Relay Date: Sun, 24 Nov 2024 23:42:44 +0100 Subject: [PATCH RFC net-next v6 13/15] dt-bindings: net: Add DT bindings for DWMAC on NXP S32G/R SoCs MIME-Version: 1.0 Message-Id: <20241124-upstream_s32cc_gmac-v6-13-dc5718ccf001@oss.nxp.com> References: <20241124-upstream_s32cc_gmac-v6-0-dc5718ccf001@oss.nxp.com> In-Reply-To: <20241124-upstream_s32cc_gmac-v6-0-dc5718ccf001@oss.nxp.com> To: Maxime Coquelin , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Vinod Koul , Richard Cochran , Andrew Lunn , Heiner Kallweit , Russell King , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Emil Renner Berthing , Minda Chen , Nicolas Ferre , Claudiu Beznea , Iyappan Subramanian , Keyur Chudgar , Quan Nguyen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Giuseppe Cavallaro , Andrew Lunn Cc: linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, imx@lists.linux.dev, devicetree@vger.kernel.org, NXP S32 Linux Team , "Jan Petrous (OSS)" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1732488190; l=4096; i=jan.petrous@oss.nxp.com; s=20240922; h=from:subject:message-id; bh=HHjvFK+MHmQc/THlQijGySkp22UNi4Qf+z7YD0xfSdU=; b=igdlnRUDm+Btgrcm+w265yJV3OQyP+QhUBXZJ+GBEYJeN4ktXd4QheCyYW/yUAY526tf89npl IvHirPX8LfqA0UF48pc6Ig4sQ/Hpp448A0s0cWX7kF7EKJTjceH7qUr X-Developer-Key: i=jan.petrous@oss.nxp.com; a=ed25519; pk=Ke3wwK7rb2Me9UQRf6vR8AsfJZfhTyoDaxkUCqmSWYY= X-Endpoint-Received: by B4 Relay for jan.petrous@oss.nxp.com/20240922 with auth_id=217 X-Original-From: "Jan Petrous (OSS)" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241124_144319_225463_B819755C X-CRM114-Status: GOOD ( 14.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: jan.petrous@oss.nxp.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: "Jan Petrous (OSS)" Add basic description for DWMAC ethernet IP on NXP S32G2xx, S32G3xx and S32R45 automotive series SoCs. Reviewed-by: Rob Herring (Arm) Signed-off-by: Jan Petrous (OSS) --- .../devicetree/bindings/net/nxp,s32-dwmac.yaml | 105 +++++++++++++++++++++ .../devicetree/bindings/net/snps,dwmac.yaml | 1 + 2 files changed, 106 insertions(+) diff --git a/Documentation/devicetree/bindings/net/nxp,s32-dwmac.yaml b/Documentation/devicetree/bindings/net/nxp,s32-dwmac.yaml new file mode 100644 index 000000000000..2b8b74c5feec --- /dev/null +++ b/Documentation/devicetree/bindings/net/nxp,s32-dwmac.yaml @@ -0,0 +1,105 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +# Copyright 2021-2024 NXP +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/nxp,s32-dwmac.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NXP S32G2xx/S32G3xx/S32R45 GMAC ethernet controller + +maintainers: + - Jan Petrous (OSS) + +description: + This device is a Synopsys DWC IP, integrated on NXP S32G/R SoCs. + The SoC series S32G2xx and S32G3xx feature one DWMAC instance, + the SoC S32R45 has two instances. The devices can use RGMII/RMII/MII + interface over Pinctrl device or the output can be routed + to the embedded SerDes for SGMII connectivity. + +properties: + compatible: + oneOf: + - const: nxp,s32g2-dwmac + - items: + - enum: + - nxp,s32g3-dwmac + - nxp,s32r45-dwmac + - const: nxp,s32g2-dwmac + + reg: + items: + - description: Main GMAC registers + - description: GMAC PHY mode control register + + interrupts: + maxItems: 1 + + interrupt-names: + const: macirq + + clocks: + items: + - description: Main GMAC clock + - description: Transmit clock + - description: Receive clock + - description: PTP reference clock + + clock-names: + items: + - const: stmmaceth + - const: tx + - const: rx + - const: ptp_ref + +required: + - clocks + - clock-names + +allOf: + - $ref: snps,dwmac.yaml# + +unevaluatedProperties: false + +examples: + - | + #include + #include + #include + bus { + #address-cells = <2>; + #size-cells = <2>; + + ethernet@4033c000 { + compatible = "nxp,s32g2-dwmac"; + reg = <0x0 0x4033c000 0x0 0x2000>, /* gmac IP */ + <0x0 0x4007c004 0x0 0x4>; /* GMAC_0_CTRL_STS */ + interrupt-parent = <&gic>; + interrupts = ; + interrupt-names = "macirq"; + snps,mtl-rx-config = <&mtl_rx_setup>; + snps,mtl-tx-config = <&mtl_tx_setup>; + clocks = <&clks 24>, <&clks 17>, <&clks 16>, <&clks 15>; + clock-names = "stmmaceth", "tx", "rx", "ptp_ref"; + phy-mode = "rgmii-id"; + phy-handle = <&phy0>; + + mtl_rx_setup: rx-queues-config { + snps,rx-queues-to-use = <5>; + }; + + mtl_tx_setup: tx-queues-config { + snps,tx-queues-to-use = <5>; + }; + + mdio { + #address-cells = <1>; + #size-cells = <0>; + compatible = "snps,dwmac-mdio"; + + phy0: ethernet-phy@0 { + reg = <0>; + }; + }; + }; + }; diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml index eb1f3ae41ab9..91e75eb3f329 100644 --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml @@ -67,6 +67,7 @@ properties: - ingenic,x2000-mac - loongson,ls2k-dwmac - loongson,ls7a-dwmac + - nxp,s32g2-dwmac - qcom,qcs404-ethqos - qcom,sa8775p-ethqos - qcom,sc8280xp-ethqos From patchwork Sun Nov 24 22:42:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Petrous via B4 Relay X-Patchwork-Id: 13884281 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C0E23D3B7C2 for ; Sun, 24 Nov 2024 22:53:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Reply-To:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To: References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version: Subject:Date:From:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=a+HxGE/akY8xFsa0vByPOSLkEXZdmbwnQnIPbdbsMjw=; b=c5dBSZPVlDkh7LRoKiSoR07XDf ECWgYZ33R8cwMSw9WpVFxUdliXfGgd4O3EPyqEA41itFeJXrmMbh1GR3zxYmDeeLKZS6P+My+GC5Z zFIbjPzDBaqZWw5nh4bS0kp86sGTa/ZEAeo3e5YG59qNjAWscQXWknZFLdd+Oq2iBtDYUZAurnrjS 8chYA/dx6e+Lt1c6jzgongZ9uOXQrhBhfHI+AOBJMeTetp1qqHkxiPjG2cNWQmoYIggTPBhKiREo6 5RsRtaGqE7Gkvns8c6Gef7eMQ2pYci7xn2rXA5gzzDZhRsztImyHJX7DyRYNlumnhPQuPniF0S/x1 ErulLJ4A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tFLUE-00000006l8s-2n2e; Sun, 24 Nov 2024 22:53:50 +0000 Received: from nyc.source.kernel.org ([2604:1380:45d1:ec00::3]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tFLK1-00000006j6t-2AGn for linux-arm-kernel@lists.infradead.org; Sun, 24 Nov 2024 22:43:19 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id C3349A4108C; Sun, 24 Nov 2024 22:41:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id EB421C4DDEE; Sun, 24 Nov 2024 22:43:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732488195; bh=AnO4R5j10w0FZih8smewfXdNr/fzYaVAE8TD7GxYUsA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=MPguFaZSADD7Jdwoqp4SeJQnctrcUAkcHeVi98nHiL00sy5Su93jvVHEj/HMxZcXr ntP7k8zQXWqhatJRuxLTFIJTqhxvUeXYXIcYdqfa4yUwoHBHJmDZefXh8lsvFr5/31 IN4Hk8+Y3zRO5gMvh0c1ZdM5caI0ukwQ4coFIcG1RnVwY4zS61NboLYiJzTJH+4U0h hVZ6zHFnpGsPnq1XjO9uR4CrfZ1wz6pEtnj2shM1Z9qrHVGZFuZtyDY+/cXlt3Zaeh fIgASDzCWRSzdRlR02yMjo/bWBRghtfBNaFSUTz/KtZPaiZY5+Vt0vCA3Q+DdX+jHe XIFV5IBw/mGjQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id CFA73D3B7C7; Sun, 24 Nov 2024 22:43:14 +0000 (UTC) From: Jan Petrous via B4 Relay Date: Sun, 24 Nov 2024 23:42:45 +0100 Subject: [PATCH RFC net-next v6 14/15] net: stmmac: dwmac-s32: add basic NXP S32G/S32R glue driver MIME-Version: 1.0 Message-Id: <20241124-upstream_s32cc_gmac-v6-14-dc5718ccf001@oss.nxp.com> References: <20241124-upstream_s32cc_gmac-v6-0-dc5718ccf001@oss.nxp.com> In-Reply-To: <20241124-upstream_s32cc_gmac-v6-0-dc5718ccf001@oss.nxp.com> To: Maxime Coquelin , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Vinod Koul , Richard Cochran , Andrew Lunn , Heiner Kallweit , Russell King , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Emil Renner Berthing , Minda Chen , Nicolas Ferre , Claudiu Beznea , Iyappan Subramanian , Keyur Chudgar , Quan Nguyen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Giuseppe Cavallaro , Andrew Lunn Cc: linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, imx@lists.linux.dev, devicetree@vger.kernel.org, NXP S32 Linux Team , "Jan Petrous (OSS)" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1732488190; l=7205; i=jan.petrous@oss.nxp.com; s=20240922; h=from:subject:message-id; bh=qUYNPbDOjNkOyElyWl7BlSsQNIBb0+hkETF3fWGpFIs=; b=2Ie4RB9PaId1khBTCg8rrz3vMbaIgM65drv1QHPsz435k4xW5wXVmNUGsaIP6ndamm37O5rD9 4NEukT9tjXKCNBZcMdb/28s2TWkoB12y6xk82/TS+m/sdaKHh6AbkOk X-Developer-Key: i=jan.petrous@oss.nxp.com; a=ed25519; pk=Ke3wwK7rb2Me9UQRf6vR8AsfJZfhTyoDaxkUCqmSWYY= X-Endpoint-Received: by B4 Relay for jan.petrous@oss.nxp.com/20240922 with auth_id=217 X-Original-From: "Jan Petrous (OSS)" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241124_144317_709766_A2669E66 X-CRM114-Status: GOOD ( 22.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: jan.petrous@oss.nxp.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: "Jan Petrous (OSS)" NXP S32G2xx/S32G3xx and S32R45 are automotive grade SoCs that integrate one or two Synopsys DWMAC 5.10/5.20 IPs. The basic driver supports only RGMII interface. Signed-off-by: Jan Petrous (OSS) --- drivers/net/ethernet/stmicro/stmmac/Kconfig | 12 ++ drivers/net/ethernet/stmicro/stmmac/Makefile | 1 + drivers/net/ethernet/stmicro/stmmac/dwmac-s32.c | 189 ++++++++++++++++++++++++ 3 files changed, 202 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethernet/stmicro/stmmac/Kconfig index 6658536a4e17..4cc85a36a1ab 100644 --- a/drivers/net/ethernet/stmicro/stmmac/Kconfig +++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig @@ -154,6 +154,18 @@ config DWMAC_RZN1 the stmmac device driver. This support can make use of a custom MII converter PCS device. +config DWMAC_S32 + tristate "NXP S32G/S32R GMAC support" + default ARCH_S32 + depends on OF && (ARCH_S32 || COMPILE_TEST) + help + Support for ethernet controller on NXP S32CC SOCs. + + This selects NXP SoC glue layer support for the stmmac + device driver. This driver is used for the S32CC series + SOCs GMAC ethernet controller, ie. S32G2xx, S32G3xx and + S32R45. + config DWMAC_SOCFPGA tristate "SOCFPGA dwmac support" default ARCH_INTEL_SOCFPGA diff --git a/drivers/net/ethernet/stmicro/stmmac/Makefile b/drivers/net/ethernet/stmicro/stmmac/Makefile index 2389fd261344..b26f0e79c2b3 100644 --- a/drivers/net/ethernet/stmicro/stmmac/Makefile +++ b/drivers/net/ethernet/stmicro/stmmac/Makefile @@ -22,6 +22,7 @@ obj-$(CONFIG_DWMAC_MESON) += dwmac-meson.o dwmac-meson8b.o obj-$(CONFIG_DWMAC_QCOM_ETHQOS) += dwmac-qcom-ethqos.o obj-$(CONFIG_DWMAC_ROCKCHIP) += dwmac-rk.o obj-$(CONFIG_DWMAC_RZN1) += dwmac-rzn1.o +obj-$(CONFIG_DWMAC_S32) += dwmac-s32.o obj-$(CONFIG_DWMAC_SOCFPGA) += dwmac-altr-socfpga.o obj-$(CONFIG_DWMAC_STARFIVE) += dwmac-starfive.o obj-$(CONFIG_DWMAC_STI) += dwmac-sti.o diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-s32.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-s32.c new file mode 100644 index 000000000000..1853a6b26e46 --- /dev/null +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-s32.c @@ -0,0 +1,189 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * NXP S32G/R GMAC glue layer + * + * Copyright 2019-2024 NXP + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "stmmac_platform.h" + +#define GMAC_TX_RATE_125M 125000000 /* 125MHz */ + +/* SoC PHY interface control register */ +#define PHY_INTF_SEL_MII 0x00 +#define PHY_INTF_SEL_SGMII 0x01 +#define PHY_INTF_SEL_RGMII 0x02 +#define PHY_INTF_SEL_RMII 0x08 + +struct s32_priv_data { + void __iomem *ioaddr; + void __iomem *ctrl_sts; + struct device *dev; + phy_interface_t *intf_mode; + struct clk *tx_clk; + struct clk *rx_clk; +}; + +static int s32_gmac_write_phy_intf_select(struct s32_priv_data *gmac) +{ + writel(PHY_INTF_SEL_RGMII, gmac->ctrl_sts); + + dev_dbg(gmac->dev, "PHY mode set to %s\n", phy_modes(*gmac->intf_mode)); + + return 0; +} + +static int s32_gmac_init(struct platform_device *pdev, void *priv) +{ + struct s32_priv_data *gmac = priv; + int ret; + + ret = clk_set_rate(gmac->tx_clk, GMAC_TX_RATE_125M); + if (!ret) + ret = clk_prepare_enable(gmac->tx_clk); + + if (ret) { + dev_err(&pdev->dev, "Can't set tx clock\n"); + return ret; + } + + ret = clk_prepare_enable(gmac->rx_clk); + if (ret) { + clk_disable_unprepare(gmac->tx_clk); + dev_err(&pdev->dev, "Can't set rx clock\n"); + return ret; + } + + ret = s32_gmac_write_phy_intf_select(gmac); + if (ret) { + clk_disable_unprepare(gmac->tx_clk); + clk_disable_unprepare(gmac->rx_clk); + dev_err(&pdev->dev, "Can't set PHY interface mode\n"); + return ret; + } + + return 0; +} + +static void s32_gmac_exit(struct platform_device *pdev, void *priv) +{ + struct s32_priv_data *gmac = priv; + + clk_disable_unprepare(gmac->tx_clk); + clk_disable_unprepare(gmac->rx_clk); +} + +static void s32_fix_mac_speed(void *priv, unsigned int speed, unsigned int mode) +{ + struct s32_priv_data *gmac = priv; + long tx_clk_rate; + int ret; + + tx_clk_rate = rgmii_clock(speed); + if (tx_clk_rate < 0) { + dev_err(gmac->dev, "Unsupported/Invalid speed: %d\n", speed); + return; + } + + dev_dbg(gmac->dev, "Set tx clock to %ld Hz\n", tx_clk_rate); + ret = clk_set_rate(gmac->tx_clk, tx_clk_rate); + if (ret) + dev_err(gmac->dev, "Can't set tx clock\n"); +} + +static int s32_dwmac_probe(struct platform_device *pdev) +{ + struct plat_stmmacenet_data *plat; + struct device *dev = &pdev->dev; + struct stmmac_resources res; + struct s32_priv_data *gmac; + int ret; + + gmac = devm_kzalloc(&pdev->dev, sizeof(*gmac), GFP_KERNEL); + if (!gmac) + return -ENOMEM; + + gmac->dev = &pdev->dev; + + ret = stmmac_get_platform_resources(pdev, &res); + if (ret) + return dev_err_probe(dev, ret, + "Failed to get platform resources\n"); + + plat = devm_stmmac_probe_config_dt(pdev, res.mac); + if (IS_ERR(plat)) + return dev_err_probe(dev, PTR_ERR(plat), + "dt configuration failed\n"); + + /* PHY interface mode control reg */ + gmac->ctrl_sts = devm_platform_get_and_ioremap_resource(pdev, 1, NULL); + if (IS_ERR(gmac->ctrl_sts)) + return dev_err_probe(dev, PTR_ERR(gmac->ctrl_sts), + "S32CC config region is missing\n"); + + /* tx clock */ + gmac->tx_clk = devm_clk_get(&pdev->dev, "tx"); + if (IS_ERR(gmac->tx_clk)) + return dev_err_probe(dev, PTR_ERR(gmac->tx_clk), + "tx clock not found\n"); + + /* rx clock */ + gmac->rx_clk = devm_clk_get(&pdev->dev, "rx"); + if (IS_ERR(gmac->rx_clk)) + return dev_err_probe(dev, PTR_ERR(gmac->rx_clk), + "rx clock not found\n"); + + gmac->intf_mode = &plat->phy_interface; + gmac->ioaddr = res.addr; + + /* S32CC core feature set */ + plat->has_gmac4 = true; + plat->pmt = 1; + plat->flags |= STMMAC_FLAG_SPH_DISABLE; + plat->rx_fifo_size = 20480; + plat->tx_fifo_size = 20480; + + plat->init = s32_gmac_init; + plat->exit = s32_gmac_exit; + plat->fix_mac_speed = s32_fix_mac_speed; + + plat->bsp_priv = gmac; + + return stmmac_pltfr_probe(pdev, plat, &res); +} + +static const struct of_device_id s32_dwmac_match[] = { + { .compatible = "nxp,s32g2-dwmac" }, + { } +}; +MODULE_DEVICE_TABLE(of, s32_dwmac_match); + +static struct platform_driver s32_dwmac_driver = { + .probe = s32_dwmac_probe, + .remove = stmmac_pltfr_remove, + .driver = { + .name = "s32-dwmac", + .pm = &stmmac_pltfr_pm_ops, + .of_match_table = s32_dwmac_match, + }, +}; +module_platform_driver(s32_dwmac_driver); + +MODULE_AUTHOR("Jan Petrous (OSS) "); +MODULE_DESCRIPTION("NXP S32G/R common chassis GMAC driver"); +MODULE_LICENSE("GPL"); + From patchwork Sun Nov 24 22:42:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Petrous via B4 Relay X-Patchwork-Id: 13884279 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8C31DD3B7C3 for ; Sun, 24 Nov 2024 22:52:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Reply-To:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To: References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version: Subject:Date:From:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=J/HW7UZp7E9Lw1gdYiv2PQOgPjlsL6DsAQEJoKVtxZ4=; b=FExOdwo0F/iYbrDCmKtXryAaUk axSlSPKSq2awQ/U/fkAXgcQbG1cFT8A9MLu7Juwe6XbvavHnBy5ndCm+K9i/q4WUvVsm7F+Gs2j6H EsNmA7ifMu1/kY+cnsw3VXIMAhnlvkyuh1WHh2cAJFj66ll2LOftDEwz+KI+AEHTWq/DDHTLD3IS+ b1X7WDtRYIQGf0uT4JzlyPILfu0HEyrLy/Ne0QaHQZSgLRrc7tYbvc3bHzdig3kRAlGrBFckHrfxn Qvj14MzOIOLEpVOjhf5HlOa7QcUsn2d+s2MixgZ6NfbfqMpGPuPVKehihTpTWrSkFM6gCCucqQWs3 5S2G8biQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tFLSO-00000006kxy-1p3e; Sun, 24 Nov 2024 22:51:56 +0000 Received: from nyc.source.kernel.org ([2604:1380:45d1:ec00::3]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tFLK1-00000006j6P-0Qws for linux-arm-kernel@lists.infradead.org; Sun, 24 Nov 2024 22:43:19 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id AAAAEA4107D; Sun, 24 Nov 2024 22:41:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 0E300C4AF16; Sun, 24 Nov 2024 22:43:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732488195; bh=UAx7hsbe3NxsaMfRJIOHUluosRkeIJDbnICHb6UgDS8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=obIfsu6L+Gj4DmMU8dlXmY2dp2aYS+5cyVfJlfHK+fHGVZPLzUJuLXerCMoSdJrdh CYZCAgvStTfuyaO6gN3SaOKjjT4yFTxAMWAsV5/hy4t9nI63Q1ytjaSIZL2rrxVX1E slKy/aV0h+YlPSVfN5g9xXY3wQzBxfZ1tLBR3xJEvE8/iNcrh96SWHZWeOizAPVtFs 4f8irmX+1nlBWCM8rzwTxwCh60eQY9Yrvg5c9Ib8/v/dijvH4R/qORhf97J+RLY1rN +QLspSfS+dbyZTlGq5iniiDB+4Njg5DcQRTgoEK4aMXC5rOI9SEHWLOaRibyZ8Qt9d 4NepqdYW6WcTw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id E81DAD3B7C9; Sun, 24 Nov 2024 22:43:14 +0000 (UTC) From: Jan Petrous via B4 Relay Date: Sun, 24 Nov 2024 23:42:46 +0100 Subject: [PATCH RFC net-next v6 15/15] MAINTAINERS: Add Jan Petrous as the NXP S32G/R DWMAC driver maintainer MIME-Version: 1.0 Message-Id: <20241124-upstream_s32cc_gmac-v6-15-dc5718ccf001@oss.nxp.com> References: <20241124-upstream_s32cc_gmac-v6-0-dc5718ccf001@oss.nxp.com> In-Reply-To: <20241124-upstream_s32cc_gmac-v6-0-dc5718ccf001@oss.nxp.com> To: Maxime Coquelin , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Vinod Koul , Richard Cochran , Andrew Lunn , Heiner Kallweit , Russell King , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Emil Renner Berthing , Minda Chen , Nicolas Ferre , Claudiu Beznea , Iyappan Subramanian , Keyur Chudgar , Quan Nguyen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Giuseppe Cavallaro , Andrew Lunn Cc: linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, imx@lists.linux.dev, devicetree@vger.kernel.org, NXP S32 Linux Team , "Jan Petrous (OSS)" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1732488190; l=915; i=jan.petrous@oss.nxp.com; s=20240922; h=from:subject:message-id; bh=AB+C+oFGx/nUk90lBuH2NQMFBAAsgdQa1O4ljHjBgAU=; b=Kywb2KIXNROek0tfQQzkmWXDOrb1hA03ssVjFY+r9P584GKXG9ul+AcMtcMT/BvX5dYjTs5dh CIXotOx9/3lBROcgwIOof2FDu87i41hzr64p7oqLbJ+hrKolWPMQzVy X-Developer-Key: i=jan.petrous@oss.nxp.com; a=ed25519; pk=Ke3wwK7rb2Me9UQRf6vR8AsfJZfhTyoDaxkUCqmSWYY= X-Endpoint-Received: by B4 Relay for jan.petrous@oss.nxp.com/20240922 with auth_id=217 X-Original-From: "Jan Petrous (OSS)" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241124_144317_323638_8DFB88FF X-CRM114-Status: UNSURE ( 9.46 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: jan.petrous@oss.nxp.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: "Jan Petrous (OSS)" Add myself as NXP S32G/R DWMAC Ethernet driver maintainer. Reviewed-by: Andrew Lunn Signed-off-by: Jan Petrous (OSS) --- MAINTAINERS | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index e7f017097701..f1cf5dfe5998 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2809,6 +2809,13 @@ S: Maintained F: arch/arm64/boot/dts/freescale/s32g*.dts* F: drivers/pinctrl/nxp/ +ARM/NXP S32G/S32R DWMAC ETHERNET DRIVER +M: Jan Petrous +L: NXP S32 Linux Team +S: Maintained +F: Documentation/devicetree/bindings/net/nxp,s32-dwmac.yaml +F: drivers/net/ethernet/stmicro/stmmac/dwmac-s32.c + ARM/Orion SoC/Technologic Systems TS-78xx platform support M: Alexander Clouter L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)