From: Arnd Bergmann <arnd@arndb.de>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Greg KH <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org, Paul Walmsley <paul@pwsan.com>,
linux-arm-kernel@lists.infradead.org,
"Russell King - ARM Linux" <linux@arm.linux.org.uk>,
Olof Johansson <olof@lixom.net>,
Samuel Ortiz <sameo@linux.intel.com>,
Mattias NILSSON <mattias.i.nilsson@stericsson.com>,
Rickard ANDERSSON <rickard.andersson@stericsson.com>,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
Kyungmin Park <kyungmin.park@samsung.com>,
Nicolas Pitre <nicolas.pitre@linaro.org>
Subject: Re: RFC: what do we do with system controllers?
Date: Wed, 29 Feb 2012 12:45:53 +0000 [thread overview]
Message-ID: <201202291245.54038.arnd@arndb.de> (raw)
In-Reply-To: <CACRpkdY1W-RGE0JL4Sx5UcPY-EGieu8vo7H0fp9xyXtegpaaKw@mail.gmail.com>
On Tuesday 28 February 2012, Linus Walleij wrote:
>
> * Reset or shut down the system
> * Reset individual ASIC blocks
> * Control some core voltage domains
> * Control system frequency
> * Select clocking of indvidual ASIC IP blocks:
> * Provide some versioning numbers for the entire system
> * Enable and reset external buses such as PCI
> * (De)protect flash memory
> * Provide a communication channel to another control unit
> * Set some clock divisors for misc units
> * LEDs, GPIO etc communication channel
> * USB transciever control:
> * Get OTP (one-time-programmable) bits:
> * Set up DDR control registers:
> * Pin control:
Nice list, thanks for putting that together.
> The current way to split this problem is to:
>
> - Push each subfunctionality into a specialized subsystem
> PLL and clocks to drivers/clk using the new framework
> RealSoonNow for example, pin control we have in place
> regulators can handle domain switches...
>
> - Put in place an arbitration hub-like mechanism using MFD
Right.
> This can be done in two ways:
>
> - Permanently map the register range and let subdrivers
> poke directly into the registers they're interested in.
>
> - Map the register range in a hub driver (often MFD) and
> write accessor functions for all subfunctionality.
Generally, I would always prefer the second of these ways,
because it allows one to keep the necessary locking local to
the implementation of the system controller driver.
> As far as the drivers are small and nice the heterogeneous
> character of these device register ranges are not much
> of a problem. Some will argue to not fix what ain't broken
> and not move these out of arch/arm/* at all.
That argument certainly has its merits, after all the way that
the system controller works is one of the central aspects
of a platform/subarchitecture.
> What we need to discuss is if this is how we go about
> taking care of these devices going forward - what shall be
> the preferred design pattern?
>
> My current assumption is that we need to get these things
> out of arch/arm/* and into proper subsystems, using
> drivers/mfd/* as an arbitration point. However I am not
> sure that everyone really agrees on this. Right now it's
> more a modus operandi and following what someone else
> does than a conscious decision to do this.
>
> We have discussed creating drivers/scm/* (system controller
> modules) but I'm pretty unsure of what the definition of
> such creatures would be, and the border toward MFD
> would be pretty blurred.
Agreed.
> x86 have conveniently put some of their equivalents under
> drivers/platform/x86 but if I understood Arnd correctly
> creating drivers/platform/arm would break the intentions
> of that directory.
The problem I have with using drivers/platform for this is that
it encourages grouping of drivers by their host-side connection
rather than by their functionality. We're moving away from
that model in most other places in the kernel, and we should
try to discourage it for new code. The drivers/platform/x86
directory contains stuff like rfkill, input, backlight, etc
drivers, all of which have (or should have) other places for
them to live in already.
I don't mind having a new location for system controllers
outside of (or below) drivers/mfd, but I would try to avoid
naming it "platform" because I fear that leads people to stuff
all sorts of drivers in there because they happen to be
implemented as 'platform_driver'.
Arnd
prev parent reply other threads:[~2012-02-29 12:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-28 5:48 RFC: what do we do with system controllers? Linus Walleij
2012-02-28 8:38 ` Russell King - ARM Linux
2012-02-29 9:59 ` Linus Walleij
2012-02-29 10:08 ` Russell King - ARM Linux
2012-02-29 12:45 ` Arnd Bergmann [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=201202291245.54038.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=gregkh@linuxfoundation.org \
--cc=kyungmin.park@samsung.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=mattias.i.nilsson@stericsson.com \
--cc=nicolas.pitre@linaro.org \
--cc=olof@lixom.net \
--cc=paul@pwsan.com \
--cc=rickard.andersson@stericsson.com \
--cc=sameo@linux.intel.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