ARM: mx3: make ioremap quirk ready for multi-SoC kernels
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / arch / arm / plat-mxc / include / mach / io.h
blob4347a87d2bb0c8cee5f4553c5d4a8c5923d7dd45
1 /*
2 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 */
5 /*
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
11 #ifndef __ASM_ARCH_MXC_IO_H__
12 #define __ASM_ARCH_MXC_IO_H__
14 /* Allow IO space to be anywhere in the memory */
15 #define IO_SPACE_LIMIT 0xffffffff
17 #if defined(CONFIG_SOC_IMX31) || defined(CONFIG_SOC_IMX35)
18 #include <mach/hardware.h>
20 #define __arch_ioremap __imx_ioremap
21 #define __arch_iounmap __iounmap
23 #define addr_in_module(addr, mod) \
24 ((unsigned long)(addr) - mod ## _BASE_ADDR < mod ## _SIZE)
26 static inline void __iomem *
27 __imx_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype)
29 if (mtype == MT_DEVICE && (cpu_is_mx31() || cpu_is_mx35())) {
31 * Access all peripherals below 0x80000000 as nonshared device
32 * on mx3, but leave l2cc alone. Otherwise cache corruptions
33 * can occur.
35 if (phys_addr < 0x80000000 &&
36 !addr_in_module(phys_addr, MX3x_L2CC))
37 mtype = MT_DEVICE_NONSHARED;
40 return __arm_ioremap(phys_addr, size, mtype);
42 #endif
44 /* io address mapping macro */
45 #define __io(a) __typesafe_io(a)
47 #define __mem_pci(a) (a)
49 #endif