netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: Andy Fleming <afleming@freescale.com>
Cc: John Linn <John.Linn@xilinx.com>,
	devicetree-discuss <devicetree-discuss@lists.ozlabs.org>,
	netdev <netdev@vger.kernel.org>,
	Scott Wood <scottwood@freescale.com>
Subject: Re: phy address in the device tree, vs auto probing
Date: Wed, 10 Feb 2010 12:57:07 -0700	[thread overview]
Message-ID: <fa686aa41002101157g7c0c4134m5218d5aeacce08b1@mail.gmail.com> (raw)
In-Reply-To: <99A0D59F-3DAA-4ACD-899B-7D139E286D6D@freescale.com>

On Wed, Feb 10, 2010 at 12:46 PM, Andy Fleming <afleming@freescale.com> wrote:
>
> On Feb 10, 2010, at 1:20 PM, Grant Likely wrote:
>
>> On Wed, Feb 10, 2010 at 11:40 AM, Fleming Andy-AFLEMING
>> <afleming@freescale.com> wrote:
>>> I don't think it's necessary that only one phy node is there.  I don't think
>>> the of mdio layer should set policy, here.  Some drivers hard code their
>>> addresses.  Some drivers assume (foolishly, I think) that the PHYs are in
>>> order.  Many assume there's only one PHY.  I think the mdio driver should
>>> set policy, so of_mdio should just allow for PHYs to be probed.  I'm
>>> actually not sure that requires any changes.  Quite possibly this just means
>>> that of_mdio is not appropriate for such a driver.   The standard PHY code
>>> supports this sort of thing.
>>
>> That still doesn't solve the problem of matching PHYs to MACs.
>>
>> Consider this example:  2 MACs, 2 PHYs.  mac_a--> phy_a and mac_b -->
>> phy_b.  Both phys on the same mdio bus, described thus:
>>
>>               eth_a: ethernet@81000000 {
>>                       #address-cells = <1>;
>>                       #size-cells = <1>;
>>                       phy-handle = <&phy_a>;
>>                       mdio {
>>                               #address-cells = <1>;
>>                               #size-cells = <0>;
>>                               phy_a: phy_a {
>>                               } ;
>>                               phy_b: phy_b {
>>                               } ;
>>                       } ;
>>               } ;
>>               eth_b: ethernet@82000000 {
>>                       #address-cells = <1>;
>>                       #size-cells = <1>;
>>                       phy-handle = <&phy_b>;
>>               } ;
>>
>> In this example, the kernel knows it has two phys, and probing
>> confirms this (say at phy addresses 3 and 7).  How does the kernel
>> know which address phy_a responds to?
>
>
> There's no way to know.

Which is why I'm saying that when the phy address is unknown, the
binding should only allow for a single phy node.  We're talking about
how to accurately describe the platform, not how the implementation
should work.  The mdio/of_mdio changes are Linux kernel implementation
details.

>  That's what I'm saying.  We shouldn't modify the of_mdio code to say which PHY is which.  Instead, we have the MDIO/ethernet code do that.  And maybe this means that they can't use of_mdio.  Or maybe we need to devise a scheme so you can specify those PHYs, but delay associating them with an address until later.

Same problem.  even if phys are probed, the kernel doesn't know which
MAC to attach each to.  If the solution is to hard coded it into the
driver, then that is a different problem scenario than John is trying
to solve.

g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

      reply	other threads:[~2010-02-10 19:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Acqp3tpO+gBYUakZQ7SaeBzVIkh6WA==>
     [not found] ` <4dfe033d-c308-45e0-9c7e-9fc60c6cad8f@SG2EHSMHS013.ehs.local>
     [not found]   ` <4dfe033d-c308-45e0-9c7e-9fc60c6cad8f-RaUQJvECHivT7m58JnLnSLjjLBE8jN/0@public.gmane.org>
2010-02-10 16:43     ` phy address in the device tree, vs auto probing Grant Likely
2010-02-10 16:52       ` John Linn
2010-02-10 18:14         ` Grant Likely
     [not found]           ` <fa686aa41002101014s43682e3cra55854b82a40bb5f-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-02-10 18:28             ` Scott Wood
     [not found]               ` <4B72FAB2.5000804-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2010-02-10 18:37                 ` M. Warner Losh
2010-02-10 19:12                   ` Grant Likely
2010-02-10 19:24                     ` Mark Brown
2010-02-10 18:30           ` Mitch Bradley
     [not found]             ` <4B72FB38.7080909-D5eQfiDGL7eakBO8gow8eQ@public.gmane.org>
2010-02-10 18:35               ` Mitch Bradley
2010-02-10 18:40           ` Fleming Andy-AFLEMING
2010-02-10 19:20             ` Grant Likely
2010-02-10 19:46               ` Andy Fleming
2010-02-10 19:57                 ` Grant Likely [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fa686aa41002101157g7c0c4134m5218d5aeacce08b1@mail.gmail.com \
    --to=grant.likely@secretlab.ca \
    --cc=John.Linn@xilinx.com \
    --cc=afleming@freescale.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=netdev@vger.kernel.org \
    --cc=scottwood@freescale.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).