[PATCH net-next 00/21] net: stmmac: rk: simplify per-SoC configuration
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
Date: 2026-01-23 10:59:56
Also in:
linux-rockchip, netdev
[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 | 1220 ++++++++++-------------- 1 file changed, 491 insertions(+), 729 deletions(-) -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!