From: Sergei Shtylyov <sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
To: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
pawel.moll-5wv7dgnIgG8@public.gmane.org,
mark.rutland-5wv7dgnIgG8@public.gmane.org,
ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org,
galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH RFT 1/2] phylib: add device reset GPIO support
Date: Mon, 11 Apr 2016 22:28:15 +0300 [thread overview]
Message-ID: <570BFACF.30507@cogentembedded.com> (raw)
In-Reply-To: <20160411192521.GA6896@rob-hp-laptop>
On 04/11/2016 10:25 PM, Rob Herring wrote:
>> The PHY devices sometimes do have their reset signal (maybe even power
>> supply?) tied to some GPIO and sometimes it also does happen that a boot
>> loader does not leave it deasserted. So far this issue has been attacked
>> from (as I believe) a wrong angle: by teaching the MAC driver to manipulate
>> the GPIO in question; that solution, when applied to the device trees,
>> led to adding the PHY reset GPIO properties to the MAC device node, with
>> one exception: Cadence MACB driver which could handle the "reset-gpios"
>> prop in a PHY device subnode. I believe that the correct approach is to
>> teach the 'phylib' to get the MDIO device reset GPIO from the device tree
>> node corresponding to this device -- which this patch is doing...
>>
>> Note that I had to modify the AT803x PHY driver as it would stop working
>> otherwise as it made use of the reset GPIO for its own purposes...
>
> Lots of double spaces in here. Please fix.
Oh, it's you again! :-D
>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
>>
>> ---
>> Documentation/devicetree/bindings/net/phy.txt | 2 +
>> drivers/net/phy/at803x.c | 19 ++------------
>> drivers/net/phy/mdio_bus.c | 4 +++
>> drivers/net/phy/mdio_device.c | 27 +++++++++++++++++++--
>> drivers/net/phy/phy_device.c | 33 ++++++++++++++++++++++++--
>> drivers/of/of_mdio.c | 16 ++++++++++++
>> include/linux/mdio.h | 3 ++
>> include/linux/phy.h | 5 +++
>> 8 files changed, 89 insertions(+), 20 deletions(-)
>
> [...]
>
>> Index: net-next/drivers/of/of_mdio.c
>> ===================================================================
>> --- net-next.orig/drivers/of/of_mdio.c
>> +++ net-next/drivers/of/of_mdio.c
>> @@ -44,6 +44,7 @@ static int of_get_phy_id(struct device_n
>> static int of_mdiobus_register_phy(struct mii_bus *mdio, struct device_node *child,
>> u32 addr)
>> {
>> + struct gpio_desc *gpiod;
>> struct phy_device *phy;
>> bool is_c45;
>> int rc;
>> @@ -52,10 +53,17 @@ static int of_mdiobus_register_phy(struc
>> is_c45 = of_device_is_compatible(child,
>> "ethernet-phy-ieee802.3-c45");
>>
>> + gpiod = fwnode_get_named_gpiod(&child->fwnode, "reset-gpios");
>
> Calling fwnode_* functions in a DT specific file/function? That doesn't
> make sense.
Really?! 8-)
Where is a DT-only analog I wonder...
MBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2016-04-11 19:28 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-08 22:21 [PATCH RFT 0/2] Teach phylib hard-resetting devices Sergei Shtylyov
2016-04-08 22:22 ` [PATCH RFT 1/2] phylib: add device reset GPIO support Sergei Shtylyov
2016-04-11 19:25 ` Rob Herring
2016-04-11 19:28 ` Sergei Shtylyov [this message]
2016-04-11 22:46 ` Rob Herring
[not found] ` <2811962.eGX2i5RJbZ@wasted.cogentembedded.com>
[not found] ` <20160411022802.GB4307@lunn.ch>
[not found] ` <570BE1C5.70502@cogentembedded.com>
[not found] ` <20160411181904.GB29709@lunn.ch>
2016-04-11 18:39 ` [PATCH RFT 2/2] macb: kill PHY reset code Sergei Shtylyov
[not found] ` <570BEF46.7060105-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2016-04-11 18:51 ` Andrew Lunn
[not found] ` <20160411185115.GA30623-g2DYL2Zd6BY@public.gmane.org>
2016-04-11 19:01 ` Sergei Shtylyov
2016-04-12 9:23 ` Nicolas Ferre
2016-04-28 22:12 ` [PATCH RFT 1/2] phylib: add device reset GPIO support Sergei Shtylyov
2016-05-03 17:03 ` Rob Herring
2016-05-10 18:32 ` Florian Fainelli
[not found] ` <5732294F.3060606-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-05-10 19:11 ` Sergei Shtylyov
[not found] ` <5732327A.6080203-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2016-05-10 19:13 ` Florian Fainelli
[not found] ` <3641492.klKRrvS8tr-gHKXc3Y1Z8zGSmamagVegGFoWSdPRAKMAL8bYrjMMd8@public.gmane.org>
2016-05-12 18:42 ` Uwe Kleine-König
2016-05-12 21:35 ` Sergei Shtylyov
2016-05-13 4:06 ` Andrew Lunn
2016-05-13 21:16 ` Sergei Shtylyov
2016-05-13 7:06 ` Uwe Kleine-König
2016-05-13 21:49 ` Sergei Shtylyov
2016-05-13 19:18 ` Sergei Shtylyov
2016-05-14 21:14 ` Sergei Shtylyov
2016-05-13 9:07 ` Roger Quadros
2016-05-13 19:36 ` Sergei Shtylyov
2016-05-13 20:44 ` Andrew Lunn
2016-05-13 20:56 ` Sergei Shtylyov
2016-05-13 23:44 ` Andrew Lunn
2016-05-14 19:36 ` Sergei Shtylyov
2016-05-14 19:50 ` Andrew Lunn
2016-05-14 21:46 ` Sergei Shtylyov
[not found] ` <34922ff9-e566-4829-a631-54ce07cbb325-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2016-05-15 15:23 ` Andrew Lunn
[not found] ` <20160515152339.GA9021-g2DYL2Zd6BY@public.gmane.org>
2016-05-19 13:40 ` Sergei Shtylyov
2016-05-16 8:51 ` Roger Quadros
2016-05-26 9:00 ` Linus Walleij
2016-05-26 19:00 ` Uwe Kleine-König
2016-05-30 14:57 ` Linus Walleij
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=570BFACF.30507@cogentembedded.com \
--to=sergei.shtylyov-m4dtvfq/zs1mrggop+s0pdbpr1lh4cv8@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
--cc=robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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).