* [PATCH] amba: add name based matching
@ 2010-10-09 15:01 Rabin Vincent
2010-10-12 8:24 ` Russell King - ARM Linux
0 siblings, 1 reply; 3+ messages in thread
From: Rabin Vincent @ 2010-10-09 15:01 UTC (permalink / raw)
To: linux-arm-kernel
Some peripherals on the DBx500 family of SoCs have changes in their
functionality and registers between different variants in the family but
retain the same AMBA peripheral ID, making it impossible to distinguish
between them in AMBA drivers with the current AMBA id_table.
To support this, add a name parameter to the amba_device and the amba_id
and allow name based matching as a second level filter after the
periphid match.
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
---
drivers/amba/bus.c | 6 ++++++
include/linux/amba/bus.h | 2 ++
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
index d31590e..926121a 100644
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
@@ -28,6 +28,12 @@ amba_lookup(struct amba_id *table, struct amba_device *dev)
while (table->mask) {
ret = (dev->periphid & table->mask) == table->id;
+ if (ret && (table->name || dev->name)) {
+ if (table->name && dev->name)
+ ret = strcmp(dev->name, table->name) == 0;
+ else
+ ret = 0;
+ }
if (ret)
break;
table++;
diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h
index b0c1740..61ec94a 100644
--- a/include/linux/amba/bus.h
+++ b/include/linux/amba/bus.h
@@ -29,12 +29,14 @@ struct amba_device {
struct clk *pclk;
u64 dma_mask;
unsigned int periphid;
+ const char *name;
unsigned int irq[AMBA_NR_IRQS];
};
struct amba_id {
unsigned int id;
unsigned int mask;
+ const char *name;
void *data;
};
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] amba: add name based matching
2010-10-09 15:01 [PATCH] amba: add name based matching Rabin Vincent
@ 2010-10-12 8:24 ` Russell King - ARM Linux
2010-10-12 8:46 ` Rabin Vincent
0 siblings, 1 reply; 3+ messages in thread
From: Russell King - ARM Linux @ 2010-10-12 8:24 UTC (permalink / raw)
To: linux-arm-kernel
On Sat, Oct 09, 2010 at 08:31:20PM +0530, Rabin Vincent wrote:
> Some peripherals on the DBx500 family of SoCs have changes in their
> functionality and registers between different variants in the family but
> retain the same AMBA peripheral ID, making it impossible to distinguish
> between them in AMBA drivers with the current AMBA id_table.
>
> To support this, add a name parameter to the amba_device and the amba_id
> and allow name based matching as a second level filter after the
> periphid match.
I am really not very happy with this without an explaination of the kinds
of differences there are.
We've been through these kinds of problems where hardware has claimed to
be implemented by 'ARM' (0x41 in the implementer byte) "for compatibility"
but are a different design with their own differences. Eventually the
vendor was forced (as I understand by ARM Ltd) to change that.
This sounds like another one of these situations - it seems that the
lesson hasn't been learnt.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] amba: add name based matching
2010-10-12 8:24 ` Russell King - ARM Linux
@ 2010-10-12 8:46 ` Rabin Vincent
0 siblings, 0 replies; 3+ messages in thread
From: Rabin Vincent @ 2010-10-12 8:46 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Oct 12, 2010 at 10:24:49 +0200, Russell King - ARM Linux wrote:
> On Sat, Oct 09, 2010 at 08:31:20PM +0530, Rabin Vincent wrote:
> > Some peripherals on the DBx500 family of SoCs have changes in their
> > functionality and registers between different variants in the family but
> > retain the same AMBA peripheral ID, making it impossible to distinguish
> > between them in AMBA drivers with the current AMBA id_table.
> >
> > To support this, add a name parameter to the amba_device and the amba_id
> > and allow name based matching as a second level filter after the
> > periphid match.
>
> I am really not very happy with this without an explaination of the kinds
> of differences there are.
For example:
- The PL180 derivate has the ID 0x00480180 on both DB8500v1 and
DB8500v2, but the DB8500v2 version moves the BLOCKSIZE in the
DATACTRL register from a power of two at bits 7:4 to a normal value
at bits 30:16. The bits 7:4 become reserved in DB8500v2.
- The PL022 derivate has the ID 0x00080023 on DB8500 and DB5500, but
the DB5500 version has the "Loopback enable" bit, while the DB8500
version doesn't.
Rabin
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-10-12 8:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-09 15:01 [PATCH] amba: add name based matching Rabin Vincent
2010-10-12 8:24 ` Russell King - ARM Linux
2010-10-12 8:46 ` Rabin Vincent
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox