Quinn Jensen | 52c543f | 2007-07-09 22:06:53 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved. |
| 3 | */ |
| 4 | |
| 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 | */ |
| 10 | |
Quinn Jensen | 52c543f | 2007-07-09 22:06:53 +0100 | [diff] [blame] | 11 | #ifndef __ASM_ARCH_MXC_IO_H__ |
| 12 | #define __ASM_ARCH_MXC_IO_H__ |
| 13 | |
Robert Schwebel | f304fc4 | 2008-03-28 10:59:08 +0100 | [diff] [blame] | 14 | /* Allow IO space to be anywhere in the memory */ |
Quinn Jensen | 52c543f | 2007-07-09 22:06:53 +0100 | [diff] [blame] | 15 | #define IO_SPACE_LIMIT 0xffffffff |
| 16 | |
Sascha Hauer | eadefef | 2008-10-15 09:50:23 +0200 | [diff] [blame] | 17 | #ifdef CONFIG_ARCH_MX3 |
| 18 | #define __arch_ioremap __mx3_ioremap |
| 19 | #define __arch_iounmap __iounmap |
| 20 | |
| 21 | static inline void __iomem * |
| 22 | __mx3_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype) |
| 23 | { |
| 24 | if (mtype == MT_DEVICE) { |
| 25 | /* Access all peripherals below 0x80000000 as nonshared device |
| 26 | * but leave l2cc alone. |
| 27 | */ |
Sascha Hauer | a244909 | 2008-12-18 11:51:57 +0100 | [diff] [blame] | 28 | if ((phys_addr < 0x80000000) && ((phys_addr < 0x30000000) || |
| 29 | (phys_addr >= 0x30000000 + SZ_1M))) |
Sascha Hauer | eadefef | 2008-10-15 09:50:23 +0200 | [diff] [blame] | 30 | mtype = MT_DEVICE_NONSHARED; |
| 31 | } |
| 32 | |
| 33 | return __arm_ioremap(phys_addr, size, mtype); |
| 34 | } |
| 35 | #endif |
| 36 | |
Robert Schwebel | f304fc4 | 2008-03-28 10:59:08 +0100 | [diff] [blame] | 37 | /* io address mapping macro */ |
Russell King | 0560cf5 | 2008-11-30 11:45:54 +0000 | [diff] [blame] | 38 | #define __io(a) __typesafe_io(a) |
Quinn Jensen | 52c543f | 2007-07-09 22:06:53 +0100 | [diff] [blame] | 39 | |
Russell King | 0560cf5 | 2008-11-30 11:45:54 +0000 | [diff] [blame] | 40 | #define __mem_pci(a) (a) |
Quinn Jensen | 52c543f | 2007-07-09 22:06:53 +0100 | [diff] [blame] | 41 | |
| 42 | #endif |