aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-mxc/include/mach/hardware.h
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-10-25 05:40:30 -0400
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-11-17 02:58:08 -0500
commitf5d7a13b18706c3328c6aac3bf782a13cabf255a (patch)
treea8d10eb1e6eadb98557970fb1a5d47f992b0cd95 /arch/arm/plat-mxc/include/mach/hardware.h
parent9651b7db59893e796dfdd170485543b9863be9d8 (diff)
ARM: imx: refactor the io mapping macro
This makes it more assembler friendly and allows it to be used in situation that need an unsigned long and not a pointer. Also the naming is clearer. IOMEM is introduced without IMX_ prefix as it is used this way in more than one ARM subarch and it might become globally available soon. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'arch/arm/plat-mxc/include/mach/hardware.h')
-rw-r--r--arch/arm/plat-mxc/include/mach/hardware.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/arch/arm/plat-mxc/include/mach/hardware.h b/arch/arm/plat-mxc/include/mach/hardware.h
index ebadf4ac43fc..4bbe50612d14 100644
--- a/arch/arm/plat-mxc/include/mach/hardware.h
+++ b/arch/arm/plat-mxc/include/mach/hardware.h
@@ -22,10 +22,15 @@
22 22
23#include <asm/sizes.h> 23#include <asm/sizes.h>
24 24
25#define IMX_IO_ADDRESS(addr, module) \ 25#ifdef __ASSEMBLER__
26 ((void __force __iomem *) \ 26#define IOMEM(addr) (addr)
27 (((unsigned long)((addr) - (module ## _BASE_ADDR)) < module ## _SIZE) ?\ 27#else
28 (addr) - (module ## _BASE_ADDR) + (module ## _BASE_ADDR_VIRT) : 0)) 28#define IOMEM(addr) ((void __force __iomem *)(addr))
29#endif
30
31#define IMX_IO_P2V_MODULE(addr, module) \
32 (((addr) - module ## _BASE_ADDR) < module ## _SIZE ? \
33 (addr) - (module ## _BASE_ADDR) + (module ## _BASE_ADDR_VIRT) : 0)
29 34
30#ifdef CONFIG_ARCH_MX5 35#ifdef CONFIG_ARCH_MX5
31#include <mach/mx51.h> 36#include <mach/mx51.h>