From: Anton Vorontsov <avorontsov@ru.mvista.com>
To: Peter Tyser <ptyser@xes-inc.com>
Cc: linuxppc-dev@ozlabs.org, devicetree-discuss@lists.ozlabs.org
Subject: Re: [PATCH] powerpc: mpc8xxx_gpio: Add ability to mask off unused GPIO pins
Date: Tue, 8 Dec 2009 05:16:38 +0300 [thread overview]
Message-ID: <20091208021638.GA16115@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <1260202998.23828.13344.camel@localhost.localdomain>
On Mon, Dec 07, 2009 at 10:23:18AM -0600, Peter Tyser wrote:
[...]
> > Yes, badly designed hardware deserves ugly hacks in the platform
> > code. ;-) So for this problem, just request these gpios in the
> > platform code.
>
> I'd wager lots of boards have GPIO pins that a user shouldn't play
> around with once Linux boots up. Like GPIO pins used to program an
> FPGA,
What if I do want to program/upgrade an FPGA, say from the userspace?
[...]
> In any case, my high-level thought process is:
> 1. Currently, the "ngpio" value is wrong for some processors and should
> be fixed.
> 2. Adding a new "fsl,gpio-mask" gpio solves #1, and has the benefit of
> allowing the device tree to easily reserve GPIO pins which should not be
> used in Linux.
OK, if you're so eager to fix this... I'd suggest to not put this
stuff into device tree. We have compatible property that describes
the device.
So, in the driver, you can just do
if (of_device_is_compatible("fsl,foo-gpiochip"))
mask = ...;
else if (of_device_is_compatible("fsl,bar-gpiochip"))
mask = ...;
If you want to solve "dangerous" GPIOs problem, then I'd say
chosen {
linux,dangerous-gpios = <&pio1 0 0 &pio1 1 0
&pio2 4 0 &pio1 5 0>;
};
And then you can have a generic driver that looks for
linux,dangerous-gpios and requests them at boot.
Thanks,
--
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2
prev parent reply other threads:[~2009-12-08 2:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-04 19:43 [PATCH] powerpc: mpc8xxx_gpio: Add ability to mask off unused GPIO pins Peter Tyser
2009-12-05 17:56 ` Anton Vorontsov
2009-12-05 19:32 ` Peter Tyser
2009-12-05 20:51 ` Anton Vorontsov
2009-12-07 16:23 ` Peter Tyser
2009-12-08 2:16 ` Anton Vorontsov [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=20091208021638.GA16115@oksana.dev.rtsoft.ru \
--to=avorontsov@ru.mvista.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=ptyser@xes-inc.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).