From patchwork Tue Feb 18 11:14:39 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: 13979593 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 D201923C8BE for ; Tue, 18 Feb 2025 11:14:51 +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=1739877294; cv=none; b=n6c17oJ0aRAtjh5U0Btt6z4kP2G12WOnorLACQRtgp12JLN4/Kj1womyav9cJvP9pE+Ij+RWN1/SN8PQCbbnVkYGFqsRSs1prrDEblVdru1EsvoDhV8LMarkHQa2VaiHi4WlneQPpj/j79YgN0nWUqk/NEcy795fJuqS/T3epKQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739877294; c=relaxed/simple; bh=xCyewt8yClFT75JdJZ0OkuPSWHYtt9k1lIyQcq3u4EI=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=BxuxH2shVXzD+cGPzfVX4bf3DrRZ+p7W4xcVj1ysqx/5rkBrrklJBcNLq7cGmPHNJSjbBHXJcrWSqdbDTvnSqnVcjlzwVrfvXveSZORTohhDwU4YmXwFLgTF6BhKr4nHY0yQLSEbvhlQQP/qAVwfp9Rt8OKomQUKxun+a/iM67w= 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=VBnSLYdE; 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="VBnSLYdE" 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=goozUNnJLLkrSorBmN4CSjqgYHxzSyfaXsVrvCrQJa4=; b=VBnSLYdEwASJZI+Z1Kv8WaqVUj Gu1Tah9MVvryFRKBG2JxPljesgrEr0NiylzHcyGbSkupA97NOevzP68oL884NugEsBs15/E/eSgar pNC/xNuhPK3r9JnPzndMZ9oTPjU+4Hn/cv283WqtPJLFn3soXzRVappfV0arMsxtWs+BfkrRpKYni tt3eskO9YIk5T8Ikk5aU6pVa7+uzAV9Kzer3jQcSpbdTpHpugb17KVJR/gfw4lZOpqwTqRxOe1Wru YMPm06bYKyELzNlxSc9sb84+KaYUvqjmTW+g29Ce/s7mWn1KzQkuW0Mt/V76Qqt9PjRgw7tlBvmZ+ b0GG4ECg==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:58960) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tkLYp-0001hN-3B; Tue, 18 Feb 2025 11:14:44 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.96) (envelope-from ) id 1tkLYl-0007Da-2g; Tue, 18 Feb 2025 11:14:39 +0000 Date: Tue, 18 Feb 2025 11:14:39 +0000 From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Alexandre Torgue , Andrew Lunn , "David S. Miller" , Emil Renner Berthing , Eric Dumazet , Fabio Estevam , imx@lists.linux.dev, Inochi Amaoto , Jakub Kicinski , Jan Petrous , Jon Hunter , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Maxime Coquelin , Minda Chen , netdev@vger.kernel.org, NXP S32 Linux Team , Paolo Abeni , Pengutronix Kernel Team , Sascha Hauer , Shawn Guo , Thierry Reding Subject: [PATCH RFC net-next 0/7] 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. Patches 3 through 7 convert the easy-to-convert platforms to use this new infrastructure. .../ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c | 10 +---- drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c | 5 ++- .../net/ethernet/stmicro/stmmac/dwmac-intel-plat.c | 24 ++---------- drivers/net/ethernet/stmicro/stmmac/dwmac-s32.c | 22 ++--------- .../net/ethernet/stmicro/stmmac/dwmac-starfive.c | 26 ++----------- drivers/net/ethernet/stmicro/stmmac/stmmac.h | 2 + drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 43 ++++++++++++++++++++++ include/linux/stmmac.h | 4 ++ 8 files changed, 65 insertions(+), 71 deletions(-)