From mboxrd@z Thu Jan 1 00:00:00 1970 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 1D779329C6A for ; Mon, 26 Jan 2026 11:44:26 +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=1769427868; cv=none; b=pROzCgLp8B8NLrV51ve1KFIeZsKTadAQqtOu55CKfwxxbKrkhcorAFQOe5nnFg1nVpQQ0W9inuIwIl/DmNVCgDXbPuwkOHMp8X+NsJvP+x4Y3rbhxBvupgC90eNTpJuoNYeHsWzoBbM9E9HzlYU3NPNFTrVqMbPPH7sZjyh1638= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769427868; c=relaxed/simple; bh=sOmQHT/KB8XTMWgnQ5jz7GSXRwvF+dxEnN6zZ0y9Q4c=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=OlWZ5l1f4aJAmZOH9DzSmxarWL9PIE6ANw4pukUDrzl9mDlP5cIbKVcOarS9nuewiAKB1GWKCgKCTwRADgEhvnVV1/e45O+rbBVOCxPGV3RpRMXQD4Rmz2IcKvsElGMb3UYEw8C2/k86SPgmwfAh0fnksWqGdfAin0StNZZBlzs= 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=Y8lwjlEd; 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="Y8lwjlEd" 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=yBZgVQPE5pyIHc9AqGzEXNSbNLwIwnbp7Ek3gt6UiS0=; b=Y8lwjlEdMnBjJgPevGq9soTwBU BO0PRHynTRQjso22RDyJLEtu8GL4on7kPvOqYgrb1FcLsxveUyHwIABeCBrvb1K95kQlbHJiWy/Zz VNT7U1GToRrpnBcczM+N0v9ZrS5D8zwnfSUARTyfTgWkGv3+Ni0aGuEd7d9k6l4iXyFfREqGv3VEP sBPs7f7SxUmM+6ptdeonH/owGEzhrhwpw2fEmXutCg9xUq1SsQGgJHk4N5AGLt0LQlEcwkkd1xvkR 7TQ/SrdcRybIfBYpRCzVAJdUW9Oa/p6Jc/YAGOkNOo2rkzoDgAEgzwZ0OZzs7u7QR6gqreJp3WJ/a E8DvvxHA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:35628) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vkL0x-000000004dB-0NVz; Mon, 26 Jan 2026 11:44:15 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.98.2) (envelope-from ) id 1vkL0t-000000004vB-2rTY; Mon, 26 Jan 2026 11:44:11 +0000 Date: Mon, 26 Jan 2026 11:44:11 +0000 From: "Russell King (Oracle)" To: Andrew Lunn Cc: Alexandre Torgue , Andrew Lunn , "David S. Miller" , Eric Dumazet , Heiko Stuebner , Jakub Kicinski , linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, netdev@vger.kernel.org, Paolo Abeni Subject: [PATCH net-next v2 00/22] net: stmmac: rk: simplify per-SoC configuration Message-ID: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: Russell King (Oracle) [Please note: due to google's spam filtering, I can no longer send patch series to @gmail.com addresses, and thus, to save being spammed with failed deliveries, I'm dropping such addresses from my patch series. Stop giving google so much power, use other email services.] dwmac-rk has an excessive variability between each individual SoCs which makes this file extremely large. This series reworks the per-SoC handling, moving the majority of it out of code and into data in a way that greatly reduces the lines of code necessary for each SoC, moving the code into the higher level functions in this file. In order to do this, we need a version of FIELD_PREP_WM16() that works with non-constant masks, so we introduce rk_encode_wm16(). We change the definitions to reveal the fact that in all of this variability, there is a lot of commonality in terms of the values of the bitfields, even though these bitfields appear to be randomly placed within registers. Both of these allow us to progressively move to a situation where the SoC independent code can, in the mojority of cases, program these RGMII clocks, RMII clocks and RMII speed without calling any SoC specific code. Further cleanup may be possible with the (actually incorrect) handling of RGMII delays, but this is not addressed in this already large series. drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 1237 ++++++++++-------------- 1 file changed, 508 insertions(+), 729 deletions(-) v2: fix AI review comments -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!