aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/bios32.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/kernel/bios32.c')
-rw-r--r--arch/arm/kernel/bios32.c69
1 files changed, 4 insertions, 65 deletions
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
index 8d7c22d7dff8..be5d3b23284d 100644
--- a/arch/arm/kernel/bios32.c
+++ b/arch/arm/kernel/bios32.c
@@ -294,28 +294,6 @@ static inline int pdev_bad_for_parity(struct pci_dev *dev)
294} 294}
295 295
296/* 296/*
297 * Adjust the device resources from bus-centric to Linux-centric.
298 */
299static void __devinit
300pdev_fixup_device_resources(struct pci_sys_data *root, struct pci_dev *dev)
301{
302 resource_size_t offset;
303 int i;
304
305 for (i = 0; i < PCI_NUM_RESOURCES; i++) {
306 if (dev->resource[i].start == 0)
307 continue;
308 if (dev->resource[i].flags & IORESOURCE_MEM)
309 offset = root->mem_offset;
310 else
311 offset = root->io_offset;
312
313 dev->resource[i].start += offset;
314 dev->resource[i].end += offset;
315 }
316}
317
318/*
319 * pcibios_fixup_bus - Called after each bus is probed, 297 * pcibios_fixup_bus - Called after each bus is probed,
320 * but before its children are examined. 298 * but before its children are examined.
321 */ 299 */
@@ -332,8 +310,6 @@ void pcibios_fixup_bus(struct pci_bus *bus)
332 list_for_each_entry(dev, &bus->devices, bus_list) { 310 list_for_each_entry(dev, &bus->devices, bus_list) {
333 u16 status; 311 u16 status;
334 312
335 pdev_fixup_device_resources(root, dev);
336
337 pci_read_config_word(dev, PCI_STATUS, &status); 313 pci_read_config_word(dev, PCI_STATUS, &status);
338 314
339 /* 315 /*
@@ -399,43 +375,6 @@ EXPORT_SYMBOL(pcibios_fixup_bus);
399#endif 375#endif
400 376
401/* 377/*
402 * Convert from Linux-centric to bus-centric addresses for bridge devices.
403 */
404void
405pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
406 struct resource *res)
407{
408 struct pci_sys_data *root = dev->sysdata;
409 unsigned long offset = 0;
410
411 if (res->flags & IORESOURCE_IO)
412 offset = root->io_offset;
413 if (res->flags & IORESOURCE_MEM)
414 offset = root->mem_offset;
415
416 region->start = res->start - offset;
417 region->end = res->end - offset;
418}
419EXPORT_SYMBOL(pcibios_resource_to_bus);
420
421void __devinit
422pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
423 struct pci_bus_region *region)
424{
425 struct pci_sys_data *root = dev->sysdata;
426 unsigned long offset = 0;
427
428 if (res->flags & IORESOURCE_IO)
429 offset = root->io_offset;
430 if (res->flags & IORESOURCE_MEM)
431 offset = root->mem_offset;
432
433 res->start = region->start + offset;
434 res->end = region->end + offset;
435}
436EXPORT_SYMBOL(pcibios_bus_to_resource);
437
438/*
439 * Swizzle the device pin each time we cross a bridge. 378 * Swizzle the device pin each time we cross a bridge.
440 * This might update pin and returns the slot number. 379 * This might update pin and returns the slot number.
441 */ 380 */
@@ -496,10 +435,10 @@ static void __init pcibios_init_hw(struct hw_pci *hw)
496 435
497 if (ret > 0) { 436 if (ret > 0) {
498 if (list_empty(&sys->resources)) { 437 if (list_empty(&sys->resources)) {
499 pci_add_resource(&sys->resources, 438 pci_add_resource_offset(&sys->resources,
500 &ioport_resource); 439 &ioport_resource, sys->io_offset);
501 pci_add_resource(&sys->resources, 440 pci_add_resource_offset(&sys->resources,
502 &iomem_resource); 441 &iomem_resource, sys->mem_offset);
503 } 442 }
504 443
505 sys->bus = hw->scan(nr, sys); 444 sys->bus = hw->scan(nr, sys);