aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Hałasa <khc@pm.waw.pl>2009-11-14 19:25:06 -0500
committerKrzysztof Hałasa <khc@pm.waw.pl>2009-12-05 10:58:39 -0500
commitcba362221b12b102dff1f21b291fdc7b93e24a18 (patch)
tree4cd021ffb805b601292ab785b84c92ea48529fae
parent58e570d1182a9dc3bc52d8dc508c6bd5b2d279c7 (diff)
IXP4xx: Fix compilation failure with CONFIG_IXP4XX_INDIRECT_PCI.
Instead of including the heavy linux/mm.h for VMALLOC_START, test the addresses against PCI MIN and MAX addresses. Indirect PCI uses 1:1 mapping for MMIO space making this change possible. Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
-rw-r--r--arch/arm/mach-ixp4xx/include/mach/io.h23
1 files changed, 15 insertions, 8 deletions
diff --git a/arch/arm/mach-ixp4xx/include/mach/io.h b/arch/arm/mach-ixp4xx/include/mach/io.h
index c06d4a2911a6..0e601fe50162 100644
--- a/arch/arm/mach-ixp4xx/include/mach/io.h
+++ b/arch/arm/mach-ixp4xx/include/mach/io.h
@@ -55,10 +55,16 @@ extern int ixp4xx_pci_write(u32 addr, u32 cmd, u32 data);
55 * access registers. If something outside of PCI is ioremap'd, we 55 * access registers. If something outside of PCI is ioremap'd, we
56 * fallback to the default. 56 * fallback to the default.
57 */ 57 */
58
59static inline int is_pci_memory(u32 addr)
60{
61 return (addr >= PCIBIOS_MIN_MEM) && (addr <= 0x4FFFFFFF);
62}
63
58static inline void __iomem * __indirect_ioremap(unsigned long addr, size_t size, 64static inline void __iomem * __indirect_ioremap(unsigned long addr, size_t size,
59 unsigned int mtype) 65 unsigned int mtype)
60{ 66{
61 if((addr < PCIBIOS_MIN_MEM) || (addr > 0x4fffffff)) 67 if (!is_pci_memory(addr))
62 return __arm_ioremap(addr, size, mtype); 68 return __arm_ioremap(addr, size, mtype);
63 69
64 return (void __iomem *)addr; 70 return (void __iomem *)addr;
@@ -66,7 +72,7 @@ static inline void __iomem * __indirect_ioremap(unsigned long addr, size_t size,
66 72
67static inline void __indirect_iounmap(void __iomem *addr) 73static inline void __indirect_iounmap(void __iomem *addr)
68{ 74{
69 if ((__force u32)addr >= VMALLOC_START) 75 if (!is_pci_memory((__force u32)addr))
70 __iounmap(addr); 76 __iounmap(addr);
71} 77}
72 78
@@ -94,7 +100,7 @@ static inline void __indirect_writeb(u8 value, volatile void __iomem *p)
94 u32 addr = (u32)p; 100 u32 addr = (u32)p;
95 u32 n, byte_enables, data; 101 u32 n, byte_enables, data;
96 102
97 if (addr >= VMALLOC_START) { 103 if (!is_pci_memory(addr)) {
98 __raw_writeb(value, addr); 104 __raw_writeb(value, addr);
99 return; 105 return;
100 } 106 }
@@ -117,7 +123,7 @@ static inline void __indirect_writew(u16 value, volatile void __iomem *p)
117 u32 addr = (u32)p; 123 u32 addr = (u32)p;
118 u32 n, byte_enables, data; 124 u32 n, byte_enables, data;
119 125
120 if (addr >= VMALLOC_START) { 126 if (!is_pci_memory(addr)) {
121 __raw_writew(value, addr); 127 __raw_writew(value, addr);
122 return; 128 return;
123 } 129 }
@@ -138,7 +144,8 @@ static inline void __indirect_writesw(volatile void __iomem *bus_addr,
138static inline void __indirect_writel(u32 value, volatile void __iomem *p) 144static inline void __indirect_writel(u32 value, volatile void __iomem *p)
139{ 145{
140 u32 addr = (__force u32)p; 146 u32 addr = (__force u32)p;
141 if (addr >= VMALLOC_START) { 147
148 if (!is_pci_memory(addr)) {
142 __raw_writel(value, p); 149 __raw_writel(value, p);
143 return; 150 return;
144 } 151 }
@@ -158,7 +165,7 @@ static inline unsigned char __indirect_readb(const volatile void __iomem *p)
158 u32 addr = (u32)p; 165 u32 addr = (u32)p;
159 u32 n, byte_enables, data; 166 u32 n, byte_enables, data;
160 167
161 if (addr >= VMALLOC_START) 168 if (!is_pci_memory(addr))
162 return __raw_readb(addr); 169 return __raw_readb(addr);
163 170
164 n = addr % 4; 171 n = addr % 4;
@@ -181,7 +188,7 @@ static inline unsigned short __indirect_readw(const volatile void __iomem *p)
181 u32 addr = (u32)p; 188 u32 addr = (u32)p;
182 u32 n, byte_enables, data; 189 u32 n, byte_enables, data;
183 190
184 if (addr >= VMALLOC_START) 191 if (!is_pci_memory(addr))
185 return __raw_readw(addr); 192 return __raw_readw(addr);
186 193
187 n = addr % 4; 194 n = addr % 4;
@@ -204,7 +211,7 @@ static inline unsigned long __indirect_readl(const volatile void __iomem *p)
204 u32 addr = (__force u32)p; 211 u32 addr = (__force u32)p;
205 u32 data; 212 u32 data;
206 213
207 if (addr >= VMALLOC_START) 214 if (!is_pci_memory(addr))
208 return __raw_readl(p); 215 return __raw_readl(p);
209 216
210 if (ixp4xx_pci_read(addr, NP_CMD_MEMREAD, &data)) 217 if (ixp4xx_pci_read(addr, NP_CMD_MEMREAD, &data))