imx: provide helper macro to define IO_ADDRESS
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Wed, 16 Dec 2009 18:05:04 +0000 (19:05 +0100)
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Fri, 8 Jan 2010 15:41:23 +0000 (16:41 +0100)
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Sascha Hauer <kernel@pengutronix.de>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Holger Schurig <hs4233@mail.mn-solutions.de>
Cc: Dmitriy Taychenachev <dimichxp@gmail.com>
arch/arm/plat-mxc/include/mach/hardware.h

index 78db75475f693dbc6debf070b98345dee1e75d6c..db14c56930a3abb200f75803fa720791317c97c1 100644 (file)
 
 #include <asm/sizes.h>
 
+#define IMX_IO_ADDRESS(addr, module)                                   \
+       ((void __force __iomem *)                                       \
+        (((unsigned long)((addr) - (module ## _BASE_ADDR)) < module ## _SIZE) ?\
+        (addr) - (module ## _BASE_ADDR) + (module ## _BASE_ADDR_VIRT) : 0))
+
 #ifdef CONFIG_ARCH_MX3
 #include <mach/mx3x.h>
 #include <mach/mx31.h>