2014-08-24 15:57:49 +00:00
|
|
|
From c6516d2c672450fb27783866397a487511d90bba Mon Sep 17 00:00:00 2001
|
2014-05-29 19:25:40 +00:00
|
|
|
From: Hauke Mehrtens <hauke@hauke-m.de>
|
2014-08-24 15:57:49 +00:00
|
|
|
Date: Fri, 22 Aug 2014 08:44:52 +0200
|
|
|
|
Subject: [PATCH 08/17] bcma: only map wrapper if its address is available
|
|
|
|
MIME-Version: 1.0
|
|
|
|
Content-Type: text/plain; charset=UTF-8
|
|
|
|
Content-Transfer-Encoding: 8bit
|
2014-05-29 19:25:40 +00:00
|
|
|
|
2014-08-24 15:57:49 +00:00
|
|
|
The Chipcommon B core does not have a wrap address and it would fail here.
|
2014-05-29 19:25:40 +00:00
|
|
|
|
|
|
|
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
|
2014-08-24 15:57:49 +00:00
|
|
|
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
|
2014-05-29 19:25:40 +00:00
|
|
|
---
|
2014-08-24 15:57:49 +00:00
|
|
|
drivers/bcma/host_soc.c | 4 ++++
|
|
|
|
drivers/bcma/scan.c | 11 +++++++----
|
|
|
|
2 files changed, 11 insertions(+), 4 deletions(-)
|
2014-05-29 19:25:40 +00:00
|
|
|
|
2014-08-24 15:57:49 +00:00
|
|
|
--- a/drivers/bcma/host_soc.c
|
|
|
|
+++ b/drivers/bcma/host_soc.c
|
|
|
|
@@ -137,12 +137,16 @@ static void bcma_host_soc_block_write(st
|
|
|
|
|
|
|
|
static u32 bcma_host_soc_aread32(struct bcma_device *core, u16 offset)
|
|
|
|
{
|
|
|
|
+ if (WARN_ONCE(!core->io_wrap, "Accessed core has no wrapper/agent\n"))
|
|
|
|
+ return ~0;
|
|
|
|
return readl(core->io_wrap + offset);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void bcma_host_soc_awrite32(struct bcma_device *core, u16 offset,
|
|
|
|
u32 value)
|
|
|
|
{
|
|
|
|
+ if (WARN_ONCE(!core->io_wrap, "Accessed core has no wrapper/agent\n"))
|
|
|
|
+ return;
|
|
|
|
writel(value, core->io_wrap + offset);
|
|
|
|
}
|
|
|
|
|
2014-05-29 19:25:40 +00:00
|
|
|
--- a/drivers/bcma/scan.c
|
|
|
|
+++ b/drivers/bcma/scan.c
|
|
|
|
@@ -421,10 +421,13 @@ static int bcma_get_next_core(struct bcm
|
|
|
|
core->io_addr = ioremap_nocache(core->addr, BCMA_CORE_SIZE);
|
|
|
|
if (!core->io_addr)
|
|
|
|
return -ENOMEM;
|
|
|
|
- core->io_wrap = ioremap_nocache(core->wrap, BCMA_CORE_SIZE);
|
|
|
|
- if (!core->io_wrap) {
|
|
|
|
- iounmap(core->io_addr);
|
|
|
|
- return -ENOMEM;
|
|
|
|
+ if (core->wrap) {
|
|
|
|
+ core->io_wrap = ioremap_nocache(core->wrap,
|
|
|
|
+ BCMA_CORE_SIZE);
|
|
|
|
+ if (!core->io_wrap) {
|
|
|
|
+ iounmap(core->io_addr);
|
|
|
|
+ return -ENOMEM;
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|