14
14
/* Allow IO space to be anywhere in the memory */
15
15
#define IO_SPACE_LIMIT 0xffffffff
17
#if defined(CONFIG_SOC_IMX31) || defined(CONFIG_SOC_IMX35)
18
#include <mach/hardware.h>
20
17
#define __arch_ioremap __imx_ioremap
21
18
#define __arch_iounmap __iounmap
23
20
#define addr_in_module(addr, mod) \
24
21
((unsigned long)(addr) - mod ## _BASE_ADDR < mod ## _SIZE)
23
extern void __iomem *(*imx_ioremap)(unsigned long, size_t, unsigned int);
26
25
static inline void __iomem *
27
26
__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
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);
28
if (imx_ioremap != NULL)
29
return imx_ioremap(phys_addr, size, mtype);
31
return __arm_ioremap(phys_addr, size, mtype);
44
34
/* io address mapping macro */
45
35
#define __io(a) __typesafe_io(a)