diff options
Diffstat (limited to 'arch/arm/kernel/bios32.c')
-rw-r--r-- | arch/arm/kernel/bios32.c | 75 |
1 files changed, 7 insertions, 68 deletions
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c index f58ba3589908..632df9a66f8c 100644 --- a/arch/arm/kernel/bios32.c +++ b/arch/arm/kernel/bios32.c | |||
@@ -16,7 +16,6 @@ | |||
16 | #include <asm/mach/pci.h> | 16 | #include <asm/mach/pci.h> |
17 | 17 | ||
18 | static int debug_pci; | 18 | static int debug_pci; |
19 | static int use_firmware; | ||
20 | 19 | ||
21 | /* | 20 | /* |
22 | * We can't use pci_find_device() here since we are | 21 | * We can't use pci_find_device() here since we are |
@@ -295,28 +294,6 @@ static inline int pdev_bad_for_parity(struct pci_dev *dev) | |||
295 | } | 294 | } |
296 | 295 | ||
297 | /* | 296 | /* |
298 | * Adjust the device resources from bus-centric to Linux-centric. | ||
299 | */ | ||
300 | static void __devinit | ||
301 | pdev_fixup_device_resources(struct pci_sys_data *root, struct pci_dev *dev) | ||
302 | { | ||
303 | resource_size_t offset; | ||
304 | int i; | ||
305 | |||
306 | for (i = 0; i < PCI_NUM_RESOURCES; i++) { | ||
307 | if (dev->resource[i].start == 0) | ||
308 | continue; | ||
309 | if (dev->resource[i].flags & IORESOURCE_MEM) | ||
310 | offset = root->mem_offset; | ||
311 | else | ||
312 | offset = root->io_offset; | ||
313 | |||
314 | dev->resource[i].start += offset; | ||
315 | dev->resource[i].end += offset; | ||
316 | } | ||
317 | } | ||
318 | |||
319 | /* | ||
320 | * pcibios_fixup_bus - Called after each bus is probed, | 297 | * pcibios_fixup_bus - Called after each bus is probed, |
321 | * but before its children are examined. | 298 | * but before its children are examined. |
322 | */ | 299 | */ |
@@ -333,8 +310,6 @@ void pcibios_fixup_bus(struct pci_bus *bus) | |||
333 | list_for_each_entry(dev, &bus->devices, bus_list) { | 310 | list_for_each_entry(dev, &bus->devices, bus_list) { |
334 | u16 status; | 311 | u16 status; |
335 | 312 | ||
336 | pdev_fixup_device_resources(root, dev); | ||
337 | |||
338 | pci_read_config_word(dev, PCI_STATUS, &status); | 313 | pci_read_config_word(dev, PCI_STATUS, &status); |
339 | 314 | ||
340 | /* | 315 | /* |
@@ -400,43 +375,6 @@ EXPORT_SYMBOL(pcibios_fixup_bus); | |||
400 | #endif | 375 | #endif |
401 | 376 | ||
402 | /* | 377 | /* |
403 | * Convert from Linux-centric to bus-centric addresses for bridge devices. | ||
404 | */ | ||
405 | void | ||
406 | pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, | ||
407 | struct resource *res) | ||
408 | { | ||
409 | struct pci_sys_data *root = dev->sysdata; | ||
410 | unsigned long offset = 0; | ||
411 | |||
412 | if (res->flags & IORESOURCE_IO) | ||
413 | offset = root->io_offset; | ||
414 | if (res->flags & IORESOURCE_MEM) | ||
415 | offset = root->mem_offset; | ||
416 | |||
417 | region->start = res->start - offset; | ||
418 | region->end = res->end - offset; | ||
419 | } | ||
420 | EXPORT_SYMBOL(pcibios_resource_to_bus); | ||
421 | |||
422 | void __devinit | ||
423 | pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, | ||
424 | struct pci_bus_region *region) | ||
425 | { | ||
426 | struct pci_sys_data *root = dev->sysdata; | ||
427 | unsigned long offset = 0; | ||
428 | |||
429 | if (res->flags & IORESOURCE_IO) | ||
430 | offset = root->io_offset; | ||
431 | if (res->flags & IORESOURCE_MEM) | ||
432 | offset = root->mem_offset; | ||
433 | |||
434 | res->start = region->start + offset; | ||
435 | res->end = region->end + offset; | ||
436 | } | ||
437 | EXPORT_SYMBOL(pcibios_bus_to_resource); | ||
438 | |||
439 | /* | ||
440 | * Swizzle the device pin each time we cross a bridge. | 378 | * Swizzle the device pin each time we cross a bridge. |
441 | * This might update pin and returns the slot number. | 379 | * This might update pin and returns the slot number. |
442 | */ | 380 | */ |
@@ -497,10 +435,10 @@ static void __init pcibios_init_hw(struct hw_pci *hw) | |||
497 | 435 | ||
498 | if (ret > 0) { | 436 | if (ret > 0) { |
499 | if (list_empty(&sys->resources)) { | 437 | if (list_empty(&sys->resources)) { |
500 | pci_add_resource(&sys->resources, | 438 | pci_add_resource_offset(&sys->resources, |
501 | &ioport_resource); | 439 | &ioport_resource, sys->io_offset); |
502 | pci_add_resource(&sys->resources, | 440 | pci_add_resource_offset(&sys->resources, |
503 | &iomem_resource); | 441 | &iomem_resource, sys->mem_offset); |
504 | } | 442 | } |
505 | 443 | ||
506 | sys->bus = hw->scan(nr, sys); | 444 | sys->bus = hw->scan(nr, sys); |
@@ -525,6 +463,7 @@ void __init pci_common_init(struct hw_pci *hw) | |||
525 | 463 | ||
526 | INIT_LIST_HEAD(&hw->buses); | 464 | INIT_LIST_HEAD(&hw->buses); |
527 | 465 | ||
466 | pci_add_flags(PCI_REASSIGN_ALL_RSRC); | ||
528 | if (hw->preinit) | 467 | if (hw->preinit) |
529 | hw->preinit(); | 468 | hw->preinit(); |
530 | pcibios_init_hw(hw); | 469 | pcibios_init_hw(hw); |
@@ -536,7 +475,7 @@ void __init pci_common_init(struct hw_pci *hw) | |||
536 | list_for_each_entry(sys, &hw->buses, node) { | 475 | list_for_each_entry(sys, &hw->buses, node) { |
537 | struct pci_bus *bus = sys->bus; | 476 | struct pci_bus *bus = sys->bus; |
538 | 477 | ||
539 | if (!use_firmware) { | 478 | if (!pci_has_flag(PCI_PROBE_ONLY)) { |
540 | /* | 479 | /* |
541 | * Size the bridge windows. | 480 | * Size the bridge windows. |
542 | */ | 481 | */ |
@@ -573,7 +512,7 @@ char * __init pcibios_setup(char *str) | |||
573 | debug_pci = 1; | 512 | debug_pci = 1; |
574 | return NULL; | 513 | return NULL; |
575 | } else if (!strcmp(str, "firmware")) { | 514 | } else if (!strcmp(str, "firmware")) { |
576 | use_firmware = 1; | 515 | pci_add_flags(PCI_PROBE_ONLY); |
577 | return NULL; | 516 | return NULL; |
578 | } | 517 | } |
579 | return str; | 518 | return str; |