From: u.kleine-koenig@pengutronix.de (Uwe Kleine-König)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC] Reset pins of phys and their representation in a device tree
Date: Thu, 12 May 2016 09:15:42 +0200 [thread overview]
Message-ID: <20160512071542.GC30822@pengutronix.de> (raw)
Hello,
I have a machine here where the reset pin of the phy is connected to a
GPIO.
There are different possibilities available today to handle this
situation, here are the ones I'm aware of:
- Use a gpio-hog to set the reset gpio to non-active
This might result in dependency problems (and that's what I am
currently faced with) because there is no connection in the device
tree between the hog and the phy.
- [Documentation/devicetree/bindings/net/fsl-fec.txt]
The fec node supports properties
phy-reset-gpios = <&gpio2 14 0>;
phy-reset-duration = <200> /* milliseconds */;
Something similar exists in TI's vendor kernel
(http://git.ti.com/ti-linux-kernel/ti-linux-kernel/commit/17d192b999ee904ced223c16cef76111a51c461b)
with different (and IMHO bader) naming.
This is the wrong place to specify the gpios; they shouldn't be in the
mac's node, but in a phy node instead.
So what I actually want is to put the gpio specification in the right
place and let it look as follows:
mymdiobus {
[...]
myfirstphy: ethernet-phy at 0 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <0>;
reset-gpios = <&gpio2 14 0>;
reset-duration-ms = <200>;
};
mysecondphy: ethernet-phy at 2 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <2>;
reset-gpios = <&gpio3 10 0>;
reset-duration-ms = <200>;
};
};
And with this we could defer probe of &myfirstphy if &gpio2 isn't
available yet.
Does this sound sensible? Does something like that already exist which I
missed? Any further ideas/comments?
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |
next reply other threads:[~2016-05-12 7:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-12 7:15 Uwe Kleine-König [this message]
2016-05-12 12:25 ` [RFC] Reset pins of phys and their representation in a device tree Sergei Shtylyov
2016-05-12 13:40 ` Javier Martinez Canillas
2016-05-12 13:49 ` Chen-Yu Tsai
2016-05-12 14:06 ` Javier Martinez Canillas
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=20160512071542.GC30822@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.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).