linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: ben-linux@fluff.org (Ben Dooks)
To: linux-arm-kernel@lists.infradead.org
Subject: QUERY: How to handle SOC Configuration (Peripheral Multiplexing) in linux
Date: Wed, 17 Mar 2010 16:30:23 +0000	[thread overview]
Message-ID: <20100317163023.GF31126@trinity.fluff.org> (raw)
In-Reply-To: <4B9DDC61.3090609@st.com>

On Mon, Mar 15, 2010 at 12:36:09PM +0530, Viresh KUMAR wrote:
> Ben,
> 
> On 3/15/2010 11:50 AM, Ben Dooks wrote:
> >> > I have provided this selection from "make menuconfig", based on selection I
> >> > configure hardware at initialization time. Basically these selections will
> >> > decide which device is present in the system when it boots.
> > This is really bad idea, what happens if you have a selection of
> > boards with mutually-exclusive peripheral sets?
> 
> In this case, we can have different defconfig files for different boards.

That is not acceptable, it makes life difficult for things like the
autobuilder (more configurations to process), for people trying to
package software distributions (each kernel requires a package, a set
of modules, requiring time to build and space to store).

The configuration is known to the board initialisation code in the
kernel, and thus it should be requesting a set of features from the
core SoC implementation saying what it wants. This can then ensure
that the configuration is mutually exclusive, ensure any resources
such as GPIO are correctly configured, etc.

Note, currently the s3c2410_defconfig builds 123Mbyte of modules.
Think about having m-machines' worth of those littering your development
system.
 
> > Making these sorts of
> > decisions at compile time is always a bad idea, it leaves people making
> > distributitions a lot of extra work.
> > 
> 
> I agree with this point but what is the other way for this.
> 
> Doing this at runtime will have following issue:
> 
> User have inserted a module and by mistake or lack of knowledge,
> he disabled already working IP(due to multiplexing). Now with Kconfig concept 
> this is taken care of at the beginning only. User can't select peripherals which
> can't be enabled simultaneously.

Generally, all devices are registered at initialisation time. If there is
the chance of dynamically loading drivers afterwards, either you'll have
to do one of the following:

1) Change the driver to call the SoC code in the probe() code to ensure
   that it can get the required SoC resources

2) Ensure the board has reseved the SoC resources for the device at start
   time

Note, also unless you have very specific modules, your Kconfig approach
will break down if you forget to update the root-fs when changing the
kernel, otherwise modules you can't load will be left around.

Generally, runtime controls are much better than build time.

-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.

  reply	other threads:[~2010-03-17 16:30 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-15  4:31 QUERY: How to handle SOC Configuration (Peripheral Multiplexing) in linux Viresh KUMAR
2010-03-15  4:47 ` jassi brar
2010-03-15  5:14   ` Shiraz HASHIM
2010-03-15  5:41     ` jassi brar
2010-03-15  6:32       ` Viresh KUMAR
2010-03-15  6:46         ` jassi brar
2010-03-15 12:55         ` Bill Gatliff
2010-03-15 13:15         ` Russell King - ARM Linux
2010-03-15 13:22           ` Bill Gatliff
2010-03-16  2:01           ` jassi brar
2010-03-15 12:52     ` Bill Gatliff
2010-03-15 16:02       ` Armando VISCONTI
2010-03-15 16:53         ` Nicolas Pitre
2010-03-15 16:53         ` Bill Gatliff
2010-03-15 17:09           ` Mark Brown
2010-03-15 18:57             ` Tony Lindgren
2010-03-15 18:58               ` Bill Gatliff
2010-03-15 16:58         ` Russell King - ARM Linux
2010-03-15  4:57 ` Shilimkar, Santosh
2010-03-15  5:15   ` Shiraz HASHIM
2010-03-15  5:28     ` Shilimkar, Santosh
2010-03-15  6:34       ` Viresh KUMAR
2010-03-15  6:20 ` Ben Dooks
2010-03-15  6:28   ` Viresh KUMAR
2010-03-15  8:42     ` Armando VISCONTI
2010-03-15  9:09       ` Shiraz HASHIM
2010-03-15  9:37         ` jassi brar
2010-03-15 10:22           ` Shiraz HASHIM
2010-03-15 10:34             ` jassi brar
2010-03-15 10:55               ` Russell King - ARM Linux
2010-03-15 10:37             ` Russell King - ARM Linux
2010-03-15 10:10         ` Armando VISCONTI
2010-03-15 10:27           ` Shiraz HASHIM
2010-03-15  7:06   ` Viresh KUMAR
2010-03-17 16:30     ` Ben Dooks [this message]
2010-03-19  4:45       ` Viresh KUMAR
2010-03-15 17:55 ` Linus Walleij
2010-03-16 13:39   ` Shiraz HASHIM
2010-03-16 21:55     ` 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=20100317163023.GF31126@trinity.fluff.org \
    --to=ben-linux@fluff.org \
    --cc=linux-arm-kernel@lists.infradead.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).