All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Ferre <nicolas.ferre@atmel.com>
To: Rob Herring <robh@kernel.org>, Linus Walleij <linus.walleij@linaro.org>
Cc: "linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	Alexandre Courbot <acourbot@nvidia.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	Neil Armstrong <narmstrong@baylibre.com>
Subject: Re: [PATCH] gpio: dt-bindings: document the concept of GPIO banks
Date: Thu, 31 Mar 2016 15:30:49 +0200	[thread overview]
Message-ID: <56FD2689.1080707@atmel.com> (raw)
In-Reply-To: <CAL_JsqK+n-EwHx52=d9-dTJaVsSOzRS+PAmyCYwe6HK=kDoyGQ@mail.gmail.com>

Le 31/03/2016 15:22, Rob Herring a écrit :
> On Thu, Mar 31, 2016 at 4:10 AM, Linus Walleij <linus.walleij@linaro.org> wrote:
>> Cc: devicetree@vger.kernel.org
>> Cc: Neil Armstrong <narmstrong@baylibre.com>
>> Cc: Rob Herring <robh@kernel.org>
>> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> 
> We generally avoid indexing blocks in DT.
> 
>> ---
>>  Documentation/devicetree/bindings/gpio/gpio.txt | 14 ++++++++++++++
>>  1 file changed, 14 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/gpio/gpio.txt b/Documentation/devicetree/bindings/gpio/gpio.txt
>> index 069cdf6f9dac..f509ecf03ece 100644
>> --- a/Documentation/devicetree/bindings/gpio/gpio.txt
>> +++ b/Documentation/devicetree/bindings/gpio/gpio.txt
>> @@ -131,6 +131,19 @@ Every GPIO controller node must contain both an empty "gpio-controller"
>>  property, and a #gpio-cells integer property, which indicates the number of
>>  cells in a gpio-specifier.
>>
>> +Some system-on-chips (SoCs) use the concept of GPIO banks. A GPIO bank is an
>> +instance of a hardware IP core on a silicon die, usually exposed to the
>> +programmer as a coherent range of I/O addresses. Usually each such bank is
>> +exposed in the device tree as an individual gpio-controller node, reflecting
>> +the fact that the hardware was synthesized by reusing the same IP block a
>> +few times over.
>> +
>> +A GPIO controller may specify a bank ID. This is a hardware index that
>> +indicate the logical order of the GPIO controller in the hardware architecture,
>> +usually in the sequence 0, 1, 2 .. n. The hardware index may be different
>> +from the order of register ranges and related to the backplane of how this
>> +one bank is connected to the outside through a pin controller for example.
> 
> I still don't understand why do you need to know this? If you need
> some mapping of gpio nodes into pin controller, the pin controller
> should have a mapping using phandles.

We use aliases for this:

aliases {
    gpio0 = &pioA;
    gpio1 = &pioB;
    [..]
};

Bye,

>> +
>>  Optionally, a GPIO controller may have a "ngpios" property. This property
>>  indicates the number of in-use slots of available slots for GPIOs. The
>>  typical example is something like this: the hardware register is 32 bits
>> @@ -152,6 +165,7 @@ gpio-controller@00000000 {
>>         reg = <0x00000000 0x1000>;
>>         gpio-controller;
>>         #gpio-cells = <2>;
>> +       gpio-bank = <0>;
>>         ngpios = <18>;
>>  }
>>
>> --
>> 2.4.3
>>
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


-- 
Nicolas Ferre
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2016-03-31 13:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-31  9:10 [PATCH] gpio: dt-bindings: document the concept of GPIO banks Linus Walleij
     [not found] ` <1459415459-8107-1-git-send-email-linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-03-31 13:22   ` Rob Herring
2016-03-31 13:30     ` Nicolas Ferre [this message]
2016-03-31 14:48       ` Rob Herring
2016-03-31 14:52         ` Neil Armstrong
     [not found]           ` <56FD399A.8090600-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>
2016-04-08  9:30             ` Linus Walleij
2016-04-08  9:26     ` 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=56FD2689.1080707@atmel.com \
    --to=nicolas.ferre@atmel.com \
    --cc=acourbot@nvidia.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=narmstrong@baylibre.com \
    --cc=robh@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.