Received: by 10.213.65.68 with SMTP id h4csp1263039imn; Sat, 24 Mar 2018 07:50:49 -0700 (PDT) X-Google-Smtp-Source: AG47ELuMuBtm4Vyj1q55cmpU+70zsgNbKlpmnLMNNTf9fPk3YvenKQ8AsJsxPnIieepikjYiBoeH X-Received: by 10.101.77.13 with SMTP id i13mr24162941pgt.70.1521903049373; Sat, 24 Mar 2018 07:50:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521903049; cv=none; d=google.com; s=arc-20160816; b=r8shgMLj5vpqK4qzDqxAeWuTuKTpqN7zpDtwduq5Bny3OiXFSslw+MPZIL2xX6jJk0 1c/5azrE6opi9HtPU3aGsofXdV0vidnXdH2e4nnPDP7k1UqCg3oPetl1mc7Ubrq29cqe flrhtBiCDQy1Foll7E5V2HcJuWD9vpd5h7A/hYKJrqi270FRWouQmw8VmiuTWbUohQp8 RftUT3QGDAX+oHkRPq7UEU7cha7mpOoHxJEKIVJ4jJMF2dzFFE6zsYW8+lKxck0f0X6u zhEUMFaWyzyYm/KTtWyNTmY5hdOlf9gFbuICu9bwAcrgQgfK/jA6phWYt3TDtsq9b0Dy IBXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=ASoT6wZsk6Ivdnog0/gDRYxCe4A3zxbiGBnBEmXEWq8=; b=qYrF8Wj/vBED9wNVg41Gf7C5YYc5xEAmP6zGfpoTdCfQXax8sXZRojeQj4D3T35DZy TmI1pwj9fkvZglqE6Smzf5Ez2SXQjw2QLDZ9DR7bg7cErAZIwqROivdzQGF5qeiwO+VC hMaQlOOQ9PERz+agm0YNqstc4TnWJGTPK71mkJOsZcn9zDe8VPM/oSxiByz24aRUXQSe ICEGlYL+K9ZwRMR3VbcEMkKWT5trFA1r4JpJMgZ5J7NnnRtuuBfjy1vbhcHKXHPqzW8z 9EZtFYAcUB+k6mzAFUYdeLN3MFWQ8if0+B8l39O8N0JVCrTdqyXVMOvPBhCdhNcgrCAt jAqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=qYe/AQ4Y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n11-v6si10689399plp.197.2018.03.24.07.50.21; Sat, 24 Mar 2018 07:50:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=qYe/AQ4Y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752236AbeCXOs6 (ORCPT + 99 others); Sat, 24 Mar 2018 10:48:58 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:41057 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751891AbeCXOs5 (ORCPT ); Sat, 24 Mar 2018 10:48:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=ASoT6wZsk6Ivdnog0/gDRYxCe4A3zxbiGBnBEmXEWq8=; b=qYe/AQ4Y9htXyJOc8e5SENx3q/tP9BSEPzOP2N9Uj+gUSR6HQvbTUl4UxeJ+4qHedfqFHEhKsTcQ945E2RluL2DlgUvqMktns+xs4EO59JT4xhsF+zr42XTXJCIXnMhils7AzgZA9vqrS7c3ba2LnkEirlrsW9UclEEhy+0v5Ow=; Received: from andrew by vps0.lunn.ch with local (Exim 4.84_2) (envelope-from ) id 1ezkTS-0008Sh-C4; Sat, 24 Mar 2018 15:48:50 +0100 Date: Sat, 24 Mar 2018 15:48:50 +0100 From: Andrew Lunn To: Florian Fainelli Cc: Alexandre Belloni , "David S . Miller" , Allan Nielsen , razvan.stefanescu@nxp.com, po.liu@nxp.com, Thomas Petazzoni , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@linux-mips.org, James Hogan Subject: Re: [PATCH net-next 6/8] MIPS: mscc: Add switch to ocelot Message-ID: <20180324144850.GB31941@lunn.ch> References: <20180323201117.8416-1-alexandre.belloni@bootlin.com> <20180323201117.8416-7-alexandre.belloni@bootlin.com> <20180323212230.GA12808@piout.net> <20180323213344.GV24361@lunn.ch> <20180323220657.GY24361@lunn.ch> <171fb3db-70f4-4818-9390-8164fab5adca@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <171fb3db-70f4-4818-9390-8164fab5adca@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 23, 2018 at 03:11:23PM -0700, Florian Fainelli wrote: > On 03/23/2018 03:06 PM, Andrew Lunn wrote: > >>> That is the trade off of having a standalone MDIO bus driver. Maybe > >>> add a phandle to the internal MDIO bus? The switch driver could then > >>> follow the phandle, and direct connect the internal PHYs? > >> > >> This is more or less what patch 7 does, right? > > > > Patch 7 does it in DT. I'm suggesting it could be done in C. It is > > hard wired, so there is no need to describe it in DT. Use the phandle > > to get the mdio bus, mdiobus_get_phy(, port) to get the phydev and > > then use phy_connect(). > > That does not sound like a great idea. And to go back to your example > about DSA, it is partially true, you will see some switch bindings > defining the internal PHYs (e.g: qca8k), and most not doing it (b53, > mv88e6xxx, etc.). In either case, this resolves to the same thing > though. Being able to parse a phy-handle property is a lot more > flexible, and if it does matter that the PHY truly is internal, then the > 'phy-mode' property can help reflect that. Hi Florian With DSA, you can always provide a phy-handle. It is only when there is nothing specified that the fallback case is used to map internal PHYs to ports. Putting internal PHYs in DT is fine, but it is a nice simplification if it is not needed. Andrew