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 20E48C433F5 for ; Tue, 22 Feb 2022 15:20:14 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9650D83C95; Tue, 22 Feb 2022 16:20:12 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="lakyOZaM"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9272483C93; Tue, 22 Feb 2022 16:20:09 +0100 (CET) Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 657A883CA7 for ; Tue, 22 Feb 2022 16:20:00 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=heiko.thiery@gmail.com Received: by mail-ed1-x536.google.com with SMTP id x5so37632482edd.11 for ; Tue, 22 Feb 2022 07:20:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=v5TWjQC921JLlqjAVzwRfGG2bMU1g1J+h/m1ZG8gzNk=; b=lakyOZaMNXKL7QZ1wOTfOH9jMHRP2hX7VkNCsAqxZU/hP3brKgnI0bFlRpf7sTcQop bVLRjioFRx6jn8ZRPFcpDW9m+vzKtyrl1jtl9audR7+zoVX+DgL9BRkUhhho0qR4K1V7 QM1wCgUigP06aILMm2+3oqibMMuSs0+olCjeVY6MOSp/GMrZNAjiCXJAxm6ybO+Nv72m KvPVnwPGooMZGWxuvSuLdPisjpaqC9Dgr25twGHcDWMjcWQI2VnvjrWfEn2eNHloC0Pg x3KMc40WAEHB/mIIc6RjJ327R/xJZsMoeCKW7UIPU0AqTHRcPXGvBwtaX0bndliJgaUj KrUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=v5TWjQC921JLlqjAVzwRfGG2bMU1g1J+h/m1ZG8gzNk=; b=jE7oJcRKIsnRLiIHv2GwaBGvKdQbvq0XfaIL7TuaoqkhykMbVMnNtUV91m1QxZGspm ToD2d/sjQ2Nsd2Li0TOJjmQEGulf6Gw+vicTwJWFC/8itrPz1nTyZbGE26M1UMkQDVWn vKQZUtJ5VBDYWWDZ07QNi65WNO6Dg5WikjdcV0naRwbhTFLbcrKtQqqkc5VA1zui9tcX ZpN/Tp0jeIE69eqv4JOIGr8eemu2x0/tf8hDepvP0Qx/oh5f0hyMeb2OtGAOtBDkJUII 9MQa39yHM0bV2FPZX54MlqMebDU7OoR7ejlZrnsYsIF0MFfHWP+4TLKIvn0h1dxl0nRp Uugg== X-Gm-Message-State: AOAM533apk2jR65LTGSYdO8sijW2JecTEwEIRlk4KlR7jW3HcxT/lpmY gSRPt0+XP8zRJOxzNzXHermCv//+TkHpeEtI X-Google-Smtp-Source: ABdhPJyQVo2bCvdnRyREwoSMpMKhhhGyLce5c/a0QAtnOZbiZB3x5+kZs0WX8RYwJXHed8JTTX/4ww== X-Received: by 2002:aa7:c948:0:b0:413:2bed:e82e with SMTP id h8-20020aa7c948000000b004132bede82emr1670863edt.394.1645543199658; Tue, 22 Feb 2022 07:19:59 -0800 (PST) Received: from hthiery.kontron.local ([213.135.10.150]) by smtp.gmail.com with ESMTPSA id g11sm6558777ejs.14.2022.02.22.07.19.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Feb 2022 07:19:59 -0800 (PST) From: Heiko Thiery To: u-boot@lists.denx.de Cc: Stefano Babic , Michael Walle , Fabio Estevam , "NXP i . MX U-Boot Team" , Peng Fan , Frieder Schrempf , Marek Vasut , Heiko Thiery Subject: [PATCH v2] ARM: imx: imx8mn-*-evk: use DM settings for PHY configuration Date: Tue, 22 Feb 2022 16:19:29 +0100 Message-Id: <20220222151928.417186-1-heiko.thiery@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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>; 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; + vddio-supply = <&vddio>; + + vddio: vddio-regulator { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; }; }; }; 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(); -- 2.30.2