Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4145FC47088 for ; Wed, 26 May 2021 23:24:48 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 2D3AE61358 for ; Wed, 26 May 2021 23:24:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2D3AE61358 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 104A482052; Thu, 27 May 2021 01:24:45 +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 C5BD982CAC; Thu, 27 May 2021 01:24:43 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id D897C81DB3 for ; Thu, 27 May 2021 01:24:40 +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 F141C13A1; Wed, 26 May 2021 16:24:38 -0700 (PDT) Received: from slackpad.fritz.box (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 17D873F719; Wed, 26 May 2021 16:24:37 -0700 (PDT) Date: Thu, 27 May 2021 00:24:19 +0100 From: Andre Przywara To: Andreas Rehn Cc: hdegoede@redhat.com, jagan@amarulasolutions.com, icenowy@aosc.io, u-boot@lists.denx.de, linux-sunxi@googlegroups.com Subject: Re: [PATCH v2 4/6] net: sun8i-emac: add v3s variant Message-ID: <20210527002419.39cd8542@slackpad.fritz.box> In-Reply-To: <20210522232238.201303-1-rehn.andreas86@gmail.com> References: <20210519194208.515548-5-rehn.andreas86@gmail.com> <20210522232238.201303-1-rehn.andreas86@gmail.com> Organization: Arm Ltd. X-Mailer: Claws Mail 3.17.1 (GTK+ 2.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.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.4 at phobos.denx.de X-Virus-Status: Clean On Sun, 23 May 2021 01:22:38 +0200 Andreas Rehn wrote: Hi, > Add variant V3S_EMAC. > Handle pinmux compile time error by skipping goio setup, because > V3s uses internal phy and don't expose pins. > > Signed-off-by: Andreas Rehn Reviewed-by: Andre Przywara Cheers, Andre > --- > Changes in v2: > - skip pinmux and add proper description > - Add V3S variant add it to compatible list > - Skip (R)GMII flags and handle sun8i_handle_internal_phy > > drivers/net/sun8i_emac.c | 15 ++++++++++++--- > 1 file changed, 12 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/sun8i_emac.c b/drivers/net/sun8i_emac.c > index 5a1b38bf80..ab9f61994c 100644 > --- a/drivers/net/sun8i_emac.c > +++ b/drivers/net/sun8i_emac.c > @@ -145,6 +145,7 @@ enum emac_variant { > A64_EMAC, > R40_GMAC, > H6_EMAC, > + V3S_EMAC, > }; > > struct emac_dma_desc { > @@ -303,7 +304,7 @@ static void sun8i_adjust_link(struct emac_eth_dev *priv, > static u32 sun8i_emac_set_syscon_ephy(struct emac_eth_dev *priv, u32 reg) > { > if (priv->use_internal_phy) { > - /* H3 based SoC's that has an Internal 100MBit PHY > + /* H3 and V3s based SoC's that has an Internal 100MBit PHY > * needs to be configured and powered up before use > */ > reg &= ~H3_EPHY_DEFAULT_MASK; > @@ -354,7 +355,8 @@ static int sun8i_emac_set_syscon(struct sun8i_eth_pdata *pdata, > case PHY_INTERFACE_MODE_RGMII_ID: > case PHY_INTERFACE_MODE_RGMII_RXID: > case PHY_INTERFACE_MODE_RGMII_TXID: > - reg |= SC_EPIT | SC_ETCS_INT_GMII; > + if (priv->variant != V3S_EMAC) > + reg |= SC_EPIT | SC_ETCS_INT_GMII; > break; > case PHY_INTERFACE_MODE_RMII: > if (priv->variant == H3_EMAC || > @@ -566,6 +568,10 @@ static int parse_phy_pins(struct udevice *dev) > iomux = SUN8I_IOMUX; > else if (IS_ENABLED(CONFIG_MACH_SUN50I)) > iomux = SUN8I_IOMUX; > + else if (IS_ENABLED(CONFIG_MACH_SUN8I_V3S)) > + // V3s does not expose any MAC pins, > + // but case is required to handle BUILD_BUG_ON_MSG. > + return 0; > else > BUILD_BUG_ON_MSG(1, "missing pinmux value for Ethernet pins"); > > @@ -956,7 +962,8 @@ static int sun8i_emac_eth_of_to_plat(struct udevice *dev) > return -EINVAL; > } > > - if (priv->variant == H3_EMAC) { > + if (priv->variant == H3_EMAC || > + priv->variant == V3S_EMAC) { > ret = sun8i_handle_internal_phy(dev, priv); > if (ret) > return ret; > @@ -1009,6 +1016,8 @@ static const struct udevice_id sun8i_emac_eth_ids[] = { > .data = (uintptr_t)R40_GMAC }, > {.compatible = "allwinner,sun50i-h6-emac", > .data = (uintptr_t)H6_EMAC }, > + {.compatible = "allwinner,sun8i-v3s-emac", > + .data = (uintptr_t)V3S_EMAC }, > { } > }; >