From patchwork Mon Jul 6 00:40:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 240732 List-Id: U-Boot discussion From: andre.przywara at arm.com (Andre Przywara) Date: Mon, 6 Jul 2020 01:40:31 +0100 Subject: [PATCH 00/15] net: sun8i-emac fixes and cleanups Message-ID: <20200706004046.20842-1-andre.przywara@arm.com> 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(-) Acked-by: Maxime Ripard Tested-by: Amit Singh Tomar