netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <florian@openwrt.org>
To: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Grant Likely <grant.likely@secretlab.ca>,
	Rob Herring <rob.herring@calxeda.com>,
	"David S. Miller" <davem@davemloft.net>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	netdev <netdev@vger.kernel.org>,
	devicetree-discuss <devicetree-discuss@lists.ozlabs.org>,
	Lior Amsalem <alior@marvell.com>,
	Gregory Clement <gregory.clement@free-electrons.com>,
	Ezequiel Garcia <ezequiel.garcia@free-electrons.com>,
	Mark Rutland <mark.rutland@arm.com>
Subject: Re: [RFC PATCH 1/3] of: provide a binding for the 'fixed-link' property
Date: Tue, 30 Jul 2013 12:43:22 +0100	[thread overview]
Message-ID: <CAGVrzcZWHXfQP0=HASSybfLRzKJqmS5t_Y+H0se+VU5oHDWhCA@mail.gmail.com> (raw)
In-Reply-To: <20130730132318.0270fc4b@skate>

2013/7/30 Thomas Petazzoni <thomas.petazzoni@free-electrons.com>:
> Dear Florian Fainelli,
>
> On Tue, 30 Jul 2013 11:05:04 +0100, Florian Fainelli wrote:
>
>> > In fact, this value is used for two things:
>> >
>> >  * As the PHY address on the fake "fixed" MDIO bus.
>> >
>> >  * As the PHY identifier, as reported by the MII registers PHYS_ID1
>> >    (0x2) and PHYS_ID2 (0x3).
>>
>> Right, so I would start with disambiguating the two and just forget
>> about PHYS_ID1 and PHYS_ID2 for the moment since they probably do not
>> need to be per-PHY configurable.
>
> Agreed.
>
>> > I think this doesn't make sense, because the two things are completely
>> > unrelated. Ideally, we'd like the PHY identifier for fixed PHYs to be
>> > something fixed, identical for all fixed PHYs. The problem is finding
>> > an OUI and device number that is available for that, but maybe we can
>> > ask the OpenMoko people to allocate one (see
>> > http://wiki.openmoko.org/wiki/OUI).
>>
>> Well that would be ideal indeed, but I am wondering if we cannot just
>> go with some kind of magic value here anyway, regardless of
>> allocations since this is not a real hardware device.
>
> Well, isn't that exactly what I'm proposing? Have a fixed value for
> PHYS_ID1 and PHYS_ID2, that is used for /all/ fixed PHYs.
>
>> How about the Linux Foundation?
>
> I am concerned about the time it would take to get a new OUI
> attributed. The OpenMoko OUI is said to be open for free and open
> source projects, I think the Linux kernel qualifies :)
>
>> Is not that the same problem as with gadget USB
>> devices which should have some sort of real MAC address for instance?
>
> They are either provided by the user or generated randomly, as far as I
> can see.
>
>> > Then, the PHY address could be generated dynamically. This would
>> > require:
>> >
>> >  * Adding a fixed_phy_create() function that internally uses
>> >    fixed_phy_add(), but before that creates an unique PHY address for
>> >    this newly created PHY. Those unique addresses will be generated by
>> >    incrementing a global number of fixed PHYs, up to PHY_MAX_ADDR,
>> >    which is the maximum number of fixed PHYs that can anyway be
>> >    registered on the fixed MDIO bus.
>>
>> Even though these are purely software PHY implementations, I believe
>> that some sort of predictability would be welcome, so I would just use
>> the phy_id argument passed to fixed_phy_add() as the address on the
>> fixed MDIO bus like it is today.
>
> Well, the whole starting point of this discussion is precisely that
> both Grant and Mark disliked this phy ID that had to be globally
> unique, and they wanted it to be dynamically allocated by the kernel,
> because the DT shouldn't have to care about such internal details.

Ok, well, thinking about this some more, we do not need to be able to
specify the fixed PHY fake MDIO address in the binding anyway. My
concern was first with how to ensure that this would be relatively
stable from an Ethernet driver and user-space perspective, but this
will be stable if we allocate unique IDs in say, parsing/probing order
anyway.

>
>> > Grant, Mark, Florian, do you have other proposals?
>>
>> To sum up, let's just forget about the misuse of phy_id to fill in
>> PHYS_ID1 and PHYS_ID2 registers and keep the existing code with a
>> clear note that phy_id means the "PHY address on the fixed MDIO bus".
>
> Except that Grant and Mark point was precisely that the "PHY address on
> the fake MDIO bus" is not a description of the hardware, and therefore
> shouldn't be mentioned in the Device Tree but instead taken care of by
> the kernel itself.

Right, that works for me now.
--
Florian

  reply	other threads:[~2013-07-30 11:44 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-15 15:34 [RFC PATCH 0/3] Add DT support for fixed PHYs Thomas Petazzoni
2013-07-15 15:34 ` [RFC PATCH 1/3] of: provide a binding for the 'fixed-link' property Thomas Petazzoni
2013-07-15 15:50   ` Florian Fainelli
2013-07-23 11:22   ` Mark Rutland
2013-07-23 11:39     ` Florian Fainelli
2013-07-30  9:16     ` Thomas Petazzoni
2013-07-30 10:26       ` Florian Fainelli
2013-07-30 15:28       ` Mark Rutland
2013-07-23 11:39   ` Grant Likely
2013-07-30  9:07     ` Thomas Petazzoni
2013-07-30 10:05       ` Florian Fainelli
2013-07-30 11:23         ` Thomas Petazzoni
2013-07-30 11:43           ` Florian Fainelli [this message]
2013-07-30 15:31       ` Mark Rutland
2013-08-12  6:38   ` Sascha Hauer
2013-08-12  8:16     ` Thomas Petazzoni
2013-08-12  8:37       ` Sascha Hauer
2013-08-21 10:55         ` Christian Gmeiner
2013-08-21 11:25           ` Florian Fainelli
2013-08-21 11:46         ` Florian Fainelli
2013-07-15 15:34 ` [RFC PATCH 2/3] net: phy: call mdiobus_scan() after adding a fixed PHY Thomas Petazzoni
2013-07-15 15:46   ` Florian Fainelli
2013-07-15 15:34 ` [RFC PATCH 3/3] net: mvneta: add support for fixed links Thomas Petazzoni

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='CAGVrzcZWHXfQP0=HASSybfLRzKJqmS5t_Y+H0se+VU5oHDWhCA@mail.gmail.com' \
    --to=florian@openwrt.org \
    --cc=alior@marvell.com \
    --cc=davem@davemloft.net \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=ezequiel.garcia@free-electrons.com \
    --cc=grant.likely@secretlab.ca \
    --cc=gregory.clement@free-electrons.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=netdev@vger.kernel.org \
    --cc=rob.herring@calxeda.com \
    --cc=thomas.petazzoni@free-electrons.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).