]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ARM: create a common IOMEM definition
authorRob Herring <rob.herring@calxeda.com>
Sat, 10 Mar 2012 16:30:31 +0000 (10:30 -0600)
committerRob Herring <rob.herring@calxeda.com>
Wed, 14 Mar 2012 02:22:09 +0000 (21:22 -0500)
Several platforms create IOMEM defines for casting to 'void __iomem *',
and other platforms are incorrectly using __io() macro for the same
purpose. This creates a common definition and removes all the platform
specific versions. Rather than try to make linux/io.h and asm/io.h
assembly safe, the assembly version of IOMEM is moved into
asm/assembler.h.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Sekhar Nori <nsekhar@ti.com>
Cc: Kevin Hilman <khilman@ti.com>
Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ryan Mallon <rmallon@gmail.com>
Cc: Eric Miao <eric.y.miao@gmail.com>
Cc: Haojian Zhuang <haojian.zhuang@marvell.com>
Acked-by: David Brown <davidb@codeaurora.org>
Cc: Daniel Walker <dwalker@fifo99.com>
Cc: Bryan Huntsman <bryanh@codeaurora.org>
Cc: Sascha Hauer <kernel@pengutronix.de>
Cc: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Tony Lindgren <tony@atomide.com>
Acked-by: Paul Walmsley <paul@pwsan.com>
Acked-by: Viresh Kumar <viresh.kumar@st.com>
Cc: Rajeev Kumar <rajeev-dlh.kumar@st.com>
Cc: Colin Cross <ccross@android.com>
Cc: Olof Johansson <olof@lixom.net>
Cc: Stephen Warren <swarren@nvidia.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
25 files changed:
arch/arm/include/asm/assembler.h
arch/arm/include/asm/io.h
arch/arm/kernel/debug.S
arch/arm/kernel/entry-armv.S
arch/arm/mach-davinci/include/mach/hardware.h
arch/arm/mach-davinci/include/mach/uncompress.h
arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
arch/arm/mach-mmp/include/mach/addr-map.h
arch/arm/mach-msm/include/mach/msm_iomap-7x00.h
arch/arm/mach-msm/include/mach/msm_iomap.h
arch/arm/mach-mxs/include/mach/hardware.h
arch/arm/mach-omap1/ams-delta-fiq-handler.S
arch/arm/mach-omap1/iomap.h
arch/arm/mach-omap2/clock3xxx_data.c
arch/arm/mach-omap2/clock44xx_data.c
arch/arm/mach-omap2/iomap.h
arch/arm/mach-rpc/include/mach/hardware.h
arch/arm/mach-spear3xx/clock.c
arch/arm/mach-spear6xx/clock.c
arch/arm/mach-tegra/include/mach/iomap.h
arch/arm/mach-u300/include/mach/u300-regs.h
arch/arm/plat-mxc/include/mach/hardware.h
arch/arm/plat-omap/include/plat/hardware.h
arch/arm/plat-omap/include/plat/usb.h
arch/arm/plat-spear/include/plat/hardware.h

index 62f8095d46de8f4f2b4fad93c4338ac5df54fa7e..88374dd30fb9f836b12c8ffa41d9247bcda504b2 100644 (file)
@@ -23,6 +23,8 @@
 #include <asm/ptrace.h>
 #include <asm/domain.h>
 
+#define IOMEM(x)       (x)
+
 /*
  * Endian independent macros for shifting bytes within registers.
  */
index 11d2072f95d10657d01f60d0e711f251bd4534d6..35d91406af65f9e926823ef9de6de90bb69c3248 100644 (file)
@@ -102,6 +102,8 @@ static inline void __iomem *__typesafe_io(unsigned long addr)
        return (void __iomem *)addr;
 }
 
+#define IOMEM(x)       ((void __force __iomem *)(x))
+
 /* IO barriers */
 #ifdef CONFIG_ARM_DMA_MEM_BUFFERABLE
 #define __iormb()              rmb()
index 204e2160cfccbdd5fa88a00285086d73a522ebcb..501cdbfc902c3b7968caa450b887ac496abd5ed7 100644 (file)
@@ -10,6 +10,7 @@
  *  32-bit debugging code
  */
 #include <linux/linkage.h>
+#include <asm/assembler.h>
 
                .text
 
index 22f0ed324f370b904279a349167ceba3a5ec8c5a..395f6271dfc268c3e5d2f92c44e9860a062192e7 100644 (file)
@@ -15,6 +15,7 @@
  *  that causes it to save wrong values...  Be aware!
  */
 
+#include <asm/assembler.h>
 #include <asm/memory.h>
 #include <asm/glue-df.h>
 #include <asm/glue-pf.h>
index 414e0b93e741f5a8bd1ce8c76b88ebf5ca8a6bcd..0be260bff9d5f73f9b846866c2ca9a4cdb7192fd 100644 (file)
 #define __IO_ADDRESS(x)                        ((x) + IO_OFFSET)
 #define IO_ADDRESS(pa)                 IOMEM(__IO_ADDRESS(pa))
 
-#ifdef __ASSEMBLER__
-#define IOMEM(x)                       x
-#else
-#define IOMEM(x)                       ((void __force __iomem *)(x))
-#endif
-
 #endif /* __ASM_ARCH_HARDWARE_H */
index 9dc7cf9664feefcf6816c4246fa69921140bf612..da2fb2c2155a2ac84d242ad76c4de2842aa33d31 100644 (file)
@@ -25,6 +25,8 @@
 
 #include <mach/serial.h>
 
+#define IOMEM(x)       ((void __force __iomem *)(x))
+
 u32 *uart;
 
 /* PORT_16C550A, in polled non-fifo mode */
index e711d0e021c7212d2c581cbedc0637256bd160ec..c4a7b84ef06da131481d8e673ed11e30067fa2ad 100644 (file)
@@ -5,15 +5,6 @@
 #ifndef __ASM_ARCH_EP93XX_REGS_H
 #define __ASM_ARCH_EP93XX_REGS_H
 
-/*
- * A typesafe __io() variation for variable initialisers
- */
-#ifdef __ASSEMBLER__
-#define IOMEM(p)                p
-#else
-#define IOMEM(p)                ((void __iomem __force *)(p))
-#endif
-
 /*
  * EP93xx Physical Memory Map:
  *
index 3e404acd6ff4d8af83944256026a7d0c11a419f3..b1ece08174e8bde11d5b8c8f48ab69673c04d3ae 100644 (file)
 #ifndef __ASM_MACH_ADDR_MAP_H
 #define __ASM_MACH_ADDR_MAP_H
 
-#ifndef __ASSEMBLER__
-#define IOMEM(x)       ((void __iomem *)(x))
-#else
-#define IOMEM(x)       (x)
-#endif
-
 /* APB - Application Subsystem Peripheral Bus
  *
  * NOTE: the DMA controller registers are actually on the AXI fabric #1
index 152b3b70afabc76e1594c13e9f2122bd98381e41..6c4046c21296c976e7352a8c260bf661be090324 100644 (file)
  *
  */
 
-#ifdef __ASSEMBLY__
-#define IOMEM(x)       x
-#else
-#define IOMEM(x)       ((void __force __iomem *)(x))
-#endif
-
 #define MSM_VIC_BASE          IOMEM(0xE0000000)
 #define MSM_VIC_PHYS          0xC0000000
 #define MSM_VIC_SIZE          SZ_4K
index 90682f4599d3dd4842e18129781e949952e237ef..00afdfb8c38fe24eacc2d0c87709fe448b06eed0 100644 (file)
  *
  */
 
-#ifdef __ASSEMBLY__
-#define IOMEM(x)       x
-#else
-#define IOMEM(x)       ((void __force __iomem *)(x))
-#endif
-
 #if defined(CONFIG_ARCH_MSM7X30)
 #include "msm_iomap-7x30.h"
 #elif defined(CONFIG_ARCH_QSD8X50)
index 53e89a09bf0d9fae62e8721ace3047ba346803bc..4c0e8a64d8c74559d80d0d4b586bf5d977b64b4a 100644 (file)
 #ifndef __MACH_MXS_HARDWARE_H__
 #define __MACH_MXS_HARDWARE_H__
 
-#ifdef __ASSEMBLER__
-#define IOMEM(addr)    (addr)
-#else
-#define IOMEM(addr)    ((void __force __iomem *)(addr))
-#endif
-
 #endif /* __MACH_MXS_HARDWARE_H__ */
index 399c4c49722f91b093a05322bcd8bfb7dd64ed0b..a051cb8ae57fc2a67e943479150d7d11af260fc7 100644 (file)
@@ -14,6 +14,7 @@
  */
 
 #include <linux/linkage.h>
+#include <asm/assembler.h>
 
 #include <plat/board-ams-delta.h>
 
index d68175761c3d4fa399810ae51d04a86e90ba237f..330c4716b028e5eabc8b4fd8c025d40c60c0e876 100644 (file)
  * 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#ifdef __ASSEMBLER__
-#define IOMEM(x)               (x)
-#else
-#define IOMEM(x)               ((void __force __iomem *)(x))
-#endif
-
 #define OMAP1_IO_OFFSET                0x01000000      /* Virtual IO = 0xfefb0000 */
 #define OMAP1_IO_ADDRESS(pa)   IOMEM((pa) - OMAP1_IO_OFFSET)
 
index 981b9f9111a417e959aec8e111bce0e61238e9be..480fb8f09aeda407a1578e521483768e48c9784c 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/kernel.h>
 #include <linux/clk.h>
 #include <linux/list.h>
+#include <linux/io.h>
 
 #include <plat/hardware.h>
 #include <plat/clkdev_omap.h>
index 79b98f22f207825c896dddac914f8e7a0536dea1..c03c1108468e1a59f5f203de7d092928e06bae79 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/kernel.h>
 #include <linux/list.h>
 #include <linux/clk.h>
+#include <linux/io.h>
 
 #include <plat/hardware.h>
 #include <plat/clkdev_omap.h>
index e6f958165296963af5776dd117b5ed22f1027a58..0812b154f5b5aa109ea3c5957e05b111be819793 100644 (file)
  * 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#ifdef __ASSEMBLER__
-#define IOMEM(x)               (x)
-#else
-#define IOMEM(x)               ((void __force __iomem *)(x))
-#endif
-
 #define OMAP2_L3_IO_OFFSET     0x90000000
 #define OMAP2_L3_IO_ADDRESS(pa)        IOMEM((pa) + OMAP2_L3_IO_OFFSET) /* L3 */
 
index 050d63c74cc10eabf776429875a301c70f17fe81..257166b21f3d8216f07e1f61999a7eb1d1105812 100644 (file)
 
 #include <mach/memory.h>
 
-#ifndef __ASSEMBLY__
-#define IOMEM(x) ((void __iomem *)(unsigned long)(x))
-#else
-#define IOMEM(x) x
-#endif /* __ASSEMBLY__ */
-
 /*
  * What hardware must be present
  */
index f67860cd649f3df1ee009425d5938feaf9fa0784..6c4841f5522345cb9cdf5c1e5d83cd332adfc644 100644 (file)
@@ -12,6 +12,7 @@
  */
 
 #include <linux/init.h>
+#include <linux/io.h>
 #include <linux/kernel.h>
 #include <asm/mach-types.h>
 #include <plat/clock.h>
index ac70e0d88fef8a7a7616573788c9fdb727c252c4..9281cf88a14afafd9a34d6e6cfeef43d337369ee 100644 (file)
@@ -12,6 +12,7 @@
  */
 
 #include <linux/init.h>
+#include <linux/io.h>
 #include <linux/kernel.h>
 #include <plat/clock.h>
 #include <mach/misc_regs.h>
index 082b4d16780121c00aa443e50bfdbca6e6f62ea0..c05b311ee4f7d13323f2fe744da479c629d3f432 100644 (file)
  *
  */
 
-#ifdef __ASSEMBLY__
-#define IOMEM(x)       (x)
-#else
-#define IOMEM(x)       ((void __force __iomem *)(x))
-#endif
-
 #define IO_IRAM_PHYS   0x40000000
 #define IO_IRAM_VIRT   IOMEM(0xFE400000)
 #define IO_IRAM_SIZE   SZ_256K
index 035fdc9dbdb03ebb50e88873a67232707d4fbc50..7b7cba960b690945fbd9830e893eb3c27ade58c8 100644 (file)
  * the defines are used for setting up the I/O memory mapping.
  */
 
-#ifdef __ASSEMBLER__
-#define IOMEM(a) (a)
-#else
-#define IOMEM(a) (void __iomem *) a
-#endif
-
 /* NAND Flash CS0 */
 #define U300_NAND_CS0_PHYS_BASE                0x80000000
 
index ca06a686446f14171e886200998b6274740920a7..0630513554def1f851ea708fabd484dbf50deec6 100644 (file)
 
 #include <asm/sizes.h>
 
-#ifdef __ASSEMBLER__
-#define IOMEM(addr)    (addr)
-#else
-#define IOMEM(addr)    ((void __force __iomem *)(addr))
-#endif
-
 #define addr_in_module(addr, mod) \
        ((unsigned long)(addr) - mod ## _BASE_ADDR < mod ## _SIZE)
 
index 537b05ae1f51aaba0380b6186b7be9542ac9c667..e897978371c2719167eb7bfbe2625dc5d7bc6fdf 100644 (file)
 #endif
 #include <plat/serial.h>
 
-#ifdef __ASSEMBLER__
-#define IOMEM(x)               (x)
-#else
-#define IOMEM(x)               ((void __force __iomem *)(x))
-#endif
-
 /*
  * ---------------------------------------------------------------------------
  * Common definitions for all OMAP processors
index d0fc9f4dc155b1bc2e32e256004c36e0ffaca9c7..762eeb0626c128fd5c40bbb97daff230ef881466 100644 (file)
@@ -112,7 +112,6 @@ extern int omap4430_phy_suspend(struct device *dev, int suspend);
  */
 
 #define OMAP2_L4_IO_OFFSET     0xb2000000
-#define IOMEM(x)               ((void __force __iomem *)(x))
 #define OMAP2_L4_IO_ADDRESS(pa)        IOMEM((pa) + OMAP2_L4_IO_OFFSET)
 
 static inline u8 omap_readb(u32 pa)
index 66d677225d155c0e4a09c6d1a8a54f22f1ad8122..70187d763e26f7ff0e5c32dee2f483db03510e21 100644 (file)
 #ifndef __PLAT_HARDWARE_H
 #define __PLAT_HARDWARE_H
 
-#ifndef __ASSEMBLY__
-#define IOMEM(x)       ((void __iomem __force *)(x))
-#else
-#define IOMEM(x)       (x)
-#endif
-
 #endif /* __PLAT_HARDWARE_H */