diff options
author | Dan Williams <dan.j.williams@intel.com> | 2007-02-13 11:11:04 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2007-02-14 10:21:21 -0500 |
commit | 6df26700c0884cb3cce2b9fa4795888f86ca4d8f (patch) | |
tree | 30444218ed615b3eb0569d8602be3e522a2d8895 /arch/arm/plat-iop/io.c | |
parent | ae0a846e411dc0b568e8ccda584896310ee5f369 (diff) |
[ARM] 4182/1: iop3xx: fix the ioremap implementation to not remap static ranges
Implement a custom ioremap implementation for iop3xx. This saves
establishing new mappings. It also cleans up the PCI IO resource to be a
physical address rather than a virtual address as Russell pointed out on
the original iop13xx port.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/plat-iop/io.c')
-rw-r--r-- | arch/arm/plat-iop/io.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/arch/arm/plat-iop/io.c b/arch/arm/plat-iop/io.c new file mode 100644 index 000000000000..f7eccecf2e47 --- /dev/null +++ b/arch/arm/plat-iop/io.c | |||
@@ -0,0 +1,58 @@ | |||
1 | /* | ||
2 | * iop3xx custom ioremap implementation | ||
3 | * Copyright (c) 2006, Intel Corporation. | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it | ||
6 | * under the terms and conditions of the GNU General Public License, | ||
7 | * version 2, as published by the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
12 | * more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License along with | ||
15 | * this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
16 | * Place - Suite 330, Boston, MA 02111-1307 USA. | ||
17 | * | ||
18 | */ | ||
19 | #include <linux/kernel.h> | ||
20 | #include <linux/module.h> | ||
21 | #include <asm/hardware.h> | ||
22 | #include <asm/io.h> | ||
23 | |||
24 | void * __iomem __iop3xx_ioremap(unsigned long cookie, size_t size, | ||
25 | unsigned long flags) | ||
26 | { | ||
27 | void __iomem * retval; | ||
28 | |||
29 | switch (cookie) { | ||
30 | case IOP3XX_PCI_LOWER_IO_PA ... IOP3XX_PCI_UPPER_IO_PA: | ||
31 | retval = (void *) IOP3XX_PCI_IO_PHYS_TO_VIRT(cookie); | ||
32 | break; | ||
33 | case IOP3XX_PERIPHERAL_PHYS_BASE ... IOP3XX_PERIPHERAL_UPPER_PA: | ||
34 | retval = (void *) IOP3XX_PMMR_PHYS_TO_VIRT(cookie); | ||
35 | break; | ||
36 | default: | ||
37 | retval = __ioremap(cookie, size, flags); | ||
38 | } | ||
39 | |||
40 | return retval; | ||
41 | } | ||
42 | EXPORT_SYMBOL(__iop3xx_ioremap); | ||
43 | |||
44 | void __iop3xx_iounmap(void __iomem *addr) | ||
45 | { | ||
46 | extern void __iounmap(volatile void __iomem *addr); | ||
47 | |||
48 | switch ((u32) addr) { | ||
49 | case IOP3XX_PCI_LOWER_IO_VA ... IOP3XX_PCI_UPPER_IO_VA: | ||
50 | case IOP3XX_PERIPHERAL_VIRT_BASE ... IOP3XX_PERIPHERAL_UPPER_VA: | ||
51 | goto skip; | ||
52 | } | ||
53 | __iounmap(addr); | ||
54 | |||
55 | skip: | ||
56 | return; | ||
57 | } | ||
58 | EXPORT_SYMBOL(__iop3xx_iounmap); | ||