All of lore.kernel.org
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/4] amba: add name based matching
Date: Thu, 17 Mar 2011 08:48:58 +0000	[thread overview]
Message-ID: <20110317084858.GB29758@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <AANLkTinrVeaGXhE8mUqMJCw0fzeEB7Ko+p6ViD3JWePX@mail.gmail.com>

On Thu, Mar 17, 2011 at 09:47:35AM +0100, Linus Walleij wrote:
> 2011/3/15 Russell King - ARM Linux <linux@arm.linux.org.uk>:
> 
> > I really hate the idea of matching AMBA stuff by name. ?Isn't there any
> > other solution to this?
> 
> What do you think about this:
> 
> diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
> index 6d2bb25..fcf355c 100644
> --- a/drivers/amba/bus.c
> +++ b/drivers/amba/bus.c
> @@ -603,6 +603,10 @@ int amba_device_register(struct amba_device *dev,
> struct resource *parent)
>         if (ret)
>                 goto err_out;
> 
> +       /* Hard-coded primecell ID instead of plug-n-play */
> +       if (dev->periphid != 0)
> +               goto skip_probe;
> +
>         /*
>          * Dynamically calculate the size of the resource
>          * and use this for iomap
> @@ -643,6 +647,7 @@ int amba_device_register(struct amba_device *dev,
> struct resource *parent)
>         if (ret)
>                 goto err_release;
> 
> + skip_probe:
>         ret = device_add(&dev->dev);
>         if (ret)
>                 goto err_release;
> 
> This way, if we hardcode periphid in the platform, it will take
> precedence. Currently hardware will override such hard-codec
> values.
> 
> There are a few instances using this in the kernel I think, but
> to my memory they are all of the type where the hardcoded
> number and the ID found in hardware are actually identical,
> and eiher make no harm or should be patched away with.

This means we don't pick up on the hardware configuration when platforms
have set the ID, and since we always provide the ID that would be bad.

  reply	other threads:[~2011-03-17  8:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-15 14:41 [PATCH 0/4] Fix ST-Ericsson Ux500 specific PL022 & PL180 amba devices Philippe Langlais
2011-03-15 14:41 ` [PATCH 1/4] amba: add name based matching Philippe Langlais
2011-03-15 14:49   ` Russell King - ARM Linux
2011-03-15 14:55     ` Linus Walleij
2011-03-17  8:47     ` Linus Walleij
2011-03-17  8:48       ` Russell King - ARM Linux [this message]
2011-03-17  8:58         ` Linus Walleij
2011-03-15 14:41 ` [PATCH 2/4] amba-pl022: Add loopback support for the SPI on 5500 Philippe Langlais
2011-03-15 14:41 ` [PATCH 3/4] mmci/pl180: Support for db8500v2. ST-Ericsson modified ARM PrimeCell PL180 block has not got an updated corresponding amba-id, althought the IP block has changed in db8500v2. The change was done to the datactrl register Philippe Langlais
2011-03-15 14:41 ` [PATCH 4/4] ux500: pass name for db5500-spi & db8500v2-sdi devices Philippe Langlais

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=20110317084858.GB29758@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --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 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.