aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel/pci_common.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2006-10-17 22:04:44 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-10-17 22:28:50 -0400
commit5aee87c43e3a71a4aa4e72b0dc2180e4952c0848 (patch)
tree7d53d2ffd49fba8815d1986bb8f07d8b0959c605 /arch/sparc64/kernel/pci_common.c
parent7341df16a1f228be833e918cb42534a34381a37e (diff)
[SPARC64]: Fix PCI memory space root resource on Hummingbird.
For Hummingbird PCI controllers, we should create the root PCI memory space resource as the full 4GB area, and then allocate the IOMMU DMA translation window out of there. The old code just assumed that the IOMMU DMA translation base to the top of the 4GB area was unusable. This is not true on many systems such as SB100 and SB150, where the IOMMU DMA translation window sits at 0xc0000000->0xdfffffff. So what would happen is that any device mapped by the firmware at the top section 0xe0000000->0xffffffff would get remapped by Linux somewhere else leading to all kinds of problems and boot failures. While we're here, report more cases of OBP resource assignment conflicts. The only truly valid ones are ROM resource conflicts. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel/pci_common.c')
-rw-r--r--arch/sparc64/kernel/pci_common.c29
1 files changed, 10 insertions, 19 deletions
diff --git a/arch/sparc64/kernel/pci_common.c b/arch/sparc64/kernel/pci_common.c
index 7a59cc72c844..827ae30aa497 100644
--- a/arch/sparc64/kernel/pci_common.c
+++ b/arch/sparc64/kernel/pci_common.c
@@ -330,19 +330,6 @@ __init get_device_resource(struct linux_prom_pci_registers *ap,
330 return res; 330 return res;
331} 331}
332 332
333static int __init pdev_resource_collisions_expected(struct pci_dev *pdev)
334{
335 if (pdev->vendor != PCI_VENDOR_ID_SUN)
336 return 0;
337
338 if (pdev->device == PCI_DEVICE_ID_SUN_RIO_EBUS ||
339 pdev->device == PCI_DEVICE_ID_SUN_RIO_1394 ||
340 pdev->device == PCI_DEVICE_ID_SUN_RIO_USB)
341 return 1;
342
343 return 0;
344}
345
346static void __init pdev_record_assignments(struct pci_pbm_info *pbm, 333static void __init pdev_record_assignments(struct pci_pbm_info *pbm,
347 struct pci_dev *pdev) 334 struct pci_dev *pdev)
348{ 335{
@@ -400,19 +387,23 @@ static void __init pdev_record_assignments(struct pci_pbm_info *pbm,
400 pbm->parent->resource_adjust(pdev, res, root); 387 pbm->parent->resource_adjust(pdev, res, root);
401 388
402 if (request_resource(root, res) < 0) { 389 if (request_resource(root, res) < 0) {
390 int rnum;
391
403 /* OK, there is some conflict. But this is fine 392 /* OK, there is some conflict. But this is fine
404 * since we'll reassign it in the fixup pass. 393 * since we'll reassign it in the fixup pass.
405 * 394 *
406 * We notify the user that OBP made an error if it 395 * Do not print the warning for ROM resources
407 * is a case we don't expect. 396 * as such a conflict is quite common and
397 * harmless as the ROM bar is disabled.
408 */ 398 */
409 if (!pdev_resource_collisions_expected(pdev)) { 399 rnum = (res - &pdev->resource[0]);
410 printk(KERN_ERR "PCI: Address space collision on region %ld " 400 if (rnum != PCI_ROM_RESOURCE)
401 printk(KERN_ERR "PCI: Resource collision, "
402 "region %d "
411 "[%016lx:%016lx] of device %s\n", 403 "[%016lx:%016lx] of device %s\n",
412 (res - &pdev->resource[0]), 404 rnum,
413 res->start, res->end, 405 res->start, res->end,
414 pci_name(pdev)); 406 pci_name(pdev));
415 }
416 } 407 }
417 } 408 }
418} 409}