lkml.org 
[lkml]   [2020]   [Oct]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: PHY reset question
Date


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.

> 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, 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

>
>>> - 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.
--
Florian

\
 
 \ /
  Last update: 2020-10-06 23:12    [W:0.121 / U:0.304 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site