From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Fleming Date: Thu, 22 Sep 2011 18:30:44 -0500 Subject: [U-Boot] Question: Information regarding MII and PHY In-Reply-To: References: Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, Sep 21, 2011 at 8:20 PM, Graeme Russ 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_ 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