diff options
Diffstat (limited to 'arch/ppc64/kernel/pmac_pci.c')
-rw-r--r-- | arch/ppc64/kernel/pmac_pci.c | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/arch/ppc64/kernel/pmac_pci.c b/arch/ppc64/kernel/pmac_pci.c index 71fe911ad183..dc40a0cad0b4 100644 --- a/arch/ppc64/kernel/pmac_pci.c +++ b/arch/ppc64/kernel/pmac_pci.c | |||
@@ -242,7 +242,7 @@ static int u3_ht_skip_device(struct pci_controller *hose, | |||
242 | else | 242 | else |
243 | busdn = hose->arch_data; | 243 | busdn = hose->arch_data; |
244 | for (dn = busdn->child; dn; dn = dn->sibling) | 244 | for (dn = busdn->child; dn; dn = dn->sibling) |
245 | if (dn->devfn == devfn) | 245 | if (dn->data && PCI_DN(dn)->devfn == devfn) |
246 | break; | 246 | break; |
247 | if (dn == NULL) | 247 | if (dn == NULL) |
248 | return -1; | 248 | return -1; |
@@ -388,7 +388,7 @@ static void __init setup_u3_agp(struct pci_controller* hose) | |||
388 | * the reg address cell, we shall fix that by killing struct | 388 | * the reg address cell, we shall fix that by killing struct |
389 | * reg_property and using some accessor functions instead | 389 | * reg_property and using some accessor functions instead |
390 | */ | 390 | */ |
391 | hose->first_busno = 0xf0; | 391 | hose->first_busno = 0xf0; |
392 | hose->last_busno = 0xff; | 392 | hose->last_busno = 0xff; |
393 | has_uninorth = 1; | 393 | has_uninorth = 1; |
394 | hose->ops = ¯isc_pci_ops; | 394 | hose->ops = ¯isc_pci_ops; |
@@ -473,7 +473,7 @@ static void __init setup_u3_ht(struct pci_controller* hose) | |||
473 | continue; | 473 | continue; |
474 | } | 474 | } |
475 | cur++; | 475 | cur++; |
476 | DBG("U3/HT: hole, %d end at %08lx, %d start at %08lx\n", | 476 | DBG("U3/HT: hole, %d end at %08lx, %d start at %08lx\n", |
477 | cur-1, res->start - 1, cur, res->end + 1); | 477 | cur-1, res->start - 1, cur, res->end + 1); |
478 | hose->mem_resources[cur].name = np->full_name; | 478 | hose->mem_resources[cur].name = np->full_name; |
479 | hose->mem_resources[cur].flags = IORESOURCE_MEM; | 479 | hose->mem_resources[cur].flags = IORESOURCE_MEM; |
@@ -603,24 +603,24 @@ static int __init add_bridge(struct device_node *dev) | |||
603 | char* disp_name; | 603 | char* disp_name; |
604 | int *bus_range; | 604 | int *bus_range; |
605 | int primary = 1; | 605 | int primary = 1; |
606 | struct property *of_prop; | 606 | struct property *of_prop; |
607 | 607 | ||
608 | DBG("Adding PCI host bridge %s\n", dev->full_name); | 608 | DBG("Adding PCI host bridge %s\n", dev->full_name); |
609 | 609 | ||
610 | bus_range = (int *) get_property(dev, "bus-range", &len); | 610 | bus_range = (int *) get_property(dev, "bus-range", &len); |
611 | if (bus_range == NULL || len < 2 * sizeof(int)) { | 611 | if (bus_range == NULL || len < 2 * sizeof(int)) { |
612 | printk(KERN_WARNING "Can't get bus-range for %s, assume bus 0\n", | 612 | printk(KERN_WARNING "Can't get bus-range for %s, assume bus 0\n", |
613 | dev->full_name); | 613 | dev->full_name); |
614 | } | 614 | } |
615 | 615 | ||
616 | hose = alloc_bootmem(sizeof(struct pci_controller)); | 616 | hose = alloc_bootmem(sizeof(struct pci_controller)); |
617 | if (hose == NULL) | 617 | if (hose == NULL) |
618 | return -ENOMEM; | 618 | return -ENOMEM; |
619 | pci_setup_pci_controller(hose); | 619 | pci_setup_pci_controller(hose); |
620 | 620 | ||
621 | hose->arch_data = dev; | 621 | hose->arch_data = dev; |
622 | hose->first_busno = bus_range ? bus_range[0] : 0; | 622 | hose->first_busno = bus_range ? bus_range[0] : 0; |
623 | hose->last_busno = bus_range ? bus_range[1] : 0xff; | 623 | hose->last_busno = bus_range ? bus_range[1] : 0xff; |
624 | 624 | ||
625 | of_prop = alloc_bootmem(sizeof(struct property) + | 625 | of_prop = alloc_bootmem(sizeof(struct property) + |
626 | sizeof(hose->global_number)); | 626 | sizeof(hose->global_number)); |
@@ -634,24 +634,24 @@ static int __init add_bridge(struct device_node *dev) | |||
634 | } | 634 | } |
635 | 635 | ||
636 | disp_name = NULL; | 636 | disp_name = NULL; |
637 | if (device_is_compatible(dev, "u3-agp")) { | 637 | if (device_is_compatible(dev, "u3-agp")) { |
638 | setup_u3_agp(hose); | 638 | setup_u3_agp(hose); |
639 | disp_name = "U3-AGP"; | 639 | disp_name = "U3-AGP"; |
640 | primary = 0; | 640 | primary = 0; |
641 | } else if (device_is_compatible(dev, "u3-ht")) { | 641 | } else if (device_is_compatible(dev, "u3-ht")) { |
642 | setup_u3_ht(hose); | 642 | setup_u3_ht(hose); |
643 | disp_name = "U3-HT"; | 643 | disp_name = "U3-HT"; |
644 | primary = 1; | 644 | primary = 1; |
645 | } | 645 | } |
646 | printk(KERN_INFO "Found %s PCI host bridge. Firmware bus number: %d->%d\n", | 646 | printk(KERN_INFO "Found %s PCI host bridge. Firmware bus number: %d->%d\n", |
647 | disp_name, hose->first_busno, hose->last_busno); | 647 | disp_name, hose->first_busno, hose->last_busno); |
648 | 648 | ||
649 | /* Interpret the "ranges" property */ | 649 | /* Interpret the "ranges" property */ |
650 | /* This also maps the I/O region and sets isa_io/mem_base */ | 650 | /* This also maps the I/O region and sets isa_io/mem_base */ |
651 | pmac_process_bridge_OF_ranges(hose, dev, primary); | 651 | pmac_process_bridge_OF_ranges(hose, dev, primary); |
652 | 652 | ||
653 | /* Fixup "bus-range" OF property */ | 653 | /* Fixup "bus-range" OF property */ |
654 | fixup_bus_range(dev); | 654 | fixup_bus_range(dev); |
655 | 655 | ||
656 | return 0; | 656 | return 0; |
657 | } | 657 | } |
@@ -746,9 +746,9 @@ void __init pmac_pci_init(void) | |||
746 | */ | 746 | */ |
747 | if (u3_agp) { | 747 | if (u3_agp) { |
748 | struct device_node *np = u3_agp->arch_data; | 748 | struct device_node *np = u3_agp->arch_data; |
749 | np->busno = 0xf0; | 749 | PCI_DN(np)->busno = 0xf0; |
750 | for (np = np->child; np; np = np->sibling) | 750 | for (np = np->child; np; np = np->sibling) |
751 | np->busno = 0xf0; | 751 | PCI_DN(np)->busno = 0xf0; |
752 | } | 752 | } |
753 | 753 | ||
754 | pmac_check_ht_link(); | 754 | pmac_check_ht_link(); |