From patchwork Thu Feb 27 09:16:15 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13993971 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 D0C68C021BE for ; Thu, 27 Feb 2025 09:18:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=mYBSB07Y1Lcf9/eRz7dCZu8qEiXLm/2Bh2FG5QcVSNc=; b=k21Mr3NUF3WsWXeiBTP7SXjWj9 Zxyz147nCx1nMJWy9RwsYSG6kNuKsU1/mwYkFLCBwLBPFTGkw55Dz3SergEHBnEPhU6yD7+hKFJeo lPDguLjZDdug5KAFyFQTsefvahdCU56fzS9XICVSNJlum+MvKdfjPNHc7tn/JpX0s+mCxNyN6/uoV LCk98DTBVxeq9INUveWnwHOodshMTLqobvzzXEKy6Elk7rZXeNZBGtdzW2OdtZ7lbYvDmwqKQ33fq NCc2xB0p4S1i5DWNWk41Fpnqu6aicpBOzhgdppbxMP1qL0wMQXMnGrduTWJMCtl5YecTaDuf2BUVC 9Z2IE7Ag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tna27-00000006pxo-2gL4; Thu, 27 Feb 2025 09:18:19 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tna0Z-00000006pbx-3DTW; Thu, 27 Feb 2025 09:16:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:Content-Type:MIME-Version: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=mYBSB07Y1Lcf9/eRz7dCZu8qEiXLm/2Bh2FG5QcVSNc=; b=wnuAID+7ZSTSMWHQ59mO8ZAM3B CXzkqOUzdgxZnDMtHa4II8PYjkSxTM7m1LNXr33U19kuK1ae5zZKuUp3tg2uL5Ey90GFmzIglLjBO CbtRR2ZE3plQksGYIyWZUm/A7QIB63d11CBuuuzUJFuycBdiv8VyUBZY8y8Dh95PoSxSQon3s8Qs0 p5s2hsxSoqBzXgzpPvt/6HSRLbUB2G5FTWfhZqJava+whQzY3B9gHiYfZXqENo0+aQjBgTReH4g9Q XIdkxeCxPK/Fu7I9PJz30wNkp87HakU8lrEPt7BRMQLkZpVegwZigbgwwbf2ZAekiD2uYTXMWYoKD XUwNPFjA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:55760) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tna0G-0006b7-14; Thu, 27 Feb 2025 09:16:24 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.96) (envelope-from ) id 1tna07-000818-23; Thu, 27 Feb 2025 09:16:15 +0000 Date: Thu, 27 Feb 2025 09:16:15 +0000 From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Alexandre Torgue , Andrew Lunn , "David S. Miller" , Drew Fustini , Emil Renner Berthing , Eric Dumazet , Fabio Estevam , Fu Wei , Guo Ren , imx@lists.linux.dev, Jakub Kicinski , Jan Petrous , Jerome Brunet , Kevin Hilman , linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Martin Blumenstingl , Maxime Coquelin , Minda Chen , Neil Armstrong , netdev@vger.kernel.org, Paolo Abeni , Pengutronix Kernel Team , Sascha Hauer , Shawn Guo Subject: [PATCH net-next 00/11] net: stmmac: cleanup transmit clock setting Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250227_011644_079157_B49539C4 X-CRM114-Status: GOOD ( 10.22 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, A lot of stmmac platform code which sets the transmit clock is very similar - they decode the speed to the clock rate (125, 25 or 2.5 MHz) and then set a clock to that rate. The DWMAC core appears to have a clock input for the transmit section called clk_tx_i which requires this rate. This series moves the code which sets this clock into the core stmmac code. Patch 1 adds a hook that platforms can use to configure the clock rate. Patch 2 adds a generic implementation. The remainder of the patches convert the glue code for various platforms to use this new infrastructure. Changes since RFC: fix build errors, add Thierry Reding's r-b. More platform glue conversions. .../ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c | 10 +---- drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c | 21 ++++++++++- .../net/ethernet/stmicro/stmmac/dwmac-intel-plat.c | 24 ++---------- .../net/ethernet/stmicro/stmmac/dwmac-ipq806x.c | 9 +++-- drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c | 9 +++-- drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 10 +++-- drivers/net/ethernet/stmicro/stmmac/dwmac-s32.c | 22 ++--------- .../net/ethernet/stmicro/stmmac/dwmac-starfive.c | 26 ++----------- drivers/net/ethernet/stmicro/stmmac/dwmac-thead.c | 18 +++++---- drivers/net/ethernet/stmicro/stmmac/stmmac.h | 2 + drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 43 ++++++++++++++++++++++ include/linux/stmmac.h | 4 ++ 12 files changed, 108 insertions(+), 90 deletions(-)