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 962EDC433EF for ; Wed, 23 Feb 2022 08:11:06 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A21D683B61; Wed, 23 Feb 2022 09:11:03 +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="SMUaumDj"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D994383B58; Wed, 23 Feb 2022 09:11:01 +0100 (CET) Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) (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 B4D0183B5A for ; Wed, 23 Feb 2022 09:10:54 +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-wr1-x431.google.com with SMTP id j22so12126965wrb.13 for ; Wed, 23 Feb 2022 00:10:54 -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=baHRO/3NFLlT7MfwoOs7lpPEXqVGsV9Dkp2qq9xzkVI=; b=SMUaumDjcm+cm0SRlkFX4IEkqpe17nANxy4tHqv1Y6w5gtjUpHQ09DZJTVVpeg1H+p itF/dfcqLApFGrhSBGDqzRjqNbbgv8AJbuwO6QHlkUeBLVKzA5YAtLD5gqYyUPVuHsP4 tIXVNB8l/dnrL+6s2Ghdy8VI/rdg1kYhkKPdP2F5UjVuPSbQjP65568zhfdBbNTcZ12A pvLRUqjP2QuPDWm1idVikOfPlclSoF7KYpvfFeI3CO2QX5uWVfVqd7xhORe8ykhEADWd 4eCQPMUSxM9tCk5Hw0ClFWiXqoTUkYdsAQ4YSu+NM2C9Hg/rtNXYhxRrfCt2ZMlyevbN xzgw== 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=baHRO/3NFLlT7MfwoOs7lpPEXqVGsV9Dkp2qq9xzkVI=; b=y6AzFfBgWV8WdD08nJQbLeT5C9cl2v2D83epsiF5G1s6m28rxjEWsd0vMyG+PyKDSC dZy8GwBe2BsZaIlqOSdL+o9lePdsDLigCqMZSx0mbnMg04imyK5b6KmTRNA2+e/H+v+Q yfvTSUMfyoUJWbLqdnznkmARfe0uBjsjZ8zo5jRepaLBFurIT+kUAMYFMrMyGzgRiaoi tXW32KdFIm/bmsvPK3y0t1kJXFUafNqgPfx7hfN/FHmHCKY6prypgu6qyanrWa4YkCrG alwxe1fa073DPmjpo1CwLU7SmSeMZYG/iCclspvBd7n0ZlD98GOIuB7gPb9kz0zTRME8 5K7Q== X-Gm-Message-State: AOAM533Y9zz4ipkg6ZaIJhuM9zGFzDi/gPb0TIz2VSe66a9ZLteG9FFx 7QrbLAZC163aKLTQJG7zw7JuinYbI5X8AFwW X-Google-Smtp-Source: ABdhPJx9+c/lYHTZZOYfzlfoA8t2AXxB0nP+AMC6c1trZsXXvp1fqO3DiZ83CdBfZ0IuTG9UP1B6Ow== X-Received: by 2002:adf:e94b:0:b0:1e6:98f:33f8 with SMTP id m11-20020adfe94b000000b001e6098f33f8mr22590137wrn.701.1645603853803; Wed, 23 Feb 2022 00:10:53 -0800 (PST) Received: from hthiery.kontron.local ([213.135.10.150]) by smtp.gmail.com with ESMTPSA id f13sm37596939wri.82.2022.02.23.00.10.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Feb 2022 00:10:53 -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 v3] ARM: imx: imx8mn-*-evk: use DM settings for PHY configuration Date: Wed, 23 Feb 2022 09:10:29 +0100 Message-Id: <20220223081028.458971-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. The PHY latency settings are derived from the phy-mode property and the voltage seetings are done via the regulator. 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 v3: - Only change remove/replace the voltage settings and the delay settings. The pyh-reset-gpios vs. reset-gpios settings has to be discussed arch/arm/dts/imx8mn-evk.dtsi | 6 ++++++ board/freescale/imx8mn_evk/imx8mn_evk.c | 16 ---------------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/arch/arm/dts/imx8mn-evk.dtsi b/arch/arm/dts/imx8mn-evk.dtsi index 416fadb22b..fc2c7f1d44 100644 --- a/arch/arm/dts/imx8mn-evk.dtsi +++ b/arch/arm/dts/imx8mn-evk.dtsi @@ -64,6 +64,12 @@ ethphy0: ethernet-phy@0 { compatible = "ethernet-phy-ieee802.3-c22"; reg = <0>; + 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