From mboxrd@z Thu Jan 1 00:00:00 1970 From: Troy Kisky Date: Wed, 22 Aug 2012 12:59:32 -0700 Subject: [U-Boot] [PATCH V1 1/3] phy: add phy_connect_by_mask In-Reply-To: References: <1345502918-18305-1-git-send-email-troy.kisky@boundarydevices.com> <5032C349.3090507@boundarydevices.com> Message-ID: <50353A24.8030601@boundarydevices.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 8/20/2012 5:35 PM, Andy Fleming wrote: > > > On Monday, August 20, 2012, Troy Kisky wrote: > > It is useful to be able to try a range of > possible phy addresses to connect. > > > > This seems like it just encourages a bad habit. Which is? > How do you envision this working on a system with multiple Ethernet > controllers? Or with more PHYs than Ethernet controllers? The same way it works currently. I removed no features. > While it is often the case that the PHY is the only one on a bus, I > think it's a bad idea to codify that notion in the driver (I know, it > was already like that). So, should I fix something before this patch? > > It's best if the driver make the reasonable assumption that its PHY > address is known when it comes up, and let the board code, which can > be aware that the PHY may exist in varying locations, search for the PHY. I agree. That's why I put #define CONFIG_FEC_MXC_PHYMASK (0xf << 4) /* scan phy 4,5,6,7 */ in the boards config file. > With that approach, the driver won't have to change when some board > designer makes the PHY topology even stranger, and I would support a > PHYLIB function to do searching much as you've specified. But the > board-specific code needs to be able to tell the driver definitively > which PHY belongs to it. Please, will either you or Joe (or both!!!,) provide more specific directions as I am currently floundering. Thanks Troy