From: Stephen Warren <swarren@wwwdotorg.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC PATCH v2 13/13] tegra: Convert tegra GPIO driver to use driver model
Date: Mon, 05 May 2014 15:14:32 -0600 [thread overview]
Message-ID: <5367FF38.5000703@wwwdotorg.org> (raw)
In-Reply-To: <CAPnjgZ1zprNrh38zYh1JfT_ERPOX62ipf3czFWdXvP0FwL550g@mail.gmail.com>
On 05/05/2014 01:53 PM, Simon Glass wrote:
> Hi Stephen,
>
> On 5 May 2014 11:29, Stephen Warren <swarren@wwwdotorg.org> wrote:
>> On 05/05/2014 10:09 AM, Simon Glass wrote:
>>> This is an implementation of GPIOs for Tegra that uses driver model. It has
>>> been tested on trimslice and also using the new iotrace feature.
>>>
>>> The implementation uses a top-level GPIO device (which has no actual GPIOS).
>>> Under this all the banks are created as separate GPIO devices.
>>
>> I don't think that dividing the GPIOs into banks is appropriate. While
>> the textual naming of Tegra GPIOs is based on the bank concept, I think
>> that division should only apply to the textual naming, and not any data
>> structures or device registration, etc. In fact, I often refer to Tegra
>> GPIOs using their integer ID rather than their name, and dividing the
>> controller into separate banks probably technically disallows this,
>> since there would be no architected guarantee that the numbering of the
>> banks would be sequential. Contiguous numbering of all GPIOs within the
>> controller is also useful for correlation with pinmux numbering of pins.
>
> This is how the GPIO uclass works at present. Do you think that should
> change also? It would mean enhancing the uclass to support multiple
> GPIO bank names, with each having a number of GPIOs attached. This is
> the sort of complexity that adds to code size. On the other hand it's
> something that we may want to do anyway as more SOC's GPIO drivers are
> converted.
Surely this means simplifying the core to completely remove any concept
of GPIO banks. I really don't see any need for a 2-level hierarchy. Just
have one struct/object/... that represents a GPIO
controller/module/chip/... Each of those has N GPIOs numbered 0..N.
Linux has managed to get away without a 2-level controller/bank
approach, so there's certainly evidence it works in practice.
>> ...
>>> Since driver model is not yet available before relocation, or in SPL, a
>>> special function is provided for seaboard's SPL code.
>>
>> Perhaps we should just remove that code from Seaboard, since sharing the
>> UART/SPI pins really isn't a useful feature.
>
> saveenv to SPI won't work without it though.
The environment is stored in eMMC.
SPI simply doesn't work sanely on Seaboard, and we should just rip out
any support for it at all. On Seaboard itself, people can just set the
jumpers to ignore SPI completely. On Springbank, something similar can
be done with the pull-up/down resistors. I've been using my Springbank
without any of the resistors present, while disables SPI completely, for
years without issue...
>>> +static char *gpio_port_name(int base_port)
>>> {
>>> + char *name, *s;
>>> +
>>> + name = malloc(3);
>>
>> It seems like this should be statically allocated (e.g. as part of *plat
>> in gpio_tegra_bind() or something?). Still, if we stop splitting things
>> into banks, we can completely get rid of this.
>
> No, we still need the name so that 'gpio input T3' works corrrectly.
Why do we need GPIO names at all? "gpio input 155" works just as well,
and to be honest is often a lot more convenient that trying to maps
things back to a name.
next prev parent reply other threads:[~2014-05-05 21:14 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-05 16:08 [U-Boot] [RFC PATCH v2 0/13] Enable driver model for GPIOs on Tegra Simon Glass
2014-05-05 16:08 ` [U-Boot] [RFC PATCH v2 01/13] Add an I/O tracing feature Simon Glass
2014-05-05 16:08 ` [U-Boot] [RFC PATCH v2 02/13] arm: Support iotrace feature Simon Glass
2014-05-05 16:09 ` [U-Boot] [RFC PATCH v2 03/13] sandbox: " Simon Glass
2014-05-05 16:09 ` [U-Boot] [RFC PATCH v2 04/13] Makefile: Support include files for .dts files Simon Glass
2014-05-05 16:54 ` Stephen Warren
2014-05-07 2:15 ` Masahiro Yamada
2014-05-07 22:37 ` Simon Glass
2014-05-05 16:09 ` [U-Boot] [RFC PATCH v2 05/13] tegra: dts: Bring in GPIO bindings from linux Simon Glass
2014-05-05 16:57 ` Stephen Warren
2014-05-07 23:11 ` Simon Glass
2014-05-05 16:09 ` [U-Boot] [RFC PATCH v2 06/13] dm: Update README to encourage conversion to driver model Simon Glass
2014-05-05 16:09 ` [U-Boot] [RFC PATCH v2 07/13] dm: Use case-insensitive comparison for GPIO banks Simon Glass
2014-05-05 16:09 ` [U-Boot] [RFC PATCH v2 08/13] dm: Add missing header files in lists and root Simon Glass
2014-05-05 16:09 ` [U-Boot] [RFC PATCH v2 09/13] dm: Case away the const-ness of the global_data pointer Simon Glass
2014-05-05 16:09 ` [U-Boot] [RFC PATCH v2 10/13] dm: Allow driver model tests only for sandbox Simon Glass
2014-05-05 16:09 ` [U-Boot] [RFC PATCH v2 11/13] dm: Fix printf() strings in the 'dm' command Simon Glass
2014-05-05 16:09 ` [U-Boot] [RFC PATCH v2 12/13] tegra: Enable driver model Simon Glass
2014-05-05 16:58 ` Stephen Warren
2014-05-05 19:01 ` Simon Glass
2014-05-05 16:09 ` [U-Boot] [RFC PATCH v2 13/13] tegra: Convert tegra GPIO driver to use " Simon Glass
2014-05-05 17:29 ` Stephen Warren
2014-05-05 19:53 ` Simon Glass
2014-05-05 21:14 ` Stephen Warren [this message]
2014-05-05 21:30 ` Simon Glass
2014-05-05 22:07 ` Stephen Warren
2014-05-05 23:00 ` Simon Glass
2014-05-06 17:34 ` Stephen Warren
2014-05-06 20:28 ` Simon Glass
2014-05-06 20:37 ` Stephen Warren
2014-05-06 20:41 ` Simon Glass
-- strict thread matches above, loose matches on Subject: below --
2014-05-09 17:28 [U-Boot] [RFC PATCH v2 0/13] Enable driver model for GPIOs on Tegra Simon Glass
2014-05-09 17:28 ` [U-Boot] [RFC PATCH v2 13/13] tegra: Convert tegra GPIO driver to use driver model Simon Glass
2014-05-13 19:30 ` Stephen Warren
2014-05-22 1:25 ` Simon Glass
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=5367FF38.5000703@wwwdotorg.org \
--to=swarren@wwwdotorg.org \
--cc=u-boot@lists.denx.de \
/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