MDIO bus hotplug
Andy Fleming
afleming at freescale.com
Tue Aug 28 04:07:14 EST 2007
On Aug 27, 2007, at 06:12, DI BACCO ANTONIO - technolabs wrote:
> Hi,
>
> I have an hot pluggable MDIO bus (connected to MDC, MDIO of an
> MPC880) and thus I would like to rescan the bus on certain events
> (for example fs_enet_open) to access the numerous PHYs I have on
> this bus. I saw that it is "simply" a matter of calling
> mdiobus_register but I would like an advice how to design the
> modification
There are a few problems, here:
1) Do you expect only to add/remove PHYs, or to completely swap out
the entire set?
2) If you bring up one interface, swap out the PHYs, and then bring
up a second interface, the first one will be broken
I think the best solution is to add the capability for the PHY Lib to
tell attached ethernet controllers that the PHY has been disconnected/
deallocated. Perhaps protected by a CONFIG_ option.
Then you would add support for taking down a PHY, and probably the
whole bus, on the fly. This would require making sure that all
outstanding transactions are done, and may be as simple as invoking
mdiobus_unregister. The tricky part is that we really need to have
some way to tell the ethernet controllers that were up that the new
bus is there. If we're really fancy, the PHY Lib could even hook
those controllers up automatically, but it may be necessary for the
drivers to change which address they connect to.
Andy
More information about the Linuxppc-embedded
mailing list