diff options
author | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-07 18:40:39 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-07 18:40:39 -0500 |
commit | ea14fad0d416354a4e9bb1a04f32acba706f9548 (patch) | |
tree | 2c8acc5331f189aef1d40ddce3f40d6be9314e77 /arch/arm/mach-iop13xx/io.c | |
parent | 6ee7e78e7c78d871409ad4df30551c9355be7d0e (diff) | |
parent | 6705cda24fad1cb0ac82ac4f312df8ec735b39b0 (diff) |
Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm: (76 commits)
[ARM] 4002/1: S3C24XX: leave parent IRQs unmasked
[ARM] 4001/1: S3C24XX: shorten reboot time
[ARM] 3983/2: remove unused argument to __bug()
[ARM] 4000/1: Osiris: add third serial port in
[ARM] 3999/1: RX3715: suspend to RAM support
[ARM] 3998/1: VR1000: LED platform devices
[ARM] 3995/1: iop13xx: add iop13xx support
[ARM] 3968/1: iop13xx: add iop13xx_defconfig
[ARM] Update mach-types
[ARM] Allow gcc to optimise arm_add_memory a little more
[ARM] 3991/1: i.MX/MX1 high resolution time source
[ARM] 3990/1: i.MX/MX1 more precise PLL decode
[ARM] 3986/1: H1940: suspend to RAM support
[ARM] 3985/1: ixp4xx clocksource cleanup
[ARM] 3984/1: ixp4xx/nslu2: Fix disk LED numbering (take 2)
[ARM] 3994/1: ixp23xx: fix handling of pci master aborts
[ARM] 3981/1: sched_clock for PXA2xx
[ARM] 3980/1: extend the ARM Versatile sched_clock implementation from 32 to 63 bit
[ARM] 3979/1: extend the SA11x0 sched_clock implementation from 32 to 63 bit period
[ARM] 3978/1: macro to provide a 63-bit value from a 32-bit hardware counter
...
Diffstat (limited to 'arch/arm/mach-iop13xx/io.c')
-rw-r--r-- | arch/arm/mach-iop13xx/io.c | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/arch/arm/mach-iop13xx/io.c b/arch/arm/mach-iop13xx/io.c new file mode 100644 index 000000000000..fbf9f88e46ea --- /dev/null +++ b/arch/arm/mach-iop13xx/io.c | |||
@@ -0,0 +1,93 @@ | |||
1 | /* | ||
2 | * iop13xx custom ioremap implementation | ||
3 | * Copyright (c) 2005-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 __iop13xx_ioremap(unsigned long cookie, size_t size, | ||
25 | unsigned long flags) | ||
26 | { | ||
27 | void __iomem * retval; | ||
28 | |||
29 | switch (cookie) { | ||
30 | case IOP13XX_PCIX_LOWER_MEM_RA ... IOP13XX_PCIX_UPPER_MEM_RA: | ||
31 | if (unlikely(!iop13xx_atux_mem_base)) | ||
32 | retval = NULL; | ||
33 | else | ||
34 | retval = (void *)(iop13xx_atux_mem_base + | ||
35 | (cookie - IOP13XX_PCIX_LOWER_MEM_RA)); | ||
36 | break; | ||
37 | case IOP13XX_PCIE_LOWER_MEM_RA ... IOP13XX_PCIE_UPPER_MEM_RA: | ||
38 | if (unlikely(!iop13xx_atue_mem_base)) | ||
39 | retval = NULL; | ||
40 | else | ||
41 | retval = (void *)(iop13xx_atue_mem_base + | ||
42 | (cookie - IOP13XX_PCIE_LOWER_MEM_RA)); | ||
43 | break; | ||
44 | case IOP13XX_PBI_LOWER_MEM_RA ... IOP13XX_PBI_UPPER_MEM_RA: | ||
45 | retval = __ioremap(IOP13XX_PBI_LOWER_MEM_PA + | ||
46 | (cookie - IOP13XX_PBI_LOWER_MEM_RA), | ||
47 | size, flags); | ||
48 | break; | ||
49 | case IOP13XX_PCIE_LOWER_IO_PA ... IOP13XX_PCIE_UPPER_IO_PA: | ||
50 | retval = (void *) IOP13XX_PCIE_IO_PHYS_TO_VIRT(cookie); | ||
51 | break; | ||
52 | case IOP13XX_PCIX_LOWER_IO_PA ... IOP13XX_PCIX_UPPER_IO_PA: | ||
53 | retval = (void *) IOP13XX_PCIX_IO_PHYS_TO_VIRT(cookie); | ||
54 | break; | ||
55 | case IOP13XX_PMMR_PHYS_MEM_BASE ... IOP13XX_PMMR_UPPER_MEM_PA: | ||
56 | retval = (void *) IOP13XX_PMMR_PHYS_TO_VIRT(cookie); | ||
57 | break; | ||
58 | default: | ||
59 | retval = __ioremap(cookie, size, flags); | ||
60 | } | ||
61 | |||
62 | return retval; | ||
63 | } | ||
64 | EXPORT_SYMBOL(__iop13xx_ioremap); | ||
65 | |||
66 | void __iop13xx_iounmap(void __iomem *addr) | ||
67 | { | ||
68 | extern void __iounmap(volatile void __iomem *addr); | ||
69 | |||
70 | if (iop13xx_atue_mem_base) | ||
71 | if (addr >= (void __iomem *) iop13xx_atue_mem_base && | ||
72 | addr < (void __iomem *) (iop13xx_atue_mem_base + | ||
73 | iop13xx_atue_mem_size)) | ||
74 | goto skip; | ||
75 | |||
76 | if (iop13xx_atux_mem_base) | ||
77 | if (addr >= (void __iomem *) iop13xx_atux_mem_base && | ||
78 | addr < (void __iomem *) (iop13xx_atux_mem_base + | ||
79 | iop13xx_atux_mem_size)) | ||
80 | goto skip; | ||
81 | |||
82 | switch ((u32) addr) { | ||
83 | case IOP13XX_PCIE_LOWER_IO_VA ... IOP13XX_PCIE_UPPER_IO_VA: | ||
84 | case IOP13XX_PCIX_LOWER_IO_VA ... IOP13XX_PCIX_UPPER_IO_VA: | ||
85 | case IOP13XX_PMMR_VIRT_MEM_BASE ... IOP13XX_PMMR_UPPER_MEM_VA: | ||
86 | goto skip; | ||
87 | } | ||
88 | __iounmap(addr); | ||
89 | |||
90 | skip: | ||
91 | return; | ||
92 | } | ||
93 | EXPORT_SYMBOL(__iop13xx_iounmap); | ||