]> err.no Git - linux-2.6/blobdiff - arch/powerpc/kernel/pci-common.c
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
[linux-2.6] / arch / powerpc / kernel / pci-common.c
index 063cdd4130497173eca006e49e310393e9b9df0b..ea0c61e09b7640553cf70c92b184339ff3bfd0bc 100644 (file)
@@ -598,6 +598,7 @@ void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose,
                        res->start = pci_addr;
                        break;
                case 2:         /* PCI Memory space */
+               case 3:         /* PCI 64 bits Memory space */
                        printk(KERN_INFO
                               " MEM 0x%016llx..0x%016llx -> 0x%016llx %s\n",
                               cpu_addr, cpu_addr + size - 1, pci_addr,
@@ -649,11 +650,18 @@ void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose,
                }
        }
 
-       /* Out of paranoia, let's put the ISA hole last if any */
-       if (isa_hole >= 0 && memno > 0 && isa_hole != (memno-1)) {
-               struct resource tmp = hose->mem_resources[isa_hole];
-               hose->mem_resources[isa_hole] = hose->mem_resources[memno-1];
-               hose->mem_resources[memno-1] = tmp;
+       /* If there's an ISA hole and the pci_mem_offset is -not- matching
+        * the ISA hole offset, then we need to remove the ISA hole from
+        * the resource list for that brige
+        */
+       if (isa_hole >= 0 && hose->pci_mem_offset != isa_mb) {
+               unsigned int next = isa_hole + 1;
+               printk(KERN_INFO " Removing ISA hole at 0x%016llx\n", isa_mb);
+               if (next < memno)
+                       memmove(&hose->mem_resources[isa_hole],
+                               &hose->mem_resources[next],
+                               sizeof(struct resource) * (memno - next));
+               hose->mem_resources[--memno].flags = 0;
        }
 }