diff options
author | Kevin Hilman <khilman@deeprootsystems.com> | 2009-04-14 08:04:16 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@deeprootsystems.com> | 2009-04-23 12:31:09 -0400 |
commit | f5c122da543ebf98a5ccb3166768e38eea3120dd (patch) | |
tree | 0275d0646aab07c8e3bf9ef5a22572bcf668f400 /arch/arm/mach-davinci/io.c | |
parent | c5b736d093217890245a33e9a98fe92d6f3529bf (diff) |
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.c | 22 |
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) | |||
51 | davinci_check_revision(); | 51 | davinci_check_revision(); |
52 | } | 52 | } |
53 | 53 | ||
54 | void __init davinci_init_common_hw(void) | 54 | #define BETWEEN(p, st, sz) ((p) >= (st) && (p) < ((st) + (sz))) |
55 | #define XLATE(p, pst, vst) ((void __iomem *)((p) - (pst) + (vst))) | ||
56 | |||
57 | /* | ||
58 | * Intercept ioremap() requests for addresses in our fixed mapping regions. | ||
59 | */ | ||
60 | void __iomem *davinci_ioremap(unsigned long p, size_t size, unsigned int type) | ||
61 | { | ||
62 | if (BETWEEN(p, IO_PHYS, IO_SIZE)) | ||
63 | return XLATE(p, IO_PHYS, IO_VIRT); | ||
64 | |||
65 | return __arm_ioremap(p, size, type); | ||
66 | } | ||
67 | EXPORT_SYMBOL(davinci_ioremap); | ||
68 | |||
69 | void davinci_iounmap(volatile void __iomem *addr) | ||
55 | { | 70 | { |
71 | unsigned long virt = (unsigned long)addr; | ||
72 | |||
73 | if (virt >= VMALLOC_START && virt < VMALLOC_END) | ||
74 | __iounmap(addr); | ||
56 | } | 75 | } |
76 | EXPORT_SYMBOL(davinci_iounmap); | ||