diff options
Diffstat (limited to 'arch/arm/mach-davinci/io.c')
-rw-r--r-- | arch/arm/mach-davinci/io.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/arch/arm/mach-davinci/io.c b/arch/arm/mach-davinci/io.c index 299515f70b8b..a548abb513e2 100644 --- a/arch/arm/mach-davinci/io.c +++ b/arch/arm/mach-davinci/io.c | |||
@@ -51,7 +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 | { |
56 | davinci_clk_init(); | 71 | unsigned long virt = (unsigned long)addr; |
72 | |||
73 | if (virt >= VMALLOC_START && virt < VMALLOC_END) | ||
74 | __iounmap(addr); | ||
57 | } | 75 | } |
76 | EXPORT_SYMBOL(davinci_iounmap); | ||