diff options
Diffstat (limited to 'arch/x86/pci/common.c')
| -rw-r--r-- | arch/x86/pci/common.c | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c index 20b9f59f95df..b67732bbb85a 100644 --- a/arch/x86/pci/common.c +++ b/arch/x86/pci/common.c | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | unsigned int pci_probe = PCI_PROBE_BIOS | PCI_PROBE_CONF1 | PCI_PROBE_CONF2 | | 20 | unsigned int pci_probe = PCI_PROBE_BIOS | PCI_PROBE_CONF1 | PCI_PROBE_CONF2 | |
| 21 | PCI_PROBE_MMCONF; | 21 | PCI_PROBE_MMCONF; |
| 22 | 22 | ||
| 23 | unsigned int pci_early_dump_regs; | ||
| 23 | static int pci_bf_sort; | 24 | static int pci_bf_sort; |
| 24 | int pci_routeirq; | 25 | int pci_routeirq; |
| 25 | int pcibios_last_bus = -1; | 26 | int pcibios_last_bus = -1; |
| @@ -31,7 +32,7 @@ struct pci_raw_ops *raw_pci_ext_ops; | |||
| 31 | int raw_pci_read(unsigned int domain, unsigned int bus, unsigned int devfn, | 32 | int raw_pci_read(unsigned int domain, unsigned int bus, unsigned int devfn, |
| 32 | int reg, int len, u32 *val) | 33 | int reg, int len, u32 *val) |
| 33 | { | 34 | { |
| 34 | if (reg < 256 && raw_pci_ops) | 35 | if (domain == 0 && reg < 256 && raw_pci_ops) |
| 35 | return raw_pci_ops->read(domain, bus, devfn, reg, len, val); | 36 | return raw_pci_ops->read(domain, bus, devfn, reg, len, val); |
| 36 | if (raw_pci_ext_ops) | 37 | if (raw_pci_ext_ops) |
| 37 | return raw_pci_ext_ops->read(domain, bus, devfn, reg, len, val); | 38 | return raw_pci_ext_ops->read(domain, bus, devfn, reg, len, val); |
| @@ -41,7 +42,7 @@ int raw_pci_read(unsigned int domain, unsigned int bus, unsigned int devfn, | |||
| 41 | int raw_pci_write(unsigned int domain, unsigned int bus, unsigned int devfn, | 42 | int raw_pci_write(unsigned int domain, unsigned int bus, unsigned int devfn, |
| 42 | int reg, int len, u32 val) | 43 | int reg, int len, u32 val) |
| 43 | { | 44 | { |
| 44 | if (reg < 256 && raw_pci_ops) | 45 | if (domain == 0 && reg < 256 && raw_pci_ops) |
| 45 | return raw_pci_ops->write(domain, bus, devfn, reg, len, val); | 46 | return raw_pci_ops->write(domain, bus, devfn, reg, len, val); |
| 46 | if (raw_pci_ext_ops) | 47 | if (raw_pci_ext_ops) |
| 47 | return raw_pci_ext_ops->write(domain, bus, devfn, reg, len, val); | 48 | return raw_pci_ext_ops->write(domain, bus, devfn, reg, len, val); |
| @@ -121,6 +122,21 @@ void __init dmi_check_skip_isa_align(void) | |||
| 121 | dmi_check_system(can_skip_pciprobe_dmi_table); | 122 | dmi_check_system(can_skip_pciprobe_dmi_table); |
| 122 | } | 123 | } |
| 123 | 124 | ||
| 125 | static void __devinit pcibios_fixup_device_resources(struct pci_dev *dev) | ||
| 126 | { | ||
| 127 | struct resource *rom_r = &dev->resource[PCI_ROM_RESOURCE]; | ||
| 128 | |||
| 129 | if (pci_probe & PCI_NOASSIGN_ROMS) { | ||
| 130 | if (rom_r->parent) | ||
| 131 | return; | ||
| 132 | if (rom_r->start) { | ||
| 133 | /* we deal with BIOS assigned ROM later */ | ||
| 134 | return; | ||
| 135 | } | ||
| 136 | rom_r->start = rom_r->end = rom_r->flags = 0; | ||
| 137 | } | ||
| 138 | } | ||
| 139 | |||
| 124 | /* | 140 | /* |
| 125 | * Called after each bus is probed, but before its children | 141 | * Called after each bus is probed, but before its children |
| 126 | * are examined. | 142 | * are examined. |
| @@ -128,7 +144,11 @@ void __init dmi_check_skip_isa_align(void) | |||
| 128 | 144 | ||
| 129 | void __devinit pcibios_fixup_bus(struct pci_bus *b) | 145 | void __devinit pcibios_fixup_bus(struct pci_bus *b) |
| 130 | { | 146 | { |
| 147 | struct pci_dev *dev; | ||
| 148 | |||
| 131 | pci_read_bridge_bases(b); | 149 | pci_read_bridge_bases(b); |
| 150 | list_for_each_entry(dev, &b->devices, bus_list) | ||
| 151 | pcibios_fixup_device_resources(dev); | ||
| 132 | } | 152 | } |
| 133 | 153 | ||
| 134 | /* | 154 | /* |
| @@ -481,12 +501,18 @@ char * __devinit pcibios_setup(char *str) | |||
| 481 | else if (!strcmp(str, "rom")) { | 501 | else if (!strcmp(str, "rom")) { |
| 482 | pci_probe |= PCI_ASSIGN_ROMS; | 502 | pci_probe |= PCI_ASSIGN_ROMS; |
| 483 | return NULL; | 503 | return NULL; |
| 504 | } else if (!strcmp(str, "norom")) { | ||
| 505 | pci_probe |= PCI_NOASSIGN_ROMS; | ||
| 506 | return NULL; | ||
| 484 | } else if (!strcmp(str, "assign-busses")) { | 507 | } else if (!strcmp(str, "assign-busses")) { |
| 485 | pci_probe |= PCI_ASSIGN_ALL_BUSSES; | 508 | pci_probe |= PCI_ASSIGN_ALL_BUSSES; |
| 486 | return NULL; | 509 | return NULL; |
| 487 | } else if (!strcmp(str, "use_crs")) { | 510 | } else if (!strcmp(str, "use_crs")) { |
| 488 | pci_probe |= PCI_USE__CRS; | 511 | pci_probe |= PCI_USE__CRS; |
| 489 | return NULL; | 512 | return NULL; |
| 513 | } else if (!strcmp(str, "earlydump")) { | ||
| 514 | pci_early_dump_regs = 1; | ||
| 515 | return NULL; | ||
| 490 | } else if (!strcmp(str, "routeirq")) { | 516 | } else if (!strcmp(str, "routeirq")) { |
| 491 | pci_routeirq = 1; | 517 | pci_routeirq = 1; |
| 492 | return NULL; | 518 | return NULL; |
