netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: Oleksij Rempel <o.rempel@pengutronix.de>,
	Bruno Thomsen <bruno.thomsen@gmail.com>
Cc: Fabio Estevam <festevam@gmail.com>, Andrew Lunn <andrew@lunn.ch>,
	David Jander <david@protonic.nl>,
	Sascha Hauer <kernel@pengutronix.de>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	netdev <netdev@vger.kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Marc Kleine-Budde <mkl@pengutronix.de>,
	Florian Fainelli <f.fainelli@gmail.com>
Subject: Re: PHY reset question
Date: Mon, 12 Oct 2020 10:25:46 +0200	[thread overview]
Message-ID: <cbb3aecd-5bcd-7221-2b0a-0ba91c9a55c0@denx.de> (raw)
In-Reply-To: <20201012054839.n6do5ruxhbhc7h7n@pengutronix.de>

On 10/12/20 7:48 AM, Oleksij Rempel wrote:
> 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 <festevam@gmail.com>:
>>>
>>> Hi Oleksij,
>>>
>>> On Tue, Oct 6, 2020 at 5:05 AM Oleksij Rempel <o.rempel@pengutronix.de> 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.

I did further digging in this, and I agree it is either this or reset in
boot loader, sigh.

      reply	other threads:[~2020-10-12  8:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-06  8:04 PHY reset question Oleksij Rempel
2020-10-06 19:36 ` Florian Fainelli
2020-10-06 20:24   ` Marek Vasut
2020-10-06 21:11     ` Florian Fainelli
2020-10-06 22:24       ` Marek Vasut
2020-10-07  8:14       ` Marco Felsch
2020-10-07  8:23         ` Marek Vasut
2020-10-07  9:06           ` Marco Felsch
2020-10-07  9:20             ` Marek Vasut
2020-10-07 10:47               ` Marco Felsch
2020-10-07 15:44                 ` Florian Fainelli
2020-10-07  9:50 ` Fabio Estevam
2020-10-09 14:25   ` Bruno Thomsen
2020-10-12  5:48     ` Oleksij Rempel
2020-10-12  8:25       ` Marek Vasut [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cbb3aecd-5bcd-7221-2b0a-0ba91c9a55c0@denx.de \
    --to=marex@denx.de \
    --cc=andrew@lunn.ch \
    --cc=bruno.thomsen@gmail.com \
    --cc=david@protonic.nl \
    --cc=f.fainelli@gmail.com \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mkl@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).