From: Wolfgang Grandegger <wg@grandegger.com>
To: Florian Fainelli <florian@openwrt.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>,
netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
shawn.guo@linaro.org, davem@davemloft.net
Subject: Re: [PATCH] net: fec: Add support for multiple phys on mdiobus
Date: Tue, 22 Jan 2013 16:03:04 +0100 [thread overview]
Message-ID: <50FEAA28.1070003@grandegger.com> (raw)
In-Reply-To: <50FEA691.4050904@openwrt.org>
On 01/22/2013 03:47 PM, Florian Fainelli wrote:
> On 01/22/2013 08:22 AM, Wolfgang Grandegger wrote:
>>> Well this could be done when the fixed phy driver could be registered
>>> with the devicetree, maybe like this:
>>>
>>> fixed-phy: mdiophy {
>>> compatible = "mdio-fixed-phy";
>>> link = "100FD";
>>> };
>>
>> I find that confusing. There is *no* phy but just a fixed link to the
>> switch...
>>
>>> The good thing about this would be that every ethernet driver could just
>>> use such a fixed phy, any external mdio phy (like on Marvell Armada) or
>>> just a phy connected to the internal mdio interface provided by the
>>> ethernet
>>> core.
>>
>> What is wrong with the existing "fixed-link" property of the *ethernet*
>> node. The fixed-link handling should/could be done in the phy layer, and
>> not in the driver as it currently is implemented. Maybe that's the
>> reason why the current code is regarded as hack!
>
> As far as I have used it with the CPMAC driver, the fixed PHY is a
> specific PHY device and there is no specific handling to be done by the
> Ethernet MAC driver but eventually changing its MII bus id so that it is
> named "fixed-0" to allow the fixed PHY driver to bind. Put differently,
There is special handling for the fixed link, e.g. here:
http://lxr.linux.no/#linux+v3.7.4/drivers/net/ethernet/freescale/gianfar.c#L1462
This could be hidden in the PHY layer allowing all ethernet drivers
using the "fixed-link" property.
> using the fixed PHY driver is a kind of "last" resort thing to cope with
> situations like:
>
> - switch not providing a consistent PHY-like interface on the MDC/MDIO bus
> - switches not connected to the MDC/MDIO bus of the Ethernet MAC they
> forward to
>
> What exactly do you mean by "as it currently is implemented"? that you
> do not like?
As Sascha pointed out, the implementation is labeled as "hack", which
should be fixed sooner than later. It's just not clear why ;).
Wolfgang.
next prev parent reply other threads:[~2013-01-22 15:03 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-21 8:37 [PATCH] net: fec: Add support for multiple phys on mdiobus Sascha Hauer
2013-01-21 8:37 ` [PATCH 1/2] net: fec: refactor dt probing Sascha Hauer
2013-01-21 17:48 ` Baruch Siach
2013-01-21 18:27 ` Sascha Hauer
2013-01-21 8:37 ` [PATCH 2/2] net: fec: Add support for phys from devicetree Sascha Hauer
2013-01-21 8:56 ` [PATCH] net: fec: Add support for multiple phys on mdiobus Wolfgang Grandegger
2013-01-21 10:07 ` Sascha Hauer
2013-01-21 11:07 ` Wolfgang Grandegger
2013-01-21 11:12 ` Florian Fainelli
2013-01-21 11:33 ` Wolfgang Grandegger
2013-01-21 11:56 ` Sascha Hauer
2013-01-21 12:06 ` Sascha Hauer
2013-01-22 7:22 ` Wolfgang Grandegger
2013-01-22 14:47 ` Florian Fainelli
2013-01-22 15:03 ` Wolfgang Grandegger [this message]
2013-01-22 15:19 ` Florian Fainelli
2013-01-22 15:26 ` Wolfgang Grandegger
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=50FEAA28.1070003@grandegger.com \
--to=wg@grandegger.com \
--cc=davem@davemloft.net \
--cc=florian@openwrt.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=netdev@vger.kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawn.guo@linaro.org \
/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).