[PATCH 00/15] net: sun8i-emac fixes and cleanups

Andre Przywara andre.przywara at arm.com
Mon Jul 6 02:40:31 CEST 2020


Hi,

while looking at several U-Boot network drivers in the past year, I
typically compared them to the sun8i-emac driver, as a kind of personal
reference. While doing so, I figured that there are quite some things
broken in here, and other things are not so nice.
This series attempts the fix those shortcomings.
Fix-wise we get proper handling of PHY failures (try without a
cable connected), support for external RMII PHYs (as seen on the
Pine64-non-plus model), and more future-proof internal PHY handling.
The rest of the patches are cleanups, which fix things that are wrong,
but we get away with so far, for one or another reason.
This also cleans up a good part of the cache maintenance. There is more
to be done (and I have patches for that), but that requires to drop
the overzealous alignment checks in cache_v7.c first, which is part of
another, upcoming series.

A git repo with those patches can be found here:
https://github.com/apritzel/u-boot/commits/sun8i-emac-cleanup

Please have a look and send comments!

Cheers,
Andre

Andre Przywara (15):
  net: sun8i-emac: Bail out on PHY error
  net: sun8i_emac: Don't hand out TX descriptor too early
  net: sun8i_emac: Simplify mdio_read/mdio_write functions
  net: sun8i_emac: Remove pointless wrapper functions
  net: sun8i_emac: Name magic bits and simplify read-modify-write calls
  net: sun8i_emac: Improve cache maintenance on RX descriptor init
  net: sun8i_emac: Reduce cache maintenance on TX descriptor init
  net: sun8i_emac: Drop unneeded cache invalidation before sending
  net: sun8i_emac: Wrap and simplify cache maintenance operations
  net: sun8i_emac: Fix overlong lines
  net: sun8i_emac: Fix MAC soft reset
  net: sun8i_emac: Simplify and fix error handling for RX
  net: sun8i-emac: Make internal PHY handling more robust
  net: sun8i-emac: Lower MDIO frequency
  sunxi: Pine-H64: Explicitly enable PHY regulator

 configs/pine_h64_defconfig |   1 +
 drivers/net/sun8i_emac.c   | 458 +++++++++++++++++--------------------
 2 files changed, 208 insertions(+), 251 deletions(-)

-- 
2.17.5



More information about the U-Boot mailing list