summaryrefslogtreecommitdiffstats
path: root/drivers/amba
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2013-02-12 14:03:25 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2013-02-12 20:35:52 +0100
commita59a5acf68e6a46aee285f3f2d95d64854cbf115 (patch)
tree23884cbc4da413bb952b06319f2a386bf18f5d0d /drivers/amba
parent2738f723521e299b38ab882a85e11f246b38dad2 (diff)
downloadbarebox-a59a5acf68e6a46aee285f3f2d95d64854cbf115.tar.gz
barebox-a59a5acf68e6a46aee285f3f2d95d64854cbf115.tar.xz
amba: introduce amba_device_get_pid/cid
so we can use it on vexpress to detect the hardware mapping Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/amba')
-rw-r--r--drivers/amba/bus.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
index d1ab53ca72..65385be64d 100644
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
@@ -104,7 +104,7 @@ int amba_device_add(struct amba_device *dev)
{
u32 size;
void __iomem *tmp;
- int i, ret;
+ int ret;
struct resource *res = NULL;
dev->dev.bus = &amba_bustype;
@@ -135,12 +135,8 @@ int amba_device_add(struct amba_device *dev)
* Read pid and cid based on size of resource
* they are located at end of region
*/
- for (pid = 0, i = 0; i < 4; i++)
- pid |= (readl(tmp + size - 0x20 + 4 * i) & 255) <<
- (i * 8);
- for (cid = 0, i = 0; i < 4; i++)
- cid |= (readl(tmp + size - 0x10 + 4 * i) & 255) <<
- (i * 8);
+ pid = amba_device_get_pid(tmp, size);
+ cid = amba_device_get_cid(tmp, size);
if (cid == AMBA_CID)
dev->periphid = pid;