Re: [PATCH] MII bus API for PHY devices
From: Benjamin Herrenschmidt
Date: Thu Nov 18 2004 - 18:36:21 EST
On Thu, 2004-11-18 at 11:52 -0600, Andy Fleming wrote:
> 1) How should we pass initialization information from the system to the
> bus. Information like which irq to use for each PHY, and what the
> address space for the bus's controls is. I would like to enforce
> encapsulation so that the ethernet drivers don't need to know this
> information, or pass it to the bus.
Unfortunately, this is all quite platform specific and the ethernet
driver may be the only one to know what to do here... add to that
various special cases of the way the PHY is wired or controlled, I think
we can't completely avoid special casing...
> 2) How should we reflect the dependency of the ethernet driver on the
> mii bus driver?
The ethernet driver can instanciate the PHYs at it's childs, though the
case of several MACs sharing PHYs will be difficult to represent...
> 3) How should we bind ethernet drivers to PHY drivers?
I would have them instanciated by the ethernet driver. Besides, the PHY
driver will need to be able to identify it's "parent" driver in some
ways to deal with special cases. It would be nice to have a library of
utility code to independently deal with link tracking (basically what
drivers like sungem do independently), with a callback to the ethernet
driver to inform it of actual changes (notifier ?). MACs often have
autopoll features and PHY often have interrupts, but from experience,
that's not very useful and a good old timer based polling tend to do a
better job most of the time.
> Oh, and a 4th side-issue:
> Should each PHY have its own file? Or should we dump all the PHY
> drivers in one file? And if so, should THAT file be separate from the
> mii bus implementation file?
I'd put all bcm5xxx in the same file ... they can be put together by
families...
Also,
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/