summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/io.c
diff options
context:
space:
mode:
authorKevin Hilman <khilman@deeprootsystems.com>2009-04-14 07:04:16 -0500
committerKevin Hilman <khilman@deeprootsystems.com>2009-04-23 09:31:09 -0700
commitf5c122da543ebf98a5ccb3166768e38eea3120dd (patch)
tree0275d0646aab07c8e3bf9ef5a22572bcf668f400 /arch/arm/mach-davinci/io.c
parentc5b736d093217890245a33e9a98fe92d6f3529bf (diff)
downloadblackbird-op-linux-f5c122da543ebf98a5ccb3166768e38eea3120dd.tar.gz
blackbird-op-linux-f5c122da543ebf98a5ccb3166768e38eea3120dd.zip
davinci: add arch_ioremap() which uses existing static mappings
Add arch-specific ioremap() which uses any existing static mappings in place of doing a new mapping. From now on, drivers should always use ioremap() instead of IO_ADDRESS(). In addition, remove the davinci_[read|write]* macros in favor of using ioremap. Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-davinci/io.c')
-rw-r--r--arch/arm/mach-davinci/io.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/arch/arm/mach-davinci/io.c b/arch/arm/mach-davinci/io.c
index 71a7ae342b91..a548abb513e2 100644
--- a/arch/arm/mach-davinci/io.c
+++ b/arch/arm/mach-davinci/io.c
@@ -51,6 +51,26 @@ void __init davinci_map_common_io(void)
davinci_check_revision();
}
-void __init davinci_init_common_hw(void)
+#define BETWEEN(p, st, sz) ((p) >= (st) && (p) < ((st) + (sz)))
+#define XLATE(p, pst, vst) ((void __iomem *)((p) - (pst) + (vst)))
+
+/*
+ * Intercept ioremap() requests for addresses in our fixed mapping regions.
+ */
+void __iomem *davinci_ioremap(unsigned long p, size_t size, unsigned int type)
+{
+ if (BETWEEN(p, IO_PHYS, IO_SIZE))
+ return XLATE(p, IO_PHYS, IO_VIRT);
+
+ return __arm_ioremap(p, size, type);
+}
+EXPORT_SYMBOL(davinci_ioremap);
+
+void davinci_iounmap(volatile void __iomem *addr)
{
+ unsigned long virt = (unsigned long)addr;
+
+ if (virt >= VMALLOC_START && virt < VMALLOC_END)
+ __iounmap(addr);
}
+EXPORT_SYMBOL(davinci_iounmap);
OpenPOWER on IntegriCloud