Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3867380pxv; Mon, 19 Jul 2021 10:39:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzasQONxjeWnbKux7qxDzb6UGJ8Z4/0IrQMUbrYDcRitauai21atP+lEmldZEYUJdpBO3Uk X-Received: by 2002:a17:906:5e51:: with SMTP id b17mr28385675eju.270.1626716229494; Mon, 19 Jul 2021 10:37:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626716229; cv=none; d=google.com; s=arc-20160816; b=LxcLbv+lTvgWGbI+PtCuXDbMgo/aBu7ARl1gd7EDWCjixIHL+FxABrT0yWqkBbx1ss R6wLu74hCVc5XsiKhRnfoU9sfzYxXvmpx9nYswhZEWCBKX8rI4A+VwfQScivBRth8pZl /D7FNeyAkAevX3w+JIi7hCG64Ru1fYjd7js9d7A4U+AqEdJRJa6pXo6RGjP2C9aBi6le jD+78ZUyR+zRpBZtKaXMvkbgMbU/V7U0kIn+jp0iunRZFz9uCDdQrg+3MMUMbTo0aIBJ 6OOlqX3i/vcQvoE0lgSvozsMfQT+3R1cwNBeNJXRg8viJM3h5WS0KWVTWlNU6tsUYXaQ TyFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=obnZi6+OqMbm8/14tYCOXatWd0yxJcn6kUCrSz1adJw=; b=UyRP8Ko8ja6LhdcMHzEuFu5D/C0IPvD3yx5Yp3XwAQZ1eESaDfgG2W/Xl5R80WLf6w Z9unBR9bkRKlvN8mxnrVD/aNIaRxOOut2VTAEn42X02mt8/qNhW8MC24FNsLgyU518f7 VoYS2N9pGXfTIgHfzrK3A3VG7unCeLc42KqaFRmSjn2VtE6UT0JcIWWsv5sIFuewMs78 A0IVjMGH3cNI55uUZAN7FaTVePfhoEKeW7YSyOCIe/Z8iaOnwrcOm31IL2pEPCfMZhjO Aem2OqWgrISaYam77qPyBLD6Dz38R4nmK26JzxJGxwTaSz3T19G7N/N4kbM4KBofG/Un K8Gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=V3fqlynl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k5si21448938ejv.445.2021.07.19.10.36.46; Mon, 19 Jul 2021 10:37:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=V3fqlynl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357605AbhGSQwG (ORCPT + 99 others); Mon, 19 Jul 2021 12:52:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:38036 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347985AbhGSPXw (ORCPT ); Mon, 19 Jul 2021 11:23:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0DD9D6128D; Mon, 19 Jul 2021 16:00:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626710415; bh=ekbzzaUD5u3eCGP0Og2rP0xwv6YXMBo625h1uKOdEy0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V3fqlynlzn0Yy0f0SsHO2K2d9muDpB27FCT0eQcX/Eqb3/aA0fQqfG85MfTNKFf5t Jwa7pbLYVCawVc4I6E9AVnffS6PaBMLnFR8UXN7a5Qi6iNpP9kbrrp04HQDxZTQmPH bdlucwwHa3fDRboKuBb8hUVqUB4kVowvqMy6Zk7g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marek Vasut , Alexandre Torgue , Patrice Chotard , Patrick Delaunay , linux-stm32@st-md-mailman.stormreply.com, Alexandre Torgue , Sasha Levin Subject: [PATCH 5.10 206/243] ARM: dts: stm32: Rework LAN8710Ai PHY reset on DHCOM SoM Date: Mon, 19 Jul 2021 16:53:55 +0200 Message-Id: <20210719144947.581541239@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210719144940.904087935@linuxfoundation.org> References: <20210719144940.904087935@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marek Vasut [ Upstream commit 1cebcf9932ab76102e8cfc555879574693ba8956 ] The Microchip LAN8710Ai PHY requires XTAL1/CLKIN external clock to be enabled when the nRST is toggled according to datasheet Microchip LAN8710A/LAN8710Ai DS00002164B page 35 section 3.8.5.1 Hardware Reset: " A Hardware reset is asserted by driving the nRST input pin low. When driven, nRST should be held low for the minimum time detailed in Section 5.5.3, "Power-On nRST & Configuration Strap Timing," on page 59 to ensure a proper transceiver reset. During a Hardware reset, an external clock must be supplied to the XTAL1/CLKIN signal. " This is accidentally fulfilled in the current setup, where ETHCK_K is used to supply both PHY XTAL1/CLKIN and is also fed back through eth_clk_fb to supply ETHRX clock of the DWMAC. Hence, the DWMAC enables ETHRX clock, that has ETHCK_K as parent, so ETHCK_K clock are also enabled, and then the PHY reset toggles. However, this is not always the case, e.g. in case the PHY XTAL1/CLKIN clock are supplied by some other clock source than ETHCK_K or in case ETHRX clock are not supplied by ETHCK_K. In the later case, ETHCK_K would be kept disabled, while ETHRX clock would be enabled, so the PHY would not be receiving XTAL1/CLKIN clock and the reset would fail. Improve the DT by adding the PHY clock phandle into the PHY node, which then also requires moving the PHY reset GPIO specifier in the same place and that then also requires correct PHY reset GPIO timing, so add that too. A brief note regarding the timing, the datasheet says the reset should stay asserted for at least 100uS and software should wait at least 200nS after deassertion. Set both delays to 500uS which should be plenty. Fixes: 34e0c7847dcf ("ARM: dts: stm32: Add DH Electronics DHCOM STM32MP1 SoM and PDK2 board") Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Patrice Chotard Cc: Patrick Delaunay Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Alexandre Torgue Signed-off-by: Sasha Levin --- arch/arm/boot/dts/stm32mp15xx-dhcom-som.dtsi | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/stm32mp15xx-dhcom-som.dtsi b/arch/arm/boot/dts/stm32mp15xx-dhcom-som.dtsi index 71f3e4efce65..27f19575fada 100644 --- a/arch/arm/boot/dts/stm32mp15xx-dhcom-som.dtsi +++ b/arch/arm/boot/dts/stm32mp15xx-dhcom-som.dtsi @@ -118,7 +118,6 @@ max-speed = <100>; phy-handle = <&phy0>; st,eth-ref-clk-sel; - phy-reset-gpios = <&gpioh 3 GPIO_ACTIVE_LOW>; mdio0 { #address-cells = <1>; @@ -127,6 +126,13 @@ phy0: ethernet-phy@1 { reg = <1>; + /* LAN8710Ai */ + compatible = "ethernet-phy-id0007.c0f0", + "ethernet-phy-ieee802.3-c22"; + clocks = <&rcc ETHCK_K>; + reset-gpios = <&gpioh 3 GPIO_ACTIVE_LOW>; + reset-assert-us = <500>; + reset-deassert-us = <500>; interrupt-parent = <&gpioi>; interrupts = <11 IRQ_TYPE_LEVEL_LOW>; }; -- 2.30.2