[U-Boot] Question: Information regarding MII and PHY

Andy Fleming afleming at gmail.com
Fri Sep 23 01:30:44 CEST 2011


On Wed, Sep 21, 2011 at 8:20 PM, Graeme Russ <graeme.russ at gmail.com> wrote:
> Hi All,
>
> I'm looking at adding a new Gigabit Ethernet driver (Realtek
> RTL8211CL) to U-Boot. The datasheet, in addition to register
> descriptions, mentions MII/GMII and PHY support (but not much on the
> specifics). Now in U-Boot there appears to be a common set of code
> relating to PHY and MII. There appears to be a mix of Ethernet drivers
> that use MII/PHY and drivers that do not, but I cannot seems to quite
> get me head around it all. One weird thing is that there does not
> appear to be any granular inclusion of PHY drivers -
> /include/config_phylib_all_drivers.h defines them all when
> CONFIG_PHYLIB is defined, but I could not find any boards that defined
> just one PHY driver. I also cannot find how MII/PHY functions interact
> with PCI for PCI based cards.

config_phylib_all_drivers gets included by the PowerPC config header,
only if CONFIG_TSEC_ENET is defined. We did that because the TSEC
driver operated on many platforms already, and almost all of the
drivers added by the initial patches were taken from the tsec driver.
Rather than go through the platforms, one by one, and add the PHY
CONFIG option to them, we made the TSEC automatically enable them all.
And that's only if PHYLIB *isn't* defined.

Interestingly, you seem to be right about noone configuring any of the
individual PHYs. Or even PHYLIB. I'm guessing that code is all sitting
in various custodial trees, waiting to be pulled.

Anyway, it's very simple. Add this to the config file of your board:

#define CONFIG_PHYLIB
#define CONFIG_PHY_<FOO>

It's best not to overthink the connection between MII and PHY.
Sometimes the term "mii" is used ...vaguely. The term MDIO is better,
but also has overtones of the 10G-specific management interface.

Andy


More information about the U-Boot mailing list