]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/x86/pci/common.c
Merge branch 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[karo-tx-linux.git] / arch / x86 / pci / common.c
index 215a27ae050d430c0deac4a29f75c08449249c96..f7c8a399978ccdfe266d7919b0f8a59db8fbea25 100644 (file)
@@ -125,6 +125,23 @@ void __init dmi_check_skip_isa_align(void)
 static void __devinit pcibios_fixup_device_resources(struct pci_dev *dev)
 {
        struct resource *rom_r = &dev->resource[PCI_ROM_RESOURCE];
+       struct resource *bar_r;
+       int bar;
+
+       if (pci_probe & PCI_NOASSIGN_BARS) {
+               /*
+               * If the BIOS did not assign the BAR, zero out the
+               * resource so the kernel doesn't attmept to assign
+               * it later on in pci_assign_unassigned_resources
+               */
+               for (bar = 0; bar <= PCI_STD_RESOURCE_END; bar++) {
+                       bar_r = &dev->resource[bar];
+                       if (bar_r->start == 0 && bar_r->end != 0) {
+                               bar_r->flags = 0;
+                               bar_r->end = 0;
+                       }
+               }
+       }
 
        if (pci_probe & PCI_NOASSIGN_ROMS) {
                if (rom_r->parent)
@@ -404,16 +421,10 @@ struct pci_bus * __devinit pcibios_scan_root(int busnum)
 
        return bus;
 }
-
-int __init pcibios_init(void)
+void __init pcibios_set_cache_line_size(void)
 {
        struct cpuinfo_x86 *c = &boot_cpu_data;
 
-       if (!raw_pci_ops) {
-               printk(KERN_WARNING "PCI: System does not support PCI\n");
-               return 0;
-       }
-
        /*
         * Set PCI cacheline size to that of the CPU if the CPU has reported it.
         * (For older CPUs that don't support cpuid, we se it to 32 bytes
@@ -428,7 +439,16 @@ int __init pcibios_init(void)
                pci_dfl_cache_line_size = 32 >> 2;
                printk(KERN_DEBUG "PCI: Unknown cacheline size. Setting to 32 bytes\n");
        }
+}
 
+int __init pcibios_init(void)
+{
+       if (!raw_pci_ops) {
+               printk(KERN_WARNING "PCI: System does not support PCI\n");
+               return 0;
+       }
+
+       pcibios_set_cache_line_size();
        pcibios_resource_survey();
 
        if (pci_bf_sort >= pci_force_bf)
@@ -509,6 +529,9 @@ char * __devinit  pcibios_setup(char *str)
        } else if (!strcmp(str, "norom")) {
                pci_probe |= PCI_NOASSIGN_ROMS;
                return NULL;
+       } else if (!strcmp(str, "nobar")) {
+               pci_probe |= PCI_NOASSIGN_BARS;
+               return NULL;
        } else if (!strcmp(str, "assign-busses")) {
                pci_probe |= PCI_ASSIGN_ALL_BUSSES;
                return NULL;