From patchwork Mon May 29 19:33:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugo Villeneuve X-Patchwork-Id: 100392 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1733294vqr; Mon, 29 May 2023 12:47:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7/pXCtVSV6uMWjU3HaV2f5J5ypeIGO7n9+g2ZXW5YPsXK2dgTnpP4g/4HmdYFQIJcbjGFY X-Received: by 2002:a05:6a20:3d89:b0:10d:5390:eadb with SMTP id s9-20020a056a203d8900b0010d5390eadbmr95168pzi.2.1685389636248; Mon, 29 May 2023 12:47:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685389636; cv=none; d=google.com; s=arc-20160816; b=ImfGKNzYEu5TBekZMa/ucKyuJkVHdhArE6mzEFY1LeI/N9/E+Jzr+GPGf3YgoRKEkH nKe4c3IvL8oDEOuZJXLXUQimGSb+VzPTNy6B5NkN/GtgqgBHNNGil1vE1EUWq+S+FJaJ kdXzZ7SznWnoTTnHV/Cdae76VpKMOBWynyKmGier/bl6abUO5C7YOh8JKfyJcxes0mlo sI82I+rpsVNjC+Bf43QhFCF+QpH9QMaREUj62OFAGST5Zp/0VVAFLUKa7DFOanj90BnZ DckEqXOlH0F/0XmcJZ6B4JlAK3SblEjb2RVjNl2n+g2iUyqLyAJLpJdIqt7EmqRqP+Nc SpHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:content-transfer-encoding:mime-version :message-id:date:cc:to:from:dkim-signature; bh=LyKdt7bIuSLgYX3j/F+gzEFbzYlw1Pil8ehJHqfkgQE=; b=CRpQwvHyHyOom8pjA9urkFyEhigpVpK+6d6R8nGqMKfODVZmaxXQf6gadTLEIHYYj3 EZy7pB3j2WZ01Y0GVWRD6GibDmXyHFuHU6nVM+CTpSDk86RxTlioCmFLq6Fbhx+6dzGP wfLKO4BrPo1xvvaNKkiwJpobCxXJvmp7ipimbQmWOc7L1CcKrZG8JZBBh0lma+I4OvhU j2hBdgBkQM5Szk5r2yZtWkm7FMTj9Fcmg5ghZul0nPH9KQbVOQfhc+WD3RfuNDcjeF2q JFNFAKbW966NPFxPP5x20o77pXIuFOPkgSZJFd0uhkFdH3FnSJ7/CUpDegxWl2muE9aO 62Qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@hugovil.com header.s=x header.b=OV12uHWL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a21-20020a63e855000000b0053413a82947si925368pgk.447.2023.05.29.12.47.02; Mon, 29 May 2023 12:47:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@hugovil.com header.s=x header.b=OV12uHWL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229557AbjE2Tdr (ORCPT + 99 others); Mon, 29 May 2023 15:33:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229485AbjE2Tdq (ORCPT ); Mon, 29 May 2023 15:33:46 -0400 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BE56B7; Mon, 29 May 2023 12:33:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=hugovil.com ; s=x; h=Subject:Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Cc:To :From:Sender:Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=LyKdt7bIuSLgYX3j/F+gzEFbzYlw1Pil8ehJHqfkgQE=; b=O V12uHWLprzyTdzNurAPHeByriz49zDuhyrfbUSbQxWIoGO5/4BnHzLRcsLvE21oVEvmz4QBIG1Zbw +vZAqhFtpIs4ObhoeHAABNkkwii2m7Nh+5qfmGzhHEbz6HjHXESmc14+gxTEvMki+hxcUnpf8Ymq6 P5MDzsv9V9KeuUik=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168]:42950 helo=pettiford.lan) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1q3icZ-0000Ll-Ok; Mon, 29 May 2023 15:33:36 -0400 From: Hugo Villeneuve To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team Cc: hugo@hugovil.com, Hugo Villeneuve , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Date: Mon, 29 May 2023 15:33:12 -0400 Message-Id: <20230529193311.1033939-1-hugo@hugovil.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 70.80.174.168 X-SA-Exim-Mail-From: hugo@hugovil.com X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Subject: [PATCH] arm64: dts: imx8mn-var-som: add 20ms delay to ethernet regulator enable X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.hugovil.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767259123454432415?= X-GMAIL-MSGID: =?utf-8?q?1767259123454432415?= From: Hugo Villeneuve This commit is taken from Variscite linux kernel public git repository. Original patch author: Nate Drude See: https://github.com/varigit/linux-imx/blob/5.15-2.0.x-imx_var01/drivers/net/ethernet/freescale/fec_main.c#L3993-L4050 The ethernet phy reset was moved from the fec controller to the mdio bus, see for example: 0e825b32c033e1998d0ebaf247f5dab3c340e3bf When the fec driver managed the reset, the regulator had time to settle during the fec phy reset before calling of_mdiobus_register, which probes the mii bus for the phy id to match the correct driver. Now that the mdio bus controls the reset, the fec driver no longer has any delay between enabling the regulator and calling of_mdiobus_register. If the regulator voltage has not settled, the phy id will not be read correctly and the generic phy driver will be used. The following call tree explains in more detail: fec_probe fec_reset_phy <- no longer introduces delay after migration to mdio reset fec_enet_mii_init of_mdiobus_register of_mdiobus_register_phy fwnode_mdiobus_register_phy get_phy_device <- mii probe for phy id to match driver happens here ... fwnode_mdiobus_phy_device_register phy_device_register mdiobus_register_device mdio_device_reset <- mdio reset assert / deassert delay happens here Add a 20ms enable delay to the regulator to fix the issue. Signed-off-by: Hugo Villeneuve --- arch/arm64/boot/dts/freescale/imx8mn-var-som.dtsi | 1 + 1 file changed, 1 insertion(+) base-commit: 8b817fded42d8fe3a0eb47b1149d907851a3c942 diff --git a/arch/arm64/boot/dts/freescale/imx8mn-var-som.dtsi b/arch/arm64/boot/dts/freescale/imx8mn-var-som.dtsi index cbd9d124c80d..a502ef7394a3 100644 --- a/arch/arm64/boot/dts/freescale/imx8mn-var-som.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mn-var-som.dtsi @@ -27,6 +27,7 @@ reg_eth_phy: regulator-eth-phy { regulator-name = "eth_phy_pwr"; regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; + regulator-enable-ramp-delay = <20000>; gpio = <&gpio2 9 GPIO_ACTIVE_HIGH>; enable-active-high; };