mbox series

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

Message ID 20200706004046.20842-1-andre.przywara@arm.com
Headers show
Series net: sun8i-emac fixes and cleanups | expand

Message

Andre Przywara July 6, 2020, 12:40 a.m. UTC
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(-)

Comments

Maxime Ripard July 6, 2020, 12:10 p.m. UTC | #1
On Mon, Jul 06, 2020 at 01:40:31AM +0100, Andre Przywara wrote:
> 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!

Acked-by: Maxime Ripard <mripard@kernel.org>

Thanks!
Maxime
Amit Tomer July 7, 2020, 1:59 p.m. UTC | #2
Hi,

On Mon, Jul 6, 2020 at 6:12 AM Andre Przywara <andre.przywara@arm.com> wrote:
>
> 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

Tested this on Pine64+, and it worked without any issue.

Tested-by: Amit Singh Tomar <amittomer25@gmail.com>

Thanks
-Amit