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: 1323186 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=arm.com Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4B0RcG30f0z9sR4 for ; Mon, 6 Jul 2020 10:42:38 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EF44181BA5; Mon, 6 Jul 2020 02:42:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 4738181B99; Mon, 6 Jul 2020 02:42:16 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id D728281B82 for ; Mon, 6 Jul 2020 02:42:11 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=andre.przywara@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 94E7830E; Sun, 5 Jul 2020 17:42:09 -0700 (PDT) Received: from localhost.localdomain (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7C0763F718; Sun, 5 Jul 2020 17:42:08 -0700 (PDT) From: Andre Przywara To: Jagan Teki , Maxime Ripard , Joe Hershberger Cc: u-boot@lists.denx.de, Chen-Yu Tsai , Amit Singh Tomar Subject: [PATCH 00/15] net: sun8i-emac fixes and cleanups Date: Mon, 6 Jul 2020 01:40:31 +0100 Message-Id: <20200706004046.20842-1-andre.przywara@arm.com> X-Mailer: git-send-email 2.14.1 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean 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