Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3796979pxu; Mon, 12 Oct 2020 01:02:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyd08xMkMU4UeX1OmZddH7W+BRHthYDiQg4tZGULBGTmU2tvolDoo458BSpLTdb6L6lw/YJ X-Received: by 2002:a50:8fa3:: with SMTP id y32mr13160833edy.78.1602489749771; Mon, 12 Oct 2020 01:02:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602489749; cv=none; d=google.com; s=arc-20160816; b=P/ApF7FoZaCDBaH/Ba2Z1IR6j8wtjuhaMVOQGkSl/FrsdlBA+etSXgpU1GW/8iUdtT yaBurk2QsYvjoac18a24deOpyD3hdU6cwZS1I276OAw0DIFC/rC4wECYsYQERQyWFr78 3yMpMsw/oMTtplV4J5ZlpC441aQoyhjKidp89L4JqczSYjTNuokyet1zn/Q+4ZmNOOCu FgPvvvK3TnywuahgryOXnA4BBvmQonLuEnOnUYALlk85cCIffkU6H0BXrd5ZOTQXx3QQ Sema6kK0QiOJIyUS3FU9kGASOgraCUpWY+S5LW2neM8qfVflaAG6hA4GQC6Ti2tvou7S 1q9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=unreifQGKExkLWfS9fT3A9+rjQksEFUzOiAuvPwmGmo=; b=G+X6DZGjBGUyIWr5htTAkK/ItRraye+/4c2TQybx6iXzZpSjzhbw0keIMWjGmZj6K9 /CrxlAJvzgj3sfUmJ39FHELjcHpBfcl7gm6mED3mqbNVVKFXjriQ/gRhni2togoYv0+9 U+vR2px7pvWY125rguuelitc0GTFqutTicyc6sXfGZiv6M44JQGr/dc+lbjtYFSJpXm+ lj75m2x2hjtvMGiO4i4YP+CpAeV2qNln/NOpkne5cCaGYAHg7CrOOSJbH3syUCyCIwRW MlTnjNAj1KSqADpjM0wTAZXw4FFtxZT7pua4vJvzoY15pFLJxPFAwnTJaaTzKlWUhbq7 JCTQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h17si11800183ejx.194.2020.10.12.01.02.05; Mon, 12 Oct 2020 01:02:29 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726957AbgJLFsp (ORCPT + 99 others); Mon, 12 Oct 2020 01:48:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726072AbgJLFsp (ORCPT ); Mon, 12 Oct 2020 01:48:45 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66523C0613CE for ; Sun, 11 Oct 2020 22:48:45 -0700 (PDT) Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kRqhN-0008SA-GX; Mon, 12 Oct 2020 07:48:41 +0200 Received: from ore by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1kRqhL-0002Ue-T7; Mon, 12 Oct 2020 07:48:39 +0200 Date: Mon, 12 Oct 2020 07:48:39 +0200 From: Oleksij Rempel To: Bruno Thomsen Cc: Fabio Estevam , Andrew Lunn , David Jander , Sascha Hauer , linux-kernel , netdev , Russell King , Marc Kleine-Budde , Marek Vasut , Florian Fainelli Subject: Re: PHY reset question Message-ID: <20201012054839.n6do5ruxhbhc7h7n@pengutronix.de> References: <20201006080424.GA6988@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 07:33:52 up 331 days, 20:52, 351 users, load average: 0.00, 0.03, 0.01 User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, thank you for the feedback! On Fri, Oct 09, 2020 at 04:25:49PM +0200, Bruno Thomsen wrote: > Hi Fabio and Oleksij > > Den ons. 7. okt. 2020 kl. 11.50 skrev Fabio Estevam : > > > > Hi Oleksij, > > > > On Tue, Oct 6, 2020 at 5:05 AM Oleksij Rempel wrote: > > > > > > Hello PHY experts, > > > > > > Short version: > > > what is the proper way to handle the PHY reset before identifying PHY? > > > > > > Long version: > > > I stumbled over following issue: > > > If PHY reset is registered within PHY node. Then, sometimes, we will not be > > > able to identify it (read PHY ID), because PHY is under reset. > > > > > > mdio { > > > compatible = "virtual,mdio-gpio"; > > > > > > [...] > > > > > > /* Microchip KSZ8081 */ > > > usbeth_phy: ethernet-phy@3 { > > > reg = <0x3>; > > > > > > interrupts-extended = <&gpio5 12 IRQ_TYPE_LEVEL_LOW>; > > > reset-gpios = <&gpio5 11 GPIO_ACTIVE_LOW>; > > > reset-assert-us = <500>; > > > reset-deassert-us = <1000>; > > > }; > > > > > > [...] > > > }; > > > > > > On simple boards with one PHY per MDIO bus, it is easy to workaround by using > > > phy-reset-gpios withing MAC node (illustrated in below DT example), instead of > > > using reset-gpios within PHY node (see above DT example). > > > > > > &fec { > > > [...] > > > phy-mode = "rmii"; > > > phy-reset-gpios = <&gpio4 12 GPIO_ACTIVE_LOW>; > > > [...] > > > > I thought this has been fixed by Bruno's series: > > https://www.spinics.net/lists/netdev/msg673611.html > > Yes, that has fixed the Microchip/Micrel PHY ID auto detection > issue. I have send a DTS patch v3 that makes use of the newly > added device tree parameter: > https://lkml.org/lkml/2020/9/23/595 This way is suitable only for boards with single PHY and single reset line. But it is not scale on boards with multiple PHY and multiple reset lines. So far, it looks like using compatible like "ethernet-phy-idXXXX.XXXX" is the only way to go. Regards, Oleksij -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |