Skip to content

net: stmmac: rk: simplify per-SoC configuration

Russell King (Oracle) linux-arm-kernel linux-rockchip netdev oe-kbuild-all 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest0 of 22 patches 0 repliesNew
  2. v10 of 21 patches 0 repliesSuperseded

Patches in v2 No applies recorded yet

None of the 22 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH net-next v2 00/22] net: stmmac: rk: simplify per-SoC configuration

[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

Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!