diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2011-05-07 11:16:00 +0800 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2011-07-28 15:09:26 +0000 |
commit | fb149f9e2835446e02e796081635520b881dc351 (patch) | |
tree | e80f681871748b0bcddaff9383ebed026dd1c55a /arch/arm/mach-at91/setup.c | |
parent | f0051d82a68abcf35418d49db1c82e6f0e514d78 (diff) |
at91: add arch specific ioremap support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Patrice Vilchez <patrice.vilchez@atmel.com>
Diffstat (limited to 'arch/arm/mach-at91/setup.c')
-rw-r--r-- | arch/arm/mach-at91/setup.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c index 816599fce55b..aa64294c7db3 100644 --- a/arch/arm/mach-at91/setup.c +++ b/arch/arm/mach-at91/setup.c @@ -7,6 +7,7 @@ #include <linux/module.h> #include <linux/io.h> +#include <linux/mm.h> #include <asm/mach/map.h> @@ -72,6 +73,24 @@ static struct map_desc at91_io_desc __initdata = { .type = MT_DEVICE, }; +void __iomem *at91_ioremap(unsigned long p, size_t size, unsigned int type) +{ + if (p >= AT91_BASE_SYS && p <= (AT91_BASE_SYS + SZ_16K - 1)) + return (void __iomem *)AT91_IO_P2V(p); + + return __arm_ioremap_caller(p, size, type, __builtin_return_address(0)); +} +EXPORT_SYMBOL(at91_ioremap); + +void at91_iounmap(volatile void __iomem *addr) +{ + unsigned long virt = (unsigned long)addr; + + if (virt >= VMALLOC_START && virt < VMALLOC_END) + __iounmap(addr); +} +EXPORT_SYMBOL(at91_iounmap); + #define AT91_DBGU0 0xfffff200 #define AT91_DBGU1 0xffffee00 |