From: Eric Anholt <eric@anholt.net>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-rpi-kernel <linux-rpi-kernel@lists.infradead.org>,
"linux-arm-kernel\@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-kernel\@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Stephen Warren <swarren@wwwdotorg.org>,
Lee Jones <lee@kernel.org>,
bcm-kernel-feedback-list <bcm-kernel-feedback-list@broadcom.com>,
Alexandre Courbot <gnurou@gmail.com>,
Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [PATCH 1/3] dt-bindings: Add a binding for the RPi firmware GPIO driver.
Date: Fri, 23 Sep 2016 16:08:45 +0300 [thread overview]
Message-ID: <87ponu931e.fsf@eliezer.anholt.net> (raw)
In-Reply-To: <CACRpkdb-hRjD+FmyZ4SKurp94V=HR3L90OLNc-6eUKuy9AK_Rg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2363 bytes --]
Linus Walleij <linus.walleij@linaro.org> writes:
> On Mon, Sep 19, 2016 at 6:13 PM, Eric Anholt <eric@anholt.net> wrote:
>
>> The RPi firmware exposes all of the board's GPIO lines through
>> property calls. Linux chooses to control most lines directly through
>> the pinctrl driver, but for the FXL6408 GPIO expander on the Pi3, we
>> need to access them through the firmware.
>>
>> Signed-off-by: Eric Anholt <eric@anholt.net>
>
> Aha
>
>> +++ b/Documentation/devicetree/bindings/gpio/gpio-raspberrypi-firmware.txt
>> @@ -0,0 +1,22 @@
>> +Raspberry Pi power domain driver
>
> Really? :)
Thanks.
>> +Required properties:
>> +
>> +- compatible: Should be "raspberrypi,firmware-gpio"
>
> Usually this is vendor,compat, is the vendors name "raspberrypi"?
Yes, this driver is for part of the Raspberry Pi Foundation's firmware
code (you can find the same pattern in the firmware and firmware power
domain drivers).
>> +- gpio-controller: Marks the device node as a gpio controller
>> +- #gpio-cells: Should be <2> for GPIO number and flags
>> +- ngpios: Number of GPIO lines to control. See gpio.txt
>
> Is this ever anything else than 8? Else omit it and hardcode
> 8 in the driver instead.
(see below)
>> +- firmware: Reference to the RPi firmware device node
>
> Reference the DT binding for this.
>
>> +- raspberrypi,firmware-gpio-offset:
>> + Number the firmware uses for the first GPIO line
>> + controlled by this driver
>
> Does this differ between different instances of this hardware or
> can it just be open coded in the driver instead?
This is which range (128-135) of the firmware's GPIOs we're controlling.
If another GPIO expander appears later (quite believable, I think
they're down to 1 spare line on this expander), then we would just make
another node with a new offset and ngpios for that expander.
Sort of related: I also worry that we have races with the firmware for
the platform GPIO bits, since both ARM and firmware are doing RMWs (or,
even worse, maybe just Ws?) of the registers controlled by the pinctrl
driver. Hopefully I can get the firmware to pass control of devices
like this over to Linux, with firmware making requests to us, but I
don't know if that will happen and we may need to access other GPIOs
using this interface :(
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 800 bytes --]
next prev parent reply other threads:[~2016-09-23 13:08 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-19 16:13 Eric Anholt
2016-09-19 16:13 ` [PATCH 2/3] gpio: Add a driver for the Raspberry Pi's firmware GPIO calls Eric Anholt
2016-09-23 9:08 ` Linus Walleij
2016-09-23 13:15 ` Eric Anholt
2016-09-23 14:08 ` Linus Walleij
2016-09-24 7:01 ` Eric Anholt
2016-10-06 8:16 ` Linus Walleij
2016-09-26 16:46 ` Stephen Warren
2016-09-23 19:00 ` Stefan Wahren
2016-09-19 16:13 ` [PATCH 3/3] arm64: Add the Raspberry Pi firmware's interface to the FXL6408 Eric Anholt
2016-09-22 20:44 ` Gerd Hoffmann
2016-09-23 9:23 ` Linus Walleij
2016-09-23 8:57 ` [PATCH 1/3] dt-bindings: Add a binding for the RPi firmware GPIO driver Linus Walleij
2016-09-23 13:08 ` Eric Anholt [this message]
2016-09-23 13:53 ` Linus Walleij
2016-09-26 16:40 ` Stephen Warren
2016-09-23 18:39 ` Stefan Wahren
2016-09-26 16:38 ` Stephen Warren
2016-09-26 18:42 ` Stefan Wahren
2016-09-28 17:54 ` Stephen Warren
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=87ponu931e.fsf@eliezer.anholt.net \
--to=eric@anholt.net \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=gnurou@gmail.com \
--cc=kraxel@redhat.com \
--cc=lee@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=mark.rutland@arm.com \
--cc=robh+dt@kernel.org \
--cc=swarren@wwwdotorg.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
all inboxes | Powered by JetHome®