diff options
Diffstat (limited to 'arch/sparc/kernel')
-rw-r--r-- | arch/sparc/kernel/leon_pci.c | 25 | ||||
-rw-r--r-- | arch/sparc/kernel/pci.c | 22 |
2 files changed, 19 insertions, 28 deletions
diff --git a/arch/sparc/kernel/leon_pci.c b/arch/sparc/kernel/leon_pci.c index f1cf6ef011a7..c7bec25fdb1c 100644 --- a/arch/sparc/kernel/leon_pci.c +++ b/arch/sparc/kernel/leon_pci.c | |||
@@ -19,22 +19,22 @@ | |||
19 | */ | 19 | */ |
20 | void leon_pci_init(struct platform_device *ofdev, struct leon_pci_info *info) | 20 | void leon_pci_init(struct platform_device *ofdev, struct leon_pci_info *info) |
21 | { | 21 | { |
22 | LIST_HEAD(resources); | ||
22 | struct pci_bus *root_bus; | 23 | struct pci_bus *root_bus; |
23 | 24 | ||
24 | root_bus = pci_scan_bus_parented(&ofdev->dev, 0, info->ops, info); | 25 | pci_add_resource(&resources, &info->io_space); |
25 | if (root_bus) { | 26 | pci_add_resource(&resources, &info->mem_space); |
26 | root_bus->resource[0] = &info->io_space; | ||
27 | root_bus->resource[1] = &info->mem_space; | ||
28 | root_bus->resource[2] = NULL; | ||
29 | |||
30 | /* Init all PCI devices into PCI tree */ | ||
31 | pci_bus_add_devices(root_bus); | ||
32 | 27 | ||
28 | root_bus = pci_scan_root_bus(&ofdev->dev, 0, info->ops, info, | ||
29 | &resources); | ||
30 | if (root_bus) { | ||
33 | /* Setup IRQs of all devices using custom routines */ | 31 | /* Setup IRQs of all devices using custom routines */ |
34 | pci_fixup_irqs(pci_common_swizzle, info->map_irq); | 32 | pci_fixup_irqs(pci_common_swizzle, info->map_irq); |
35 | 33 | ||
36 | /* Assign devices with resources */ | 34 | /* Assign devices with resources */ |
37 | pci_assign_unassigned_resources(); | 35 | pci_assign_unassigned_resources(); |
36 | } else { | ||
37 | pci_free_resource_list(&resources); | ||
38 | } | 38 | } |
39 | } | 39 | } |
40 | 40 | ||
@@ -83,15 +83,6 @@ void __devinit pcibios_fixup_bus(struct pci_bus *pbus) | |||
83 | int i, has_io, has_mem; | 83 | int i, has_io, has_mem; |
84 | u16 cmd; | 84 | u16 cmd; |
85 | 85 | ||
86 | /* Generic PCI bus probing sets these to point at | ||
87 | * &io{port,mem}_resouce which is wrong for us. | ||
88 | */ | ||
89 | if (pbus->self == NULL) { | ||
90 | pbus->resource[0] = &info->io_space; | ||
91 | pbus->resource[1] = &info->mem_space; | ||
92 | pbus->resource[2] = NULL; | ||
93 | } | ||
94 | |||
95 | list_for_each_entry(dev, &pbus->devices, bus_list) { | 86 | list_for_each_entry(dev, &pbus->devices, bus_list) { |
96 | /* | 87 | /* |
97 | * We can not rely on that the bootloader has enabled I/O | 88 | * We can not rely on that the bootloader has enabled I/O |
diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c index 31111e35281e..bb8bc2e519ac 100644 --- a/arch/sparc/kernel/pci.c +++ b/arch/sparc/kernel/pci.c | |||
@@ -685,23 +685,25 @@ static void __devinit pci_bus_register_of_sysfs(struct pci_bus *bus) | |||
685 | struct pci_bus * __devinit pci_scan_one_pbm(struct pci_pbm_info *pbm, | 685 | struct pci_bus * __devinit pci_scan_one_pbm(struct pci_pbm_info *pbm, |
686 | struct device *parent) | 686 | struct device *parent) |
687 | { | 687 | { |
688 | LIST_HEAD(resources); | ||
688 | struct device_node *node = pbm->op->dev.of_node; | 689 | struct device_node *node = pbm->op->dev.of_node; |
689 | struct pci_bus *bus; | 690 | struct pci_bus *bus; |
690 | 691 | ||
691 | printk("PCI: Scanning PBM %s\n", node->full_name); | 692 | printk("PCI: Scanning PBM %s\n", node->full_name); |
692 | 693 | ||
693 | bus = pci_create_bus(parent, pbm->pci_first_busno, pbm->pci_ops, pbm); | 694 | pci_add_resource(&resources, &pbm->io_space); |
695 | pci_add_resource(&resources, &pbm->mem_space); | ||
696 | bus = pci_create_root_bus(parent, pbm->pci_first_busno, pbm->pci_ops, | ||
697 | pbm, &resources); | ||
694 | if (!bus) { | 698 | if (!bus) { |
695 | printk(KERN_ERR "Failed to create bus for %s\n", | 699 | printk(KERN_ERR "Failed to create bus for %s\n", |
696 | node->full_name); | 700 | node->full_name); |
701 | pci_free_resource_list(&resources); | ||
697 | return NULL; | 702 | return NULL; |
698 | } | 703 | } |
699 | bus->secondary = pbm->pci_first_busno; | 704 | bus->secondary = pbm->pci_first_busno; |
700 | bus->subordinate = pbm->pci_last_busno; | 705 | bus->subordinate = pbm->pci_last_busno; |
701 | 706 | ||
702 | bus->resource[0] = &pbm->io_space; | ||
703 | bus->resource[1] = &pbm->mem_space; | ||
704 | |||
705 | pci_of_scan_bus(pbm, node, bus); | 707 | pci_of_scan_bus(pbm, node, bus); |
706 | pci_bus_add_devices(bus); | 708 | pci_bus_add_devices(bus); |
707 | pci_bus_register_of_sysfs(bus); | 709 | pci_bus_register_of_sysfs(bus); |
@@ -711,13 +713,6 @@ struct pci_bus * __devinit pci_scan_one_pbm(struct pci_pbm_info *pbm, | |||
711 | 713 | ||
712 | void __devinit pcibios_fixup_bus(struct pci_bus *pbus) | 714 | void __devinit pcibios_fixup_bus(struct pci_bus *pbus) |
713 | { | 715 | { |
714 | struct pci_pbm_info *pbm = pbus->sysdata; | ||
715 | |||
716 | /* Generic PCI bus probing sets these to point at | ||
717 | * &io{port,mem}_resouce which is wrong for us. | ||
718 | */ | ||
719 | pbus->resource[0] = &pbm->io_space; | ||
720 | pbus->resource[1] = &pbm->mem_space; | ||
721 | } | 716 | } |
722 | 717 | ||
723 | void pcibios_update_irq(struct pci_dev *pdev, int irq) | 718 | void pcibios_update_irq(struct pci_dev *pdev, int irq) |
@@ -1083,6 +1078,11 @@ void pci_resource_to_user(const struct pci_dev *pdev, int bar, | |||
1083 | *end = rp->end - offset; | 1078 | *end = rp->end - offset; |
1084 | } | 1079 | } |
1085 | 1080 | ||
1081 | void pcibios_set_master(struct pci_dev *dev) | ||
1082 | { | ||
1083 | /* No special bus mastering setup handling */ | ||
1084 | } | ||
1085 | |||
1086 | static int __init pcibios_init(void) | 1086 | static int __init pcibios_init(void) |
1087 | { | 1087 | { |
1088 | pci_dfl_cache_line_size = 64 >> 2; | 1088 | pci_dfl_cache_line_size = 64 >> 2; |