From mboxrd@z Thu Jan 1 00:00:00 1970 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 0523CCF65E2 for ; Mon, 26 Jan 2026 11:44: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=yBZgVQPE5pyIHc9AqGzEXNSbNLwIwnbp7Ek3gt6UiS0=; b=2UeLARp3UrchixrM0T+h04VWmR VBAKl3FAFI1V0Tb6OM1igsFkZs3GuscFSVBpTb5tkgC2INpSW3mCsw/4nM/K5T7atf9pkArrbb8/L tNtKPlQqMbSKeYisPoYEb/nks4yQZ4hZiusEI8VXMhsqXLQipjlS21I4jFgjOJJwwyQubFHXaOPwR U1TsW5/QEhqbx2Uiz6lEHoWS0HY83DkULdIxp55ObmdKn1s+h200ok9bWJsvzp49QPCotFOlnbPak v586ofCKye07TI3TIL1WkfDSbrGj0tSKV7t8pIFJpLE7L99XuI/ONJYrdAObohel7Z/B9iKJcBSmQ euwcJoJw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vkL17-0000000CQRR-1agK; Mon, 26 Jan 2026 11:44:25 +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 #2 (Red Hat Linux)) id 1vkL14-0000000CQR0-4Ak8; Mon, 26 Jan 2026 11:44:24 +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=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: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260126_034423_053705_5AEC5F43 X-CRM114-Status: GOOD ( 11.16 ) 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 [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!