aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/kernel/iomap.c2
-rw-r--r--arch/powerpc/kernel/pci_64.c30
-rw-r--r--arch/powerpc/platforms/iseries/pci.c3
-rw-r--r--arch/powerpc/platforms/maple/pci.c3
-rw-r--r--arch/powerpc/platforms/powermac/pci.c3
-rw-r--r--include/asm-powerpc/eeh.h15
-rw-r--r--include/asm-powerpc/io.h6
7 files changed, 6 insertions, 56 deletions
diff --git a/arch/powerpc/kernel/iomap.c b/arch/powerpc/kernel/iomap.c
index fd8214caedee..a13a93dfc655 100644
--- a/arch/powerpc/kernel/iomap.c
+++ b/arch/powerpc/kernel/iomap.c
@@ -106,8 +106,6 @@ EXPORT_SYMBOL(iowrite32_rep);
106 106
107void __iomem *ioport_map(unsigned long port, unsigned int len) 107void __iomem *ioport_map(unsigned long port, unsigned int len)
108{ 108{
109 if (!_IO_IS_VALID(port))
110 return NULL;
111 return (void __iomem *) (port+pci_io_base); 109 return (void __iomem *) (port+pci_io_base);
112} 110}
113 111
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index 4c4449be81ce..18cc15468fd6 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -42,14 +42,6 @@
42unsigned long pci_probe_only = 1; 42unsigned long pci_probe_only = 1;
43int pci_assign_all_buses = 0; 43int pci_assign_all_buses = 0;
44 44
45/*
46 * legal IO pages under MAX_ISA_PORT. This is to ensure we don't touch
47 * devices we don't have access to.
48 */
49unsigned long io_page_mask;
50
51EXPORT_SYMBOL(io_page_mask);
52
53#ifdef CONFIG_PPC_MULTIPLATFORM 45#ifdef CONFIG_PPC_MULTIPLATFORM
54static void fixup_resource(struct resource *res, struct pci_dev *dev); 46static void fixup_resource(struct resource *res, struct pci_dev *dev);
55static void do_bus_setup(struct pci_bus *bus); 47static void do_bus_setup(struct pci_bus *bus);
@@ -1104,8 +1096,6 @@ void __init pci_setup_phb_io(struct pci_controller *hose, int primary)
1104 pci_process_ISA_OF_ranges(isa_dn, hose->io_base_phys, 1096 pci_process_ISA_OF_ranges(isa_dn, hose->io_base_phys,
1105 hose->io_base_virt); 1097 hose->io_base_virt);
1106 of_node_put(isa_dn); 1098 of_node_put(isa_dn);
1107 /* Allow all IO */
1108 io_page_mask = -1;
1109 } 1099 }
1110 } 1100 }
1111 1101
@@ -1232,27 +1222,13 @@ static void phbs_remap_io(void)
1232static void __devinit fixup_resource(struct resource *res, struct pci_dev *dev) 1222static void __devinit fixup_resource(struct resource *res, struct pci_dev *dev)
1233{ 1223{
1234 struct pci_controller *hose = pci_bus_to_host(dev->bus); 1224 struct pci_controller *hose = pci_bus_to_host(dev->bus);
1235 unsigned long start, end, mask, offset; 1225 unsigned long offset;
1236 1226
1237 if (res->flags & IORESOURCE_IO) { 1227 if (res->flags & IORESOURCE_IO) {
1238 offset = (unsigned long)hose->io_base_virt - pci_io_base; 1228 offset = (unsigned long)hose->io_base_virt - pci_io_base;
1239 1229
1240 start = res->start += offset; 1230 res->start += offset;
1241 end = res->end += offset; 1231 res->end += offset;
1242
1243 /* Need to allow IO access to pages that are in the
1244 ISA range */
1245 if (start < MAX_ISA_PORT) {
1246 if (end > MAX_ISA_PORT)
1247 end = MAX_ISA_PORT;
1248
1249 start >>= PAGE_SHIFT;
1250 end >>= PAGE_SHIFT;
1251
1252 /* get the range of pages for the map */
1253 mask = ((1 << (end+1)) - 1) ^ ((1 << start) - 1);
1254 io_page_mask |= mask;
1255 }
1256 } else if (res->flags & IORESOURCE_MEM) { 1232 } else if (res->flags & IORESOURCE_MEM) {
1257 res->start += hose->pci_mem_offset; 1233 res->start += hose->pci_mem_offset;
1258 res->end += hose->pci_mem_offset; 1234 res->end += hose->pci_mem_offset;
diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c
index a19833b880e4..5a61c6fdb33a 100644
--- a/arch/powerpc/platforms/iseries/pci.c
+++ b/arch/powerpc/platforms/iseries/pci.c
@@ -45,8 +45,6 @@
45#include "call_pci.h" 45#include "call_pci.h"
46#include "iommu.h" 46#include "iommu.h"
47 47
48extern unsigned long io_page_mask;
49
50/* 48/*
51 * Forward declares of prototypes. 49 * Forward declares of prototypes.
52 */ 50 */
@@ -277,7 +275,6 @@ void iSeries_pcibios_init(void)
277{ 275{
278 iomm_table_initialize(); 276 iomm_table_initialize();
279 find_and_init_phbs(); 277 find_and_init_phbs();
280 io_page_mask = -1;
281} 278}
282 279
283/* 280/*
diff --git a/arch/powerpc/platforms/maple/pci.c b/arch/powerpc/platforms/maple/pci.c
index 85d6c93659cc..9a4efc0c3b29 100644
--- a/arch/powerpc/platforms/maple/pci.c
+++ b/arch/powerpc/platforms/maple/pci.c
@@ -437,9 +437,6 @@ void __init maple_pci_init(void)
437 437
438 /* Tell pci.c to not change any resource allocations. */ 438 /* Tell pci.c to not change any resource allocations. */
439 pci_probe_only = 1; 439 pci_probe_only = 1;
440
441 /* Allow all IO */
442 io_page_mask = -1;
443} 440}
444 441
445int maple_pci_get_legacy_ide_irq(struct pci_dev *pdev, int channel) 442int maple_pci_get_legacy_ide_irq(struct pci_dev *pdev, int channel)
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c
index f5d8d15d74fa..3212618e7909 100644
--- a/arch/powerpc/platforms/powermac/pci.c
+++ b/arch/powerpc/platforms/powermac/pci.c
@@ -1068,9 +1068,6 @@ void __init pmac_pci_init(void)
1068 /* Tell pci.c to not use the common resource allocation mechanism */ 1068 /* Tell pci.c to not use the common resource allocation mechanism */
1069 pci_probe_only = 1; 1069 pci_probe_only = 1;
1070 1070
1071 /* Allow all IO */
1072 io_page_mask = -1;
1073
1074#else /* CONFIG_PPC64 */ 1071#else /* CONFIG_PPC64 */
1075 init_p2pbridge(); 1072 init_p2pbridge();
1076 fixup_nec_usb2(); 1073 fixup_nec_usb2();
diff --git a/include/asm-powerpc/eeh.h b/include/asm-powerpc/eeh.h
index 868c7139dbff..2c3dc4a2b12a 100644
--- a/include/asm-powerpc/eeh.h
+++ b/include/asm-powerpc/eeh.h
@@ -293,8 +293,6 @@ static inline void eeh_memcpy_toio(volatile void __iomem *dest, const void *src,
293static inline u8 eeh_inb(unsigned long port) 293static inline u8 eeh_inb(unsigned long port)
294{ 294{
295 u8 val; 295 u8 val;
296 if (!_IO_IS_VALID(port))
297 return ~0;
298 val = in_8((u8 __iomem *)(port+pci_io_base)); 296 val = in_8((u8 __iomem *)(port+pci_io_base));
299 if (EEH_POSSIBLE_ERROR(val, u8)) 297 if (EEH_POSSIBLE_ERROR(val, u8))
300 return eeh_check_failure((void __iomem *)(port), val); 298 return eeh_check_failure((void __iomem *)(port), val);
@@ -303,15 +301,12 @@ static inline u8 eeh_inb(unsigned long port)
303 301
304static inline void eeh_outb(u8 val, unsigned long port) 302static inline void eeh_outb(u8 val, unsigned long port)
305{ 303{
306 if (_IO_IS_VALID(port)) 304 out_8((u8 __iomem *)(port+pci_io_base), val);
307 out_8((u8 __iomem *)(port+pci_io_base), val);
308} 305}
309 306
310static inline u16 eeh_inw(unsigned long port) 307static inline u16 eeh_inw(unsigned long port)
311{ 308{
312 u16 val; 309 u16 val;
313 if (!_IO_IS_VALID(port))
314 return ~0;
315 val = in_le16((u16 __iomem *)(port+pci_io_base)); 310 val = in_le16((u16 __iomem *)(port+pci_io_base));
316 if (EEH_POSSIBLE_ERROR(val, u16)) 311 if (EEH_POSSIBLE_ERROR(val, u16))
317 return eeh_check_failure((void __iomem *)(port), val); 312 return eeh_check_failure((void __iomem *)(port), val);
@@ -320,15 +315,12 @@ static inline u16 eeh_inw(unsigned long port)
320 315
321static inline void eeh_outw(u16 val, unsigned long port) 316static inline void eeh_outw(u16 val, unsigned long port)
322{ 317{
323 if (_IO_IS_VALID(port)) 318 out_le16((u16 __iomem *)(port+pci_io_base), val);
324 out_le16((u16 __iomem *)(port+pci_io_base), val);
325} 319}
326 320
327static inline u32 eeh_inl(unsigned long port) 321static inline u32 eeh_inl(unsigned long port)
328{ 322{
329 u32 val; 323 u32 val;
330 if (!_IO_IS_VALID(port))
331 return ~0;
332 val = in_le32((u32 __iomem *)(port+pci_io_base)); 324 val = in_le32((u32 __iomem *)(port+pci_io_base));
333 if (EEH_POSSIBLE_ERROR(val, u32)) 325 if (EEH_POSSIBLE_ERROR(val, u32))
334 return eeh_check_failure((void __iomem *)(port), val); 326 return eeh_check_failure((void __iomem *)(port), val);
@@ -337,8 +329,7 @@ static inline u32 eeh_inl(unsigned long port)
337 329
338static inline void eeh_outl(u32 val, unsigned long port) 330static inline void eeh_outl(u32 val, unsigned long port)
339{ 331{
340 if (_IO_IS_VALID(port)) 332 out_le32((u32 __iomem *)(port+pci_io_base), val);
341 out_le32((u32 __iomem *)(port+pci_io_base), val);
342} 333}
343 334
344/* in-string eeh macros */ 335/* in-string eeh macros */
diff --git a/include/asm-powerpc/io.h b/include/asm-powerpc/io.h
index 68efbea379c9..4840fbf89c32 100644
--- a/include/asm-powerpc/io.h
+++ b/include/asm-powerpc/io.h
@@ -37,12 +37,6 @@
37 37
38extern unsigned long isa_io_base; 38extern unsigned long isa_io_base;
39extern unsigned long pci_io_base; 39extern unsigned long pci_io_base;
40extern unsigned long io_page_mask;
41
42#define MAX_ISA_PORT 0x10000
43
44#define _IO_IS_VALID(port) ((port) >= MAX_ISA_PORT || (1 << (port>>PAGE_SHIFT)) \
45 & io_page_mask)
46 40
47#ifdef CONFIG_PPC_ISERIES 41#ifdef CONFIG_PPC_ISERIES
48/* __raw_* accessors aren't supported on iSeries */ 42/* __raw_* accessors aren't supported on iSeries */