diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-22 10:38:37 -0500 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-22 10:38:37 -0500 |
commit | fcc9d2e5a6c89d22b8b773a64fb4ad21ac318446 (patch) | |
tree | a57612d1888735a2ec7972891b68c1ac5ec8faea /arch/arm/mach-ixp23xx/include/mach/io.h | |
parent | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (diff) |
Diffstat (limited to 'arch/arm/mach-ixp23xx/include/mach/io.h')
-rw-r--r-- | arch/arm/mach-ixp23xx/include/mach/io.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/arch/arm/mach-ixp23xx/include/mach/io.h b/arch/arm/mach-ixp23xx/include/mach/io.h new file mode 100644 index 00000000000..a1749d0fd89 --- /dev/null +++ b/arch/arm/mach-ixp23xx/include/mach/io.h | |||
@@ -0,0 +1,52 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-ixp23xx/include/mach/io.h | ||
3 | * | ||
4 | * Original Author: Naeem M Afzal <naeem.m.afzal@intel.com> | ||
5 | * Maintainer: Deepak Saxena <dsaxena@plexity.net> | ||
6 | * | ||
7 | * Copyright (C) 2003-2005 Intel Corp. | ||
8 | * Copyright (C) 2005 MontaVista Software, Inc | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2 as | ||
12 | * published by the Free Software Foundation. | ||
13 | */ | ||
14 | |||
15 | #ifndef __ASM_ARCH_IO_H | ||
16 | #define __ASM_ARCH_IO_H | ||
17 | |||
18 | #define IO_SPACE_LIMIT 0xffffffff | ||
19 | |||
20 | #define __io(p) ((void __iomem*)((p) + IXP23XX_PCI_IO_VIRT)) | ||
21 | #define __mem_pci(a) (a) | ||
22 | |||
23 | static inline void __iomem * | ||
24 | ixp23xx_ioremap(unsigned long addr, unsigned long size, unsigned int mtype) | ||
25 | { | ||
26 | if (addr >= IXP23XX_PCI_MEM_START && | ||
27 | addr <= IXP23XX_PCI_MEM_START + IXP23XX_PCI_MEM_SIZE) { | ||
28 | if (addr + size > IXP23XX_PCI_MEM_START + IXP23XX_PCI_MEM_SIZE) | ||
29 | return NULL; | ||
30 | |||
31 | return (void __iomem *) | ||
32 | ((addr - IXP23XX_PCI_MEM_START) + IXP23XX_PCI_MEM_VIRT); | ||
33 | } | ||
34 | |||
35 | return __arm_ioremap(addr, size, mtype); | ||
36 | } | ||
37 | |||
38 | static inline void | ||
39 | ixp23xx_iounmap(void __iomem *addr) | ||
40 | { | ||
41 | if ((((u32)addr) >= IXP23XX_PCI_MEM_VIRT) && | ||
42 | (((u32)addr) < IXP23XX_PCI_MEM_VIRT + IXP23XX_PCI_MEM_SIZE)) | ||
43 | return; | ||
44 | |||
45 | __iounmap(addr); | ||
46 | } | ||
47 | |||
48 | #define __arch_ioremap ixp23xx_ioremap | ||
49 | #define __arch_iounmap ixp23xx_iounmap | ||
50 | |||
51 | |||
52 | #endif | ||