Merge branch 'for_paulus' of master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc
[pandora-kernel.git] / arch / powerpc / kernel / pci_64.c
index c367520..e1b3b3e 100644 (file)
 unsigned long pci_probe_only = 1;
 int pci_assign_all_buses = 0;
 
-/*
- * legal IO pages under MAX_ISA_PORT.  This is to ensure we don't touch
- * devices we don't have access to.
- */
-unsigned long io_page_mask;
-
-EXPORT_SYMBOL(io_page_mask);
-
 #ifdef CONFIG_PPC_MULTIPLATFORM
 static void fixup_resource(struct resource *res, struct pci_dev *dev);
 static void do_bus_setup(struct pci_bus *bus);
@@ -78,6 +70,7 @@ int global_phb_number;                /* Global phb counter */
 
 /* Cached ISA bridge dev. */
 struct pci_dev *ppc64_isabridge_dev = NULL;
+EXPORT_SYMBOL_GPL(ppc64_isabridge_dev);
 
 static void fixup_broken_pcnet32(struct pci_dev* dev)
 {
@@ -589,7 +582,6 @@ void __devinit scan_phb(struct pci_controller *hose)
 #endif /* CONFIG_PPC_MULTIPLATFORM */
        if (mode == PCI_PROBE_NORMAL)
                hose->last_busno = bus->subordinate = pci_scan_child_bus(bus);
-       pci_bus_add_devices(bus);
 }
 
 static int __init pcibios_init(void)
@@ -605,11 +597,13 @@ static int __init pcibios_init(void)
        iSeries_pcibios_init(); 
 #endif
 
-       printk("PCI: Probing PCI hardware\n");
+       printk(KERN_DEBUG "PCI: Probing PCI hardware\n");
 
        /* Scan all of the recorded PCI controllers.  */
-       list_for_each_entry_safe(hose, tmp, &hose_list, list_node)
+       list_for_each_entry_safe(hose, tmp, &hose_list, list_node) {
                scan_phb(hose);
+               pci_bus_add_devices(hose->bus);
+       }
 
 #ifndef CONFIG_PPC_ISERIES
        if (pci_probe_only)
@@ -628,14 +622,14 @@ static int __init pcibios_init(void)
        /* Cache the location of the ISA bridge (if we have one) */
        ppc64_isabridge_dev = pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, NULL);
        if (ppc64_isabridge_dev != NULL)
-               printk("ISA bridge at %s\n", pci_name(ppc64_isabridge_dev));
+               printk(KERN_DEBUG "ISA bridge at %s\n", pci_name(ppc64_isabridge_dev));
 
 #ifdef CONFIG_PPC_MULTIPLATFORM
        /* map in PCI I/O space */
        phbs_remap_io();
 #endif
 
-       printk("PCI: Probing PCI hardware done\n");
+       printk(KERN_DEBUG "PCI: Probing PCI hardware done\n");
 
        return 0;
 }
@@ -802,7 +796,7 @@ static pgprot_t __pci_mmap_set_pgprot(struct pci_dev *dev, struct resource *rp,
        else
                prot |= _PAGE_GUARDED;
 
-       printk("PCI map for %s:%lx, prot: %lx\n", pci_name(dev), rp->start,
+       printk(KERN_DEBUG "PCI map for %s:%lx, prot: %lx\n", pci_name(dev), rp->start,
               prot);
 
        return __pgprot(prot);
@@ -1102,8 +1096,6 @@ void __init pci_setup_phb_io(struct pci_controller *hose, int primary)
                        pci_process_ISA_OF_ranges(isa_dn, hose->io_base_phys,
                                                hose->io_base_virt);
                        of_node_put(isa_dn);
-                       /* Allow all IO */
-                       io_page_mask = -1;
                }
        }
 
@@ -1210,7 +1202,7 @@ int remap_bus_range(struct pci_bus *bus)
                return 1;
        if (start_phys == 0)
                return 1;
-       printk("mapping IO %lx -> %lx, size: %lx\n", start_phys, start_virt, size);
+       printk(KERN_DEBUG "mapping IO %lx -> %lx, size: %lx\n", start_phys, start_virt, size);
        if (__ioremap_explicit(start_phys, start_virt, size,
                               _PAGE_NO_CACHE | _PAGE_GUARDED))
                return 1;
@@ -1230,27 +1222,13 @@ static void phbs_remap_io(void)
 static void __devinit fixup_resource(struct resource *res, struct pci_dev *dev)
 {
        struct pci_controller *hose = pci_bus_to_host(dev->bus);
-       unsigned long start, end, mask, offset;
+       unsigned long offset;
 
        if (res->flags & IORESOURCE_IO) {
                offset = (unsigned long)hose->io_base_virt - pci_io_base;
 
-               start = res->start += offset;
-               end = res->end += offset;
-
-               /* Need to allow IO access to pages that are in the
-                  ISA range */
-               if (start < MAX_ISA_PORT) {
-                       if (end > MAX_ISA_PORT)
-                               end = MAX_ISA_PORT;
-
-                       start >>= PAGE_SHIFT;
-                       end >>= PAGE_SHIFT;
-
-                       /* get the range of pages for the map */
-                       mask = ((1 << (end+1)) - 1) ^ ((1 << start) - 1);
-                       io_page_mask |= mask;
-               }
+               res->start += offset;
+               res->end += offset;
        } else if (res->flags & IORESOURCE_MEM) {
                res->start += hose->pci_mem_offset;
                res->end += hose->pci_mem_offset;