From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 52474C433EF for ; Thu, 31 Mar 2022 23:37:54 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8572B84288; Fri, 1 Apr 2022 01:31:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (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 9867E84274; Fri, 1 Apr 2022 01:31:21 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id 544E8842BD for ; Fri, 1 Apr 2022 01:23:13 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (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 C287B15DB; Thu, 31 Mar 2022 16:23:12 -0700 (PDT) Received: from slackpad.lan (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7E0A23F73B; Thu, 31 Mar 2022 16:23:11 -0700 (PDT) Date: Fri, 1 Apr 2022 00:20:21 +0100 From: Andre Przywara To: Samuel Holland Cc: u-boot@lists.denx.de, Jagan Teki , Sean Anderson , Simon Glass , Heinrich Schuchardt , Heiko Schocher , Joe Hershberger Subject: Re: [PATCH v2 12/23] net: sun8i_emac: Remove non-DM pin setup Message-ID: <20220401002021.6bfe54fe@slackpad.lan> In-Reply-To: <20220318035420.15058-13-samuel@sholland.org> References: <20220318035420.15058-1-samuel@sholland.org> <20220318035420.15058-13-samuel@sholland.org> Organization: Arm Ltd. X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.31; x86_64-slackware-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.5 at phobos.denx.de X-Virus-Status: Clean On Thu, 17 Mar 2022 22:54:09 -0500 Samuel Holland wrote: > This is now handled automatically by the pinctrl driver. > > Signed-off-by: Samuel Holland Love that diffstat! Reviewed-by: Andre Przywara Cheers, Andre > --- > > (no changes since v1) > > drivers/net/sun8i_emac.c | 90 ---------------------------------------- > 1 file changed, 90 deletions(-) > > diff --git a/drivers/net/sun8i_emac.c b/drivers/net/sun8i_emac.c > index 2e24d12214..b23faa228e 100644 > --- a/drivers/net/sun8i_emac.c > +++ b/drivers/net/sun8i_emac.c > @@ -29,7 +29,6 @@ > #include > #include > #include > -#include > #include > > #define MDIO_CMD_MII_BUSY BIT(0) > @@ -81,13 +80,6 @@ > > #define AHB_GATE_OFFSET_EPHY 0 > > -/* IO mux settings */ > -#define SUN8I_IOMUX_H3 2 > -#define SUN8I_IOMUX_R40 5 > -#define SUN8I_IOMUX_H6 5 > -#define SUN8I_IOMUX_H616 2 > -#define SUN8I_IOMUX 4 > - > /* H3/A64 EMAC Register's offset */ > #define EMAC_CTL0 0x00 > #define EMAC_CTL0_FULL_DUPLEX BIT(0) > @@ -519,85 +511,6 @@ static int sun8i_emac_eth_start(struct udevice *dev) > return 0; > } > > -static int parse_phy_pins(struct udevice *dev) > -{ > - int offset; > - const char *pin_name; > - int drive, pull = SUN4I_PINCTRL_NO_PULL, i; > - u32 iomux; > - > - offset = fdtdec_lookup_phandle(gd->fdt_blob, dev_of_offset(dev), > - "pinctrl-0"); > - if (offset < 0) { > - printf("WARNING: emac: cannot find pinctrl-0 node\n"); > - return offset; > - } > - > - drive = fdt_getprop_u32_default_node(gd->fdt_blob, offset, 0, > - "drive-strength", ~0); > - if (drive != ~0) { > - if (drive <= 10) > - drive = SUN4I_PINCTRL_10_MA; > - else if (drive <= 20) > - drive = SUN4I_PINCTRL_20_MA; > - else if (drive <= 30) > - drive = SUN4I_PINCTRL_30_MA; > - else > - drive = SUN4I_PINCTRL_40_MA; > - } > - > - if (fdt_get_property(gd->fdt_blob, offset, "bias-pull-up", NULL)) > - pull = SUN4I_PINCTRL_PULL_UP; > - else if (fdt_get_property(gd->fdt_blob, offset, "bias-pull-down", NULL)) > - pull = SUN4I_PINCTRL_PULL_DOWN; > - > - /* > - * The GPIO pinmux value is an integration choice, so depends on the > - * SoC, not the EMAC variant. > - */ > - if (IS_ENABLED(CONFIG_MACH_SUNXI_H3_H5)) > - iomux = SUN8I_IOMUX_H3; > - else if (IS_ENABLED(CONFIG_MACH_SUN8I_R40)) > - iomux = SUN8I_IOMUX_R40; > - else if (IS_ENABLED(CONFIG_MACH_SUN50I_H6)) > - iomux = SUN8I_IOMUX_H6; > - else if (IS_ENABLED(CONFIG_MACH_SUN50I_H616)) > - iomux = SUN8I_IOMUX_H616; > - else if (IS_ENABLED(CONFIG_MACH_SUN8I_A83T)) > - iomux = SUN8I_IOMUX; > - else if (IS_ENABLED(CONFIG_MACH_SUN50I)) > - iomux = SUN8I_IOMUX; > - else > - BUILD_BUG_ON_MSG(1, "missing pinmux value for Ethernet pins"); > - > - for (i = 0; ; i++) { > - int pin; > - > - pin_name = fdt_stringlist_get(gd->fdt_blob, offset, > - "pins", i, NULL); > - if (!pin_name) > - break; > - > - pin = sunxi_name_to_gpio(pin_name); > - if (pin < 0) > - continue; > - > - sunxi_gpio_set_cfgpin(pin, iomux); > - > - if (drive != ~0) > - sunxi_gpio_set_drv(pin, drive); > - if (pull != ~0) > - sunxi_gpio_set_pull(pin, pull); > - } > - > - if (!i) { > - printf("WARNING: emac: cannot find pins property\n"); > - return -2; > - } > - > - return 0; > -} > - > static int sun8i_emac_eth_recv(struct udevice *dev, int flags, uchar **packetp) > { > struct emac_eth_dev *priv = dev_get_priv(dev); > @@ -965,9 +878,6 @@ static int sun8i_emac_eth_of_to_plat(struct udevice *dev) > > priv->interface = pdata->phy_interface; > > - if (!priv->use_internal_phy) > - parse_phy_pins(dev); > - > sun8i_pdata->tx_delay_ps = fdtdec_get_int(gd->fdt_blob, node, > "allwinner,tx-delay-ps", 0); > if (sun8i_pdata->tx_delay_ps < 0 || sun8i_pdata->tx_delay_ps > 700)