summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/io.c
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2011-01-21 17:04:36 -0800
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:36:55 -0800
commit65f8ea39ef30a5a70174679099801f44aecd478f (patch)
tree809cfc52e5934e5b7479415255d48bcdf00c430d /arch/arm/mach-tegra/io.c
parent9e1a807ebb156507c30a835e4a54ba975f980260 (diff)
ARM: tegra: Prevent dynamically ioremapping device io memory
Change-Id: I893a42bd773b1acdf2b83f8602fe1aa6a8ea6741 Signed-off-by: Colin Cross <ccross@android.com>
Diffstat (limited to 'arch/arm/mach-tegra/io.c')
-rw-r--r--arch/arm/mach-tegra/io.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/arch/arm/mach-tegra/io.c b/arch/arm/mach-tegra/io.c
index 87125e2a4532..35db99f116be 100644
--- a/arch/arm/mach-tegra/io.c
+++ b/arch/arm/mach-tegra/io.c
@@ -85,8 +85,20 @@ void __init tegra_map_common_io(void)
void __iomem *tegra_ioremap(unsigned long p, size_t size, unsigned int type)
{
void __iomem *v = IO_ADDRESS(p);
- if (v == NULL)
+
+ /*
+ * __arm_ioremap fails to set the domain of ioremapped memory
+ * correctly, only use it on physical memory.
+ */
+ if (v == NULL && p < SZ_1G)
v = __arm_ioremap(p, size, type);
+
+ /*
+ * If the physical address was not physical memory or statically
+ * mapped, there's nothing we can do to map it safely.
+ */
+ BUG_ON(v == NULL);
+
return v;
}
EXPORT_SYMBOL(tegra_ioremap);