From: Alex Date: Thu, 27 Jul 2017 08:27:15 -0700 Subject: [U-Boot] [PATCH 2/5] net: phy: micrel: Separate KSZ9000 drivers from KSZ8000 drivers In-Reply-To: <20170707204602.GO22707@bill-the-cat> References: <20170707183703.2190-1-alex.g@adaptrum.com> <20170707183703.2190-2-alex.g@adaptrum.com> <0ddf3f4b-0922-c751-21e1-addbe34831e2@denx.de> <20170707204602.GO22707@bill-the-cat> Message-ID: <23c3135a-8a62-1077-c24c-08233d0552e7@adaptrum.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 07/07/2017 01:46 PM, Tom Rini wrote: > On Fri, Jul 07, 2017 at 10:13:09PM +0200, Marek Vasut wrote: >> On 07/07/2017 08:36 PM, Alexandru Gagniuc wrote: >>> The KS8721BL and KSZ9021 PHYs are software-incompatible, yet they >>> share the same ID. Drivers for bothe PHYs cannot safely coexist, so >>> the solution was to use #ifdefs to select between the two drivers. >>> >>> As a result KSZ9031, which has a unique ID, is now caught in the >>> crossfire. Unless CONFIG_PHY_MICREL_KSZ9031 is defined, the KSZ9031 >>> will not function properly, as some essential configuration code is >>> ifdef'd-out. >>> >>> To prevent such situations, move the KSZ9000 drivers to a separate >>> file, and place them under a separate Kconfig option. While it is >>> possible to enable both KSZ8000 and KSZ9000 drivers at the same time, >>> the assumption is that it is highly unlikely for a system to contain >>> both a KSZ8000 and a KSZ9000 PHY, and that only one of the drivers >>> will be enabled at any given time. >>> >>> Signed-off-by: Alexandru Gagniuc >> >> The solution would be to either specify the PHY type in DT or platform >> data. This shuffling of ifdefs is IMO pointless. > > That sounds like a good long term solution since we can't do things like > that until phylib is DMified. Don't forget about the simplicity of being able to probe the PHY. AFAICT, it's only micrel that messed things up this way. Alex