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 X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 8812CCA9EC5 for ; Wed, 30 Oct 2019 16:28:43 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4A92D20717 for ; Wed, 30 Oct 2019 16:28:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="b/t4e1wO"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="gtK4LzEN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4A92D20717 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lunn.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1VR4RBooXCm8ak9pw7utdSs+xxJ2woTsTGrp/FXnVg0=; b=b/t4e1wOGZ7h6V q6KZ26jVjATUgwzdkyPJXZWch1NPWAIgdbDungwWDUIquoqytqIB8R8pyZdvaEc/hTDSDgX7piqNz 6YGn/CY36OiRE1/FO406FaV45cbXHE6b7k8L1G+cqPlG0Lj00vFTOhVix4gFD97yDjVQdDYsd6plB y0jZcnff0I1RxfI84xpfMUtlrZTLv0eTx6zZokzrkxa6qSp4SmR7gVtetQqZ/MoNdnptlLJwDjjqm LyW0A/Ava2dphQPswvjiDUN43r05dYBsEat0Eu1Co7M79CPzng3SH9zB0SH4WjEMVJO0+fTOnuzo8 5BveytBdYGYhMMUv/TEw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iPqpu-0002SR-9a; Wed, 30 Oct 2019 16:28:42 +0000 Received: from vps0.lunn.ch ([185.16.172.187]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iPqpr-0002RS-J6 for linux-arm-kernel@lists.infradead.org; Wed, 30 Oct 2019 16:28:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=SZUx4NVeGGOnxDClBHA9DgqzCOffD4hhcgm5wwv6WUs=; b=gtK4LzENJNZ3IfWDlksuD6F6Mk +X7v8aAddo+Y3EA2Wk14qoXStLAhyN7omwt1LGMfId8PsMuvDF6vgFXxhVaFq4/anphnNaJlQJB01 /A8XrrdjOyaF3fZg3cGRF73XE25jsx06xJbg9e2o5hhopEgdBvPla7jPVCTBv0nkxouI=; Received: from andrew by vps0.lunn.ch with local (Exim 4.92.2) (envelope-from ) id 1iPqph-0003cy-GH; Wed, 30 Oct 2019 17:28:29 +0100 Date: Wed, 30 Oct 2019 17:28:29 +0100 From: Andrew Lunn To: Jose Abreu Subject: Re: [PATCH net-next 2/3] net: stmmac: xgmac: Add C45 PHY support in the MDIO callbacks Message-ID: <20191030162829.GC10555@lunn.ch> References: <444208cef341686bcf35f8361f409467f539c73b.1572449009.git.Jose.Abreu@synopsys.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <444208cef341686bcf35f8361f409467f539c73b.1572449009.git.Jose.Abreu@synopsys.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191030_092839_637269_FAF98686 X-CRM114-Status: GOOD ( 13.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Joao Pinto , Alexandre Torgue , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "David S. Miller" , Maxime Coquelin , Giuseppe Cavallaro , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Oct 30, 2019 at 04:28:49PM +0100, Jose Abreu wrote: > Add the support for C45 PHYs in the MDIO callbacks for XGMAC. This was > tested using Synopsys DesignWare XPCS. > > Signed-off-by: Jose Abreu > > --- > Cc: Giuseppe Cavallaro > Cc: Alexandre Torgue > Cc: Jose Abreu > Cc: "David S. Miller" > Cc: Maxime Coquelin > Cc: netdev@vger.kernel.org > Cc: linux-stm32@st-md-mailman.stormreply.com > Cc: linux-arm-kernel@lists.infradead.org > Cc: linux-kernel@vger.kernel.org > --- > drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 47 +++++++++++++++++++++-- > 1 file changed, 43 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c > index 40c42637ad75..143bffd28acf 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c > @@ -41,6 +41,29 @@ > #define MII_XGMAC_BUSY BIT(22) > #define MII_XGMAC_MAX_C22ADDR 3 > #define MII_XGMAC_C22P_MASK GENMASK(MII_XGMAC_MAX_C22ADDR, 0) > +#define MII_XGMAC_PA_SHIFT 16 > +#define MII_XGMAC_DA_SHIFT 21 > + > +static int stmmac_xgmac2_c45_format(struct stmmac_priv *priv, int phyaddr, > + int phyreg, u32 *hw_addr) > +{ > + unsigned int mii_data = priv->hw->mii.data; > + u32 tmp; > + > + /* Wait until any existing MII operation is complete */ > + if (readl_poll_timeout(priv->ioaddr + mii_data, tmp, > + !(tmp & MII_XGMAC_BUSY), 100, 10000)) > + return -EBUSY; Hi Jose The stmmac_xgmac2_c22_format function does the same. Maybe the call can be pulled out into stmmac_xgmac2_mdio_write() and stmmac_xgmac2_mdio_read()? Andrew _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel