mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: Florian Fainelli <f.fainelli@gmail.com>,
	Oleksij Rempel <o.rempel@pengutronix.de>,
	Andrew Lunn <andrew@lunn.ch>
Cc: David Jander <david@protonic.nl>,
	kernel@pengutronix.de, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org, Russell King <linux@armlinux.org.uk>,
	mkl@pengutronix.de
Subject: Re: PHY reset question
Date: Wed, 7 Oct 2020 00:24:13 +0200	[thread overview]
Message-ID: <59dced0b-3630-3a40-435a-bfa99e23df0e@denx.de> (raw)
In-Reply-To: <0687984c-5768-7c71-5796-8e16169f5192@gmail.com>

On 10/6/20 11:11 PM, Florian Fainelli wrote:
> 
> 
> On 10/6/2020 1:24 PM, Marek Vasut wrote:
>> On 10/6/20 9:36 PM, Florian Fainelli wrote:
>> [...]
>>>> - Use compatible ("compatible = "ethernet-phy-id0022.1560") in the
>>>> devicetree,
>>>>     so that reading the PHYID is not needed
>>>>     - easy to solve.
>>>>     Disadvantage:
>>>>     - losing PHY auto-detection capability
>>>>     - need a new devicetree if different PHY is used (for example in
>>>> different
>>>>       board revision)
>>>
>>> Or you can punt that to the boot loader to be able to tell the
>>> difference and populate different compatible, or even manage the PHY
>>> reset to be able to read the actual PHY OUI. To me that is still the
>>> best solution around.
>>
>> Wasn't there some requirement for Linux to be bootloader-independent ?
> 
> What kind of dependency does this create here? The fact that Linux is
> capable of parsing a compatible string of the form
> "ethernet-phyAAAA.BBBB" is not something that is exclusively applicable
> to Linux. Linux just so happens to support that, but so could FreeBSD or
> any OS for that matter.
> 
> This is exactly the way firmware should be going, that is to describe
> accurately the hardware, while making the life of the OS much easier
> when it can. If we supported ACPI that is exactly what would have to
> happen IMHO.

I should have been more specific, I meant the part where bootloader
should handle the PHY reset. If the kernel code depends on the fact that
the bootloader did PHY reset, then it depends on the bootloader
behavior, and I think that used to be frowned upon.

>> Some systems cannot replace their bootloaders, e.g. if the bootloader is
>> in ROM, so this might not be a solution.
> 
> It is always possible to chain load a field updateable boot loader

Not always, but that's another discussion.

>, and
> even when that is not desirable you could devise a solution that allows
> to utilize say a slightly different DTB that you could append to the
> kernel. Again, if you want to use strictly the same DTB, then you have
> to do what I just suggested and have the boot loader absorb some of this
> complexit

That sounds like moving the problem one level down without really
solving it, the bootloader will have this exact same problem -- how does
it determine that the PHY needs reset if it cannot reads its ID ?

>>>> - modify PHY framework to deassert reset before identifying the PHY.
>>>>     Disadvantages?
>>
>> If this happens on MX6 with FEC, can you please try these two patches?
>>
>> https://patchwork.ozlabs.org/project/netdev/patch/20201006135253.97395-1-marex@denx.de/
>>
>>
>> https://patchwork.ozlabs.org/project/netdev/patch/20201006202029.254212-1-marex@denx.de/
>>
> 
> Your patches are not scaling across multiple Ethernet MAC drivers
> unfortunately, so I am not sure this should be even remotely considered
> a viable solution.

Sorry for that . Since Oleksij was running into this problem on MX6 and
I had similar issue on MX6 with LAN8710 PHY, I thought this might be
helpful.

  reply	other threads:[~2020-10-06 22:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-06  8:04 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 [this message]
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

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=59dced0b-3630-3a40-435a-bfa99e23df0e@denx.de \
    --to=marex@denx.de \
    --cc=andrew@lunn.ch \
    --cc=david@protonic.nl \
    --cc=f.fainelli@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

all inboxes | Powered by JetHome®