[lkml]   [2023]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] net: mdio: force deassert MDIO reset signal
On Sun, Jan 15, 2023 at 05:10:06PM +0100, Pierluigi Passaro wrote:
> When the reset gpio is defined within the node of the device tree
> describing the PHY, the reset is initialized and managed only after
> calling the fwnode_mdiobus_phy_device_register function.
> However, before calling it, the MDIO communication is checked by the
> get_phy_device function.
> When this happen and the reset GPIO was somehow previously set down,
> the get_phy_device function fails, preventing the PHY detection.
> These changes force the deassert of the MDIO reset signal before
> checking the MDIO channel.
> The PHY may require a minimum deassert time before being responsive:
> use a reasonable sleep time after forcing the deassert of the MDIO
> reset signal.
> Once done, free the gpio descriptor to allow managing it later.

This has been discussed before. The problem is, it is not just a reset
GPIO. There could also be a clock which needs turning on, a regulator,
and/or a linux reset controller. And what order do you turn these on?

The conclusions of the discussion is you assume the device cannot be
found by enumeration, and you put the ID in the compatible. That is
enough to get the driver to load, and the driver can then turn
everything on in the correct order, with the correct delays, etc.

I think there has been some work on generic power sequencing. I've not
being following it, so i've no idea how far it has got. If that could
be used to solve this problem for all the possible controls of a PHY,
i would be open for such patches.


 \ /
  Last update: 2023-03-26 23:42    [W:0.185 / U:0.556 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site