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: 13993969 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4C71E1E1E08 for ; Thu, 27 Feb 2025 09:16:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740647799; cv=none; b=aFbjrsH0yvPq6Uy/NmQxHzeMAEx4AAm+xpJzKAac/N7Ctwf5ysnPG4sgpTeu0xd2OfzX/rIZeiWDnzGhoUobuVEcA8A2RRPpuzfMOTu1Rs3BstwtH0tPtc1rML29O2qnah2Cdb6pESHTA49qauIVkHIQd/RTQJyKqYRF/HXYhLI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740647799; c=relaxed/simple; bh=sI1U4oUDBvjFGWGNU000kkXTRLJhWMs5Ai9bZknZtDY=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=ezNztlfRorX1hWJG+t+gBV0xpbfwbfSanOC7slcGNtnmbTWbkkt2pgSHBz+1KzeAOPkT1RHipw+Us78pZDL8px9Kvs7WmcJrD1XwZjPqN4wXjzPWiHGlqGfGZusYdyBG2qplZKEClXpp5sSnBJlVm5TmNND95OlApUPQT/8Xceg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=wnuAID+7; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="wnuAID+7" 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: Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Sender: Russell King (Oracle) 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(-)