linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de>, Olof Johansson <olof@lixom.net>,
	Stephen Warren <swarren@nvidia.com>,
	linux-tegra@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Dong Aisheng <dong.aisheng@linaro.org>,
	Thomas Abraham <thomas.abraham@linaro.org>,
	Grant Likely <grant.likely@secretlab.ca>,
	Rajendra Nayak <rajendra.nayak@linaro.org>
Subject: Re: [PATCH V2 1/4] pinctrl: add a driver for NVIDIA Tegra
Date: Fri, 3 Feb 2012 09:58:54 -0800	[thread overview]
Message-ID: <20120203175854.GC1426@atomide.com> (raw)
In-Reply-To: <CACRpkdbMPrvN80cLyVLUNvTjx4ZV4iLeHcJaJyM_qvTHHAfWww@mail.gmail.com>

Hi,

* Linus Walleij <linus.walleij@linaro.org> [120203 06:26]:
> On Thu, Feb 2, 2012 at 4:33 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> > I guess if we could move the per-board pinmux data into dts files,
> > that would mean we could actually get rid of the per-board source
> > files in tegra, right?
> 
> If you mean these:
> 
>  arch/arm/mach-tegra/board-harmony-pinmux.c        |  362 ++-
>  arch/arm/mach-tegra/board-paz00-pinmux.c          |  362 ++-
>  arch/arm/mach-tegra/board-pinmux.c                |   62 +-
>  arch/arm/mach-tegra/board-pinmux.h                |   39 +-
>  arch/arm/mach-tegra/board-seaboard-pinmux.c       |  442 ++-
>  arch/arm/mach-tegra/board-trimslice-pinmux.c      |  366 ++-
> 
> Then the answer is yes.
> 
> But not if you mean these:
> 
>  drivers/pinctrl/pinctrl-tegra20.c                 | 2860 ++++++++++++++++
>  drivers/pinctrl/pinctrl-tegra30.c                 | 3726 +++++++++++++++++++++
> 
> Because the large number of lines come from SoC
> properties rather than board properties.
> 
> The big issue here is whether SoC hardware block
> properties (such as the pins and their names, and their
> groups) should be:
> 
> (A) open-coded in the driver or
> (B) provided as data in the device tree
> 
> nVidia Tegra have opted for the former, Texas OMAP for the latter.
> The in-kernel drivers also do like Tegra. However they
> are smaller due to less combinatorics.
> 
> This means that the Tegra driver gets (quite a bit) bigger and
> the OMAP driver (quite a bit) smaller.

Well I think both A and B should be supported, and also
support a combination of A and B in the same driver if
needed.

For doing DT only pinmux driver, my observations so far are:

1. Most of the pinmux data in the drivers is only needed for
   debugging and actually not needed in the driver at all.

   The pinmux driver can get away without knowing what the
   settings are, it just needs to know where the registers
   are and how they should set based on the board specific
   .dts configuration.

2. Knowing how the pinmux registers are set is crucial for
   debugging. But this all can be done with userspace tools
   using pinctrl debugfs entries. So again the pinmux driver
   just needs to know just "how many, what type of registers,
   and where they are".

3. The board specific pinmux configuration for groups and values
   can be passed from .dts files without passing any strings
   in most cases. Once we have preprocessor working, the .dts
   mux configuration should be quite readable.

> > Will it be possible to eventually put the pinmux driver into a loadable
> > module?
> 
> Tony had made it possible to have pinctrl drivers as modules,
> but some systems may need their pin control up before
> they even bring up the filesystem :-(

For development work loadable modules are much nicer to work with ;)

Loadable modules also automatically cut away the SoC specific
spaghetti calls as things need to work in a standard way limited
to EXPORT_SYMBOL.

So in general, from sanity checking point of view, we should
probably require that anything under drivers at least builds
as a loadable module.

> Booting from initramfs and switchroot can solve the above
> but will slow down boot I believe, and ARM systems
> usually don't like that.

Yeah I guess for now most people would want to build it in.
Then when ARM distros will be able to use the common zImage,
most people will probably switch to initramfs based boot.

Regards,

Tony

  parent reply	other threads:[~2012-02-03 17:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-01 21:04 [PATCH V2 1/4] pinctrl: add a driver for NVIDIA Tegra Stephen Warren
2012-02-01 21:04 ` [PATCH V2 2/4] ARM: tegra: Select PINCTRL Kconfig variables Stephen Warren
2012-02-01 21:04 ` [PATCH V2 3/4] ARM: tegra: Switch to new pinctrl driver Stephen Warren
2012-02-01 21:04 ` [PATCH V2 4/4] ARM: tegra: Remove pre-pinctrl pinmux driver Stephen Warren
2012-02-02 13:26 ` [PATCH V2 1/4] pinctrl: add a driver for NVIDIA Tegra Linus Walleij
2012-02-02 14:43   ` Shawn Guo
2012-02-02 15:33   ` Arnd Bergmann
2012-02-03 14:57     ` Linus Walleij
2012-02-03 17:50       ` Stephen Warren
2012-02-03 21:44         ` Linus Walleij
2012-02-03 17:58       ` Tony Lindgren [this message]
2012-02-03 18:55       ` Arnd Bergmann
2012-02-03 22:12         ` 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=20120203175854.GC1426@atomide.com \
    --to=tony@atomide.com \
    --cc=arnd@arndb.de \
    --cc=dong.aisheng@linaro.org \
    --cc=grant.likely@secretlab.ca \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=olof@lixom.net \
    --cc=rajendra.nayak@linaro.org \
    --cc=swarren@nvidia.com \
    --cc=thomas.abraham@linaro.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).