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 A2D77C433F5 for ; Tue, 22 Feb 2022 16:01:01 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2581783C7B; Tue, 22 Feb 2022 17:00:59 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=walle.cc Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; secure) header.d=walle.cc header.i=@walle.cc header.b="YwAEi53H"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6E3C483C93; Tue, 22 Feb 2022 17:00:57 +0100 (CET) Received: from ssl.serverraum.org (ssl.serverraum.org [176.9.125.105]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 40D0383C99 for ; Tue, 22 Feb 2022 17:00:54 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=walle.cc Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=michael@walle.cc Received: from ssl.serverraum.org (web.serverraum.org [172.16.0.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 7AE6722205; Tue, 22 Feb 2022 17:00:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1645545653; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BFWhL4FAyoYG2a3CKN2TLS2mt4W5n0vXwvJ2k3IzWIk=; b=YwAEi53Hst/rNsWNBS6OuN3wk4P+yo7vTpO2826lgNA5fh2QMoV2xC9G9gyzqDQ6oEypMX ClhjMAaJhxNvsymCsJuxOTzGAF7x45VUBA/ex/5W7prM9/kzZ5T9uoUIXNeZ4yi2ceA2b5 3kmrZCyzD+M3erXr9m6kidSy4HEtSf8= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 22 Feb 2022 17:00:53 +0100 From: Michael Walle To: Heiko Thiery Cc: u-boot@lists.denx.de, Stefano Babic , Fabio Estevam , "NXP i . MX U-Boot Team" , Peng Fan , Frieder Schrempf , Marek Vasut Subject: Re: [PATCH v2] ARM: imx: imx8mn-*-evk: use DM settings for PHY configuration In-Reply-To: <20220222151928.417186-1-heiko.thiery@gmail.com> References: <20220222151928.417186-1-heiko.thiery@gmail.com> User-Agent: Roundcube Webmail/1.4.12 Message-ID: <9bd928a4858816fdb166da632224bef9@walle.cc> X-Sender: michael@walle.cc 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 Am 2022-02-22 16:19, schrieb Heiko Thiery: > With the correct settings described in the device-tree the PHY settings > in the board init are no longer required. The values are taken from the > linux device tree. > > Suggested-by: Michael Walle > Signed-off-by: Heiko Thiery > --- > v2: > - remove phy-reset-gpios node (thanks to Michael) > When using DM_ETH_PHY the reset-gpios from the phy is used > > arch/arm/dts/imx8mn-evk.dtsi | 10 +++++++++- > board/freescale/imx8mn_evk/imx8mn_evk.c | 16 ---------------- > 2 files changed, 9 insertions(+), 17 deletions(-) > > diff --git a/arch/arm/dts/imx8mn-evk.dtsi > b/arch/arm/dts/imx8mn-evk.dtsi > index 416fadb22b..fd253f0042 100644 > --- a/arch/arm/dts/imx8mn-evk.dtsi > +++ b/arch/arm/dts/imx8mn-evk.dtsi > @@ -53,7 +53,6 @@ > pinctrl-0 = <&pinctrl_fec1>; > phy-mode = "rgmii-id"; > phy-handle = <ðphy0>; > - phy-reset-gpios = <&gpio4 22 GPIO_ACTIVE_LOW>; This ... > fsl,magic-packet; > status = "okay"; > > @@ -64,6 +63,15 @@ > ethphy0: ethernet-phy@0 { > compatible = "ethernet-phy-ieee802.3-c22"; > reg = <0>; > + reset-gpios = <&gpio4 22 GPIO_ACTIVE_LOW>; > + reset-assert-us = <10000>; > + qca,disable-smarteee; .. and these three lines should probably be a separate patch. > + vddio-supply = <&vddio>; > + > + vddio: vddio-regulator { > + regulator-min-microvolt = <1800000>; > + regulator-max-microvolt = <1800000>; > + }; This looks good. The rgmii pad delay is already handled by the phy-mode. Reviewed-by: Michael Walle > }; > }; > }; > diff --git a/board/freescale/imx8mn_evk/imx8mn_evk.c > b/board/freescale/imx8mn_evk/imx8mn_evk.c > index b24342fd5c..e35d505aea 100644 > --- a/board/freescale/imx8mn_evk/imx8mn_evk.c > +++ b/board/freescale/imx8mn_evk/imx8mn_evk.c > @@ -27,22 +27,6 @@ static void setup_fec(void) > clrsetbits_le32(&gpr->gpr[1], 0x2000, 0); > } > > -int board_phy_config(struct phy_device *phydev) > -{ > - /* enable rgmii rxc skew and phy mode select to RGMII copper */ > - phy_write(phydev, MDIO_DEVAD_NONE, 0x1d, 0x1f); > - phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, 0x8); > - > - phy_write(phydev, MDIO_DEVAD_NONE, 0x1d, 0x00); > - phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, 0x82ee); > - phy_write(phydev, MDIO_DEVAD_NONE, 0x1d, 0x05); > - phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, 0x100); > - > - if (phydev->drv->config) > - phydev->drv->config(phydev); > - return 0; > -} > - > int board_init(void) > { > setup_fec();