diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-11 21:50:26 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-11 21:50:26 -0500 |
commit | 7b67e751479d50b7f84d1a3cc5216eed5e534b66 (patch) | |
tree | a1a6746857cf65f04dde739fe271bf4143d55eaf /arch/microblaze | |
parent | 9f13a1fd452f11c18004ba2422a6384b424ec8a9 (diff) | |
parent | 76ccc297018d25d55b789bbd508861ef1e2cdb0c (diff) |
Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci
* 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci: (80 commits)
x86/PCI: Expand the x86_msi_ops to have a restore MSIs.
PCI: Increase resource array mask bit size in pcim_iomap_regions()
PCI: DEVICE_COUNT_RESOURCE should be equal to PCI_NUM_RESOURCES
PCI: pci_ids: add device ids for STA2X11 device (aka ConneXT)
PNP: work around Dell 1536/1546 BIOS MMCONFIG bug that breaks USB
x86/PCI: amd: factor out MMCONFIG discovery
PCI: Enable ATS at the device state restore
PCI: msi: fix imbalanced refcount of msi irq sysfs objects
PCI: kconfig: English typo in pci/pcie/Kconfig
PCI/PM/Runtime: make PCI traces quieter
PCI: remove pci_create_bus()
xtensa/PCI: convert to pci_scan_root_bus() for correct root bus resources
x86/PCI: convert to pci_create_root_bus() and pci_scan_root_bus()
x86/PCI: use pci_scan_bus() instead of pci_scan_bus_parented()
x86/PCI: read Broadcom CNB20LE host bridge info before PCI scan
sparc32, leon/PCI: convert to pci_scan_root_bus() for correct root bus resources
sparc/PCI: convert to pci_create_root_bus()
sh/PCI: convert to pci_scan_root_bus() for correct root bus resources
powerpc/PCI: convert to pci_create_root_bus()
powerpc/PCI: split PHB part out of pcibios_map_io_space()
...
Fix up conflicts in drivers/pci/msi.c and include/linux/pci_regs.h due
to the same patches being applied in other branches.
Diffstat (limited to 'arch/microblaze')
-rw-r--r-- | arch/microblaze/include/asm/pci-bridge.h | 1 | ||||
-rw-r--r-- | arch/microblaze/include/asm/pci.h | 5 | ||||
-rw-r--r-- | arch/microblaze/pci/pci-common.c | 43 |
3 files changed, 21 insertions, 28 deletions
diff --git a/arch/microblaze/include/asm/pci-bridge.h b/arch/microblaze/include/asm/pci-bridge.h index 32764cd077c..e9834b2991d 100644 --- a/arch/microblaze/include/asm/pci-bridge.h +++ b/arch/microblaze/include/asm/pci-bridge.h | |||
@@ -140,7 +140,6 @@ extern void pci_process_bridge_OF_ranges(struct pci_controller *hose, | |||
140 | /* Allocate & free a PCI host bridge structure */ | 140 | /* Allocate & free a PCI host bridge structure */ |
141 | extern struct pci_controller *pcibios_alloc_controller(struct device_node *dev); | 141 | extern struct pci_controller *pcibios_alloc_controller(struct device_node *dev); |
142 | extern void pcibios_free_controller(struct pci_controller *phb); | 142 | extern void pcibios_free_controller(struct pci_controller *phb); |
143 | extern void pcibios_setup_phb_resources(struct pci_controller *hose); | ||
144 | 143 | ||
145 | #endif /* __KERNEL__ */ | 144 | #endif /* __KERNEL__ */ |
146 | #endif /* _ASM_MICROBLAZE_PCI_BRIDGE_H */ | 145 | #endif /* _ASM_MICROBLAZE_PCI_BRIDGE_H */ |
diff --git a/arch/microblaze/include/asm/pci.h b/arch/microblaze/include/asm/pci.h index 1dd9d6b1e27..033137628e8 100644 --- a/arch/microblaze/include/asm/pci.h +++ b/arch/microblaze/include/asm/pci.h | |||
@@ -42,11 +42,6 @@ struct pci_dev; | |||
42 | */ | 42 | */ |
43 | #define pcibios_assign_all_busses() 0 | 43 | #define pcibios_assign_all_busses() 0 |
44 | 44 | ||
45 | static inline void pcibios_set_master(struct pci_dev *dev) | ||
46 | { | ||
47 | /* No special bus mastering setup handling */ | ||
48 | } | ||
49 | |||
50 | static inline void pcibios_penalize_isa_irq(int irq, int active) | 45 | static inline void pcibios_penalize_isa_irq(int irq, int active) |
51 | { | 46 | { |
52 | /* We don't do dynamic PCI IRQ allocation */ | 47 | /* We don't do dynamic PCI IRQ allocation */ |
diff --git a/arch/microblaze/pci/pci-common.c b/arch/microblaze/pci/pci-common.c index 0d71b2ed810..85f2ac1230a 100644 --- a/arch/microblaze/pci/pci-common.c +++ b/arch/microblaze/pci/pci-common.c | |||
@@ -190,6 +190,11 @@ int pcibios_add_platform_entries(struct pci_dev *pdev) | |||
190 | return device_create_file(&pdev->dev, &dev_attr_devspec); | 190 | return device_create_file(&pdev->dev, &dev_attr_devspec); |
191 | } | 191 | } |
192 | 192 | ||
193 | void pcibios_set_master(struct pci_dev *dev) | ||
194 | { | ||
195 | /* No special bus mastering setup handling */ | ||
196 | } | ||
197 | |||
193 | char __devinit *pcibios_setup(char *str) | 198 | char __devinit *pcibios_setup(char *str) |
194 | { | 199 | { |
195 | return str; | 200 | return str; |
@@ -1019,7 +1024,6 @@ static void __devinit pcibios_fixup_bridge(struct pci_bus *bus) | |||
1019 | struct pci_dev *dev = bus->self; | 1024 | struct pci_dev *dev = bus->self; |
1020 | 1025 | ||
1021 | pci_bus_for_each_resource(bus, res, i) { | 1026 | pci_bus_for_each_resource(bus, res, i) { |
1022 | res = bus->resource[i]; | ||
1023 | if (!res) | 1027 | if (!res) |
1024 | continue; | 1028 | continue; |
1025 | if (!res->flags) | 1029 | if (!res->flags) |
@@ -1219,7 +1223,6 @@ void pcibios_allocate_bus_resources(struct pci_bus *bus) | |||
1219 | pci_domain_nr(bus), bus->number); | 1223 | pci_domain_nr(bus), bus->number); |
1220 | 1224 | ||
1221 | pci_bus_for_each_resource(bus, res, i) { | 1225 | pci_bus_for_each_resource(bus, res, i) { |
1222 | res = bus->resource[i]; | ||
1223 | if (!res || !res->flags | 1226 | if (!res || !res->flags |
1224 | || res->start > res->end || res->parent) | 1227 | || res->start > res->end || res->parent) |
1225 | continue; | 1228 | continue; |
@@ -1510,14 +1513,18 @@ int pcibios_enable_device(struct pci_dev *dev, int mask) | |||
1510 | return pci_enable_resources(dev, mask); | 1513 | return pci_enable_resources(dev, mask); |
1511 | } | 1514 | } |
1512 | 1515 | ||
1513 | void __devinit pcibios_setup_phb_resources(struct pci_controller *hose) | 1516 | static void __devinit pcibios_setup_phb_resources(struct pci_controller *hose, struct list_head *resources) |
1514 | { | 1517 | { |
1515 | struct pci_bus *bus = hose->bus; | ||
1516 | struct resource *res; | 1518 | struct resource *res; |
1517 | int i; | 1519 | int i; |
1518 | 1520 | ||
1519 | /* Hookup PHB IO resource */ | 1521 | /* Hookup PHB IO resource */ |
1520 | bus->resource[0] = res = &hose->io_resource; | 1522 | res = &hose->io_resource; |
1523 | |||
1524 | /* Fixup IO space offset */ | ||
1525 | io_offset = (unsigned long)hose->io_base_virt - isa_io_base; | ||
1526 | res->start = (res->start + io_offset) & 0xffffffffu; | ||
1527 | res->end = (res->end + io_offset) & 0xffffffffu; | ||
1521 | 1528 | ||
1522 | if (!res->flags) { | 1529 | if (!res->flags) { |
1523 | printk(KERN_WARNING "PCI: I/O resource not set for host" | 1530 | printk(KERN_WARNING "PCI: I/O resource not set for host" |
@@ -1528,6 +1535,7 @@ void __devinit pcibios_setup_phb_resources(struct pci_controller *hose) | |||
1528 | res->end = res->start + IO_SPACE_LIMIT; | 1535 | res->end = res->start + IO_SPACE_LIMIT; |
1529 | res->flags = IORESOURCE_IO; | 1536 | res->flags = IORESOURCE_IO; |
1530 | } | 1537 | } |
1538 | pci_add_resource(resources, res); | ||
1531 | 1539 | ||
1532 | pr_debug("PCI: PHB IO resource = %016llx-%016llx [%lx]\n", | 1540 | pr_debug("PCI: PHB IO resource = %016llx-%016llx [%lx]\n", |
1533 | (unsigned long long)res->start, | 1541 | (unsigned long long)res->start, |
@@ -1550,7 +1558,7 @@ void __devinit pcibios_setup_phb_resources(struct pci_controller *hose) | |||
1550 | res->flags = IORESOURCE_MEM; | 1558 | res->flags = IORESOURCE_MEM; |
1551 | 1559 | ||
1552 | } | 1560 | } |
1553 | bus->resource[i+1] = res; | 1561 | pci_add_resource(resources, res); |
1554 | 1562 | ||
1555 | pr_debug("PCI: PHB MEM resource %d = %016llx-%016llx [%lx]\n", | 1563 | pr_debug("PCI: PHB MEM resource %d = %016llx-%016llx [%lx]\n", |
1556 | i, (unsigned long long)res->start, | 1564 | i, (unsigned long long)res->start, |
@@ -1573,34 +1581,27 @@ struct device_node *pcibios_get_phb_of_node(struct pci_bus *bus) | |||
1573 | 1581 | ||
1574 | static void __devinit pcibios_scan_phb(struct pci_controller *hose) | 1582 | static void __devinit pcibios_scan_phb(struct pci_controller *hose) |
1575 | { | 1583 | { |
1584 | LIST_HEAD(resources); | ||
1576 | struct pci_bus *bus; | 1585 | struct pci_bus *bus; |
1577 | struct device_node *node = hose->dn; | 1586 | struct device_node *node = hose->dn; |
1578 | unsigned long io_offset; | ||
1579 | struct resource *res = &hose->io_resource; | ||
1580 | 1587 | ||
1581 | pr_debug("PCI: Scanning PHB %s\n", | 1588 | pr_debug("PCI: Scanning PHB %s\n", |
1582 | node ? node->full_name : "<NO NAME>"); | 1589 | node ? node->full_name : "<NO NAME>"); |
1583 | 1590 | ||
1584 | /* Create an empty bus for the toplevel */ | 1591 | pcibios_setup_phb_resources(hose, &resources); |
1585 | bus = pci_create_bus(hose->parent, hose->first_busno, hose->ops, hose); | 1592 | |
1593 | bus = pci_scan_root_bus(hose->parent, hose->first_busno, | ||
1594 | hose->ops, hose, &resources); | ||
1586 | if (bus == NULL) { | 1595 | if (bus == NULL) { |
1587 | printk(KERN_ERR "Failed to create bus for PCI domain %04x\n", | 1596 | printk(KERN_ERR "Failed to create bus for PCI domain %04x\n", |
1588 | hose->global_number); | 1597 | hose->global_number); |
1598 | pci_free_resource_list(&resources); | ||
1589 | return; | 1599 | return; |
1590 | } | 1600 | } |
1591 | bus->secondary = hose->first_busno; | 1601 | bus->secondary = hose->first_busno; |
1592 | hose->bus = bus; | 1602 | hose->bus = bus; |
1593 | 1603 | ||
1594 | /* Fixup IO space offset */ | 1604 | hose->last_busno = bus->subordinate; |
1595 | io_offset = (unsigned long)hose->io_base_virt - isa_io_base; | ||
1596 | res->start = (res->start + io_offset) & 0xffffffffu; | ||
1597 | res->end = (res->end + io_offset) & 0xffffffffu; | ||
1598 | |||
1599 | /* Wire up PHB bus resources */ | ||
1600 | pcibios_setup_phb_resources(hose); | ||
1601 | |||
1602 | /* Scan children */ | ||
1603 | hose->last_busno = bus->subordinate = pci_scan_child_bus(bus); | ||
1604 | } | 1605 | } |
1605 | 1606 | ||
1606 | static int __init pcibios_init(void) | 1607 | static int __init pcibios_init(void) |
@@ -1614,8 +1615,6 @@ static int __init pcibios_init(void) | |||
1614 | list_for_each_entry_safe(hose, tmp, &hose_list, list_node) { | 1615 | list_for_each_entry_safe(hose, tmp, &hose_list, list_node) { |
1615 | hose->last_busno = 0xff; | 1616 | hose->last_busno = 0xff; |
1616 | pcibios_scan_phb(hose); | 1617 | pcibios_scan_phb(hose); |
1617 | printk(KERN_INFO "calling pci_bus_add_devices()\n"); | ||
1618 | pci_bus_add_devices(hose->bus); | ||
1619 | if (next_busno <= hose->last_busno) | 1618 | if (next_busno <= hose->last_busno) |
1620 | next_busno = hose->last_busno + 1; | 1619 | next_busno = hose->last_busno + 1; |
1621 | } | 1620 | } |