All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* driving Eth PHYs as udevices
@ 2019-12-03 12:14 Alexandru Marginean
  0 siblings, 0 replies; only message in thread
From: Alexandru Marginean @ 2019-12-03 12:14 UTC (permalink / raw
  To: u-boot

Hi,

does anyone have any strong feelings either way about the idea of 
driving Eth PHYs as udevices?
I'm looking for a solution for a few problems:
- There are a few Eth switches that are accessed over MDIO and 
could/should be driven as DSA switches instead of PHYs.  This requires 
that MDIO does probing of child devices like any regular bus and doesn't 
assume they are all PHYs.  Also it requires that MDIO enumerates (at 
least some) of its children instead of wating for an Eth device to come 
connect to a specific PHY/addr.
- PHY scanning using empty 'reg' in PHY DT nodes works for anything more 
complicated than a single PHY on the bus only only if there is some 
state in the bus.  In Linux child nodes with valid reg are bound first 
and then any others left are associated with PHYs found scanning.  This 
doesn't work if there is no enumeration on the MDIO bus and it just 
waits for Eth drivers to connect to PHYs.
- there are a few other peculiarities with current PHY support, 
mentioned by Grygorii on this list, like phy probe being called before 
its DT node was populated in phydev structure.  Using the regular 
udevice infrastructure should fix that and make PHYs consistent with 
just about anything else.

What I'm thinking to do is to enumerate all child DT nodes when MDIO is 
probed and bind drivers to them.  If some are missing the 'reg' property 
the bus is scanned.
The devices associated with DT child nodes are bound to drivers, probed, 
if they are PHYs then they have to wait for someone to come connect to 
them, but if they are switches or anything else they are set up as expected.

Thoughts?
Alex

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-12-03 12:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-03 12:14 driving Eth PHYs as udevices Alexandru Marginean

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.