提交 129aaabc 编写于 作者: B Bjorn Helgaas

Merge branches 'pci/aer', 'pci/misc' and 'pci/virtualization' into next

* pci/aer:
  PCI/AER: Use list_first_entry_or_null() to simplify code
  PCI/AER: Restore pci_ops pointer while calling original pci_ops
  PCI/AER: Rename pci_ops_aer to aer_inj_pci_ops

* pci/misc:
  PCI: Remove includes of asm/pci-bridge.h
  PCI: Remove empty asm-generic/pci-bridge.h
  ARM64: PCI: Remove generated include of asm-generic/pci-bridge.h
  PCI: Remove includes of empty asm-generic/pci-bridge.h
  PCI: Move pci_set_flags() from asm-generic/pci-bridge.h to linux/pci.h
  PCI/PME: Restructure pcie_pme_suspend() to prevent compiler warning
  PCI/PME: Remove redundant port lookup
  PCI: Check device_attach() return value always

* pci/virtualization:
  PCI: Add ACS quirk for all Cavium devices
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <linux/scatterlist.h> #include <linux/scatterlist.h>
#include <asm/machvec.h> #include <asm/machvec.h>
#include <asm-generic/pci-bridge.h>
/* /*
* The following structure is used to manage multiple PCI busses. * The following structure is used to manage multiple PCI busses.
......
...@@ -3,8 +3,6 @@ ...@@ -3,8 +3,6 @@
#ifdef __KERNEL__ #ifdef __KERNEL__
#include <asm-generic/pci-dma-compat.h> #include <asm-generic/pci-dma-compat.h>
#include <asm-generic/pci-bridge.h>
#include <asm/mach/pci.h> /* for pci_sys_data */ #include <asm/mach/pci.h> /* for pci_sys_data */
extern unsigned long pcibios_min_io; extern unsigned long pcibios_min_io;
...@@ -41,5 +39,4 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) ...@@ -41,5 +39,4 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
} }
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#endif #endif
generic-y += bug.h generic-y += bug.h
generic-y += bugs.h generic-y += bugs.h
generic-y += checksum.h generic-y += checksum.h
...@@ -31,7 +29,6 @@ generic-y += msgbuf.h ...@@ -31,7 +29,6 @@ generic-y += msgbuf.h
generic-y += msi.h generic-y += msi.h
generic-y += mutex.h generic-y += mutex.h
generic-y += pci.h generic-y += pci.h
generic-y += pci-bridge.h
generic-y += poll.h generic-y += poll.h
generic-y += preempt.h generic-y += preempt.h
generic-y += resource.h generic-y += resource.h
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm-generic/pci-bridge.h>
#include <asm-generic/pci-dma-compat.h> #include <asm-generic/pci-dma-compat.h>
#define PCIBIOS_MIN_IO 0x1000 #define PCIBIOS_MIN_IO 0x1000
......
...@@ -19,8 +19,6 @@ ...@@ -19,8 +19,6 @@
#include <linux/of_platform.h> #include <linux/of_platform.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <asm/pci-bridge.h>
/* /*
* Called after each bus is probed, but before its children are examined * Called after each bus is probed, but before its children are examined
*/ */
......
...@@ -102,7 +102,6 @@ static inline void pci_resource_to_user(const struct pci_dev *dev, int bar, ...@@ -102,7 +102,6 @@ static inline void pci_resource_to_user(const struct pci_dev *dev, int bar,
#include <linux/scatterlist.h> #include <linux/scatterlist.h>
#include <linux/string.h> #include <linux/string.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm-generic/pci-bridge.h>
struct pci_dev; struct pci_dev;
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <asm-generic/pci-bridge.h>
struct device_node; struct device_node;
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#ifdef __KERNEL__ #ifdef __KERNEL__
#include <asm-generic/pci-dma-compat.h> #include <asm-generic/pci-dma-compat.h>
#include <asm-generic/pci-bridge.h>
#include <asm-generic/pci.h> #include <asm-generic/pci.h>
#include <mach/hardware.h> /* for PCIBIOS_MIN_* */ #include <mach/hardware.h> /* for PCIBIOS_MIN_* */
...@@ -23,5 +22,4 @@ extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, ...@@ -23,5 +22,4 @@ extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
enum pci_mmap_state mmap_state, int write_combine); enum pci_mmap_state mmap_state, int write_combine);
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#endif #endif
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include <linux/dmi.h> #include <linux/dmi.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <asm-generic/pci-bridge.h>
#include <asm/acpi.h> #include <asm/acpi.h>
#include <asm/segment.h> #include <asm/segment.h>
#include <asm/io.h> #include <asm/io.h>
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <linux/scatterlist.h> #include <linux/scatterlist.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/gfp.h> #include <linux/gfp.h>
#include <linux/pci.h>
#include <scsi/scsi.h> #include <scsi/scsi.h>
#include <scsi/scsi_host.h> #include <scsi/scsi_host.h>
...@@ -30,7 +31,6 @@ ...@@ -30,7 +31,6 @@
#include <asm/macio.h> #include <asm/macio.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/dbdma.h> #include <asm/dbdma.h>
#include <asm/pci-bridge.h>
#include <asm/machdep.h> #include <asm/machdep.h>
#include <asm/pmac_feature.h> #include <asm/pmac_feature.h>
#include <asm/mediabay.h> #include <asm/mediabay.h>
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <asm/uninorth.h> #include <asm/uninorth.h>
#include <asm/pci-bridge.h>
#include <asm/prom.h> #include <asm/prom.h>
#include <asm/pmac_feature.h> #include <asm/pmac_feature.h>
#include "agp.h" #include "agp.h"
......
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
#include <asm/machdep.h> #include <asm/machdep.h>
#include <asm/pmac_feature.h> #include <asm/pmac_feature.h>
#include <asm/prom.h> #include <asm/prom.h>
#include <asm/pci-bridge.h>
#endif /* CONFIG_PPC_PMAC */ #endif /* CONFIG_PPC_PMAC */
/* from radeon_legacy_encoder.c */ /* from radeon_legacy_encoder.c */
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#ifdef CONFIG_PPC_PMAC #ifdef CONFIG_PPC_PMAC
#include <asm/prom.h> #include <asm/prom.h>
#include <asm/pci-bridge.h>
#endif #endif
#define DRV_NAME "pdc202xx_new" #define DRV_NAME "pdc202xx_new"
......
...@@ -40,7 +40,6 @@ ...@@ -40,7 +40,6 @@
#include <asm/io.h> #include <asm/io.h>
#include <asm/dbdma.h> #include <asm/dbdma.h>
#include <asm/ide.h> #include <asm/ide.h>
#include <asm/pci-bridge.h>
#include <asm/machdep.h> #include <asm/machdep.h>
#include <asm/pmac_feature.h> #include <asm/pmac_feature.h>
#include <asm/sections.h> #include <asm/sections.h>
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#include <asm/macio.h> #include <asm/macio.h>
#include <asm/pmac_feature.h> #include <asm/pmac_feature.h>
#include <asm/prom.h> #include <asm/prom.h>
#include <asm/pci-bridge.h>
#undef DEBUG #undef DEBUG
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <asm/opal.h> #include <asm/opal.h>
#include <asm/msi_bitmap.h> #include <asm/msi_bitmap.h>
#include <asm/pci-bridge.h> /* for struct pci_controller */
#include <asm/pnv-pci.h> #include <asm/pnv-pci.h>
#include <asm/io.h> #include <asm/io.h>
......
...@@ -51,7 +51,6 @@ ...@@ -51,7 +51,6 @@
#endif #endif
#ifdef CONFIG_PPC_PMAC #ifdef CONFIG_PPC_PMAC
#include <asm/pci-bridge.h>
#include <asm/prom.h> #include <asm/prom.h>
#include <asm/machdep.h> #include <asm/machdep.h>
#include <asm/pmac_feature.h> #include <asm/pmac_feature.h>
......
...@@ -48,7 +48,6 @@ ...@@ -48,7 +48,6 @@
#include <linux/wait.h> #include <linux/wait.h>
#include <linux/workqueue.h> #include <linux/workqueue.h>
#include <linux/bitops.h> #include <linux/bitops.h>
#include <asm/pci-bridge.h>
#include <net/checksum.h> #include <net/checksum.h>
#include "spider_net.h" #include "spider_net.h"
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#include <linux/of_device.h> #include <linux/of_device.h>
#include <linux/of_pci.h> #include <linux/of_pci.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <asm-generic/pci-bridge.h>
static inline int __of_pci_pci_compare(struct device_node *node, static inline int __of_pci_pci_compare(struct device_node *node,
unsigned int data) unsigned int data)
......
...@@ -291,7 +291,12 @@ void pci_bus_add_device(struct pci_dev *dev) ...@@ -291,7 +291,12 @@ void pci_bus_add_device(struct pci_dev *dev)
dev->match_driver = true; dev->match_driver = true;
retval = device_attach(&dev->dev); retval = device_attach(&dev->dev);
WARN_ON(retval < 0); if (retval < 0) {
dev_warn(&dev->dev, "device attach failed (%d)\n", retval);
pci_proc_detach_device(dev);
pci_remove_sysfs_dev_files(dev);
return;
}
dev->is_added = 1; dev->is_added = 1;
} }
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include <linux/device.h> #include <linux/device.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/pci_hotplug.h> #include <linux/pci_hotplug.h>
#include <asm-generic/pci-bridge.h>
#include <asm/setup.h> #include <asm/setup.h>
#include <linux/aer.h> #include <linux/aer.h>
#include "pci.h" #include "pci.h"
......
...@@ -124,16 +124,13 @@ static struct pci_ops *__find_pci_bus_ops(struct pci_bus *bus) ...@@ -124,16 +124,13 @@ static struct pci_ops *__find_pci_bus_ops(struct pci_bus *bus)
static struct pci_bus_ops *pci_bus_ops_pop(void) static struct pci_bus_ops *pci_bus_ops_pop(void)
{ {
unsigned long flags; unsigned long flags;
struct pci_bus_ops *bus_ops = NULL; struct pci_bus_ops *bus_ops;
spin_lock_irqsave(&inject_lock, flags); spin_lock_irqsave(&inject_lock, flags);
if (list_empty(&pci_bus_ops_list)) bus_ops = list_first_entry_or_null(&pci_bus_ops_list,
bus_ops = NULL; struct pci_bus_ops, list);
else { if (bus_ops)
struct list_head *lh = pci_bus_ops_list.next; list_del(&bus_ops->list);
list_del(lh);
bus_ops = list_entry(lh, struct pci_bus_ops, list);
}
spin_unlock_irqrestore(&inject_lock, flags); spin_unlock_irqrestore(&inject_lock, flags);
return bus_ops; return bus_ops;
} }
...@@ -181,14 +178,16 @@ static u32 *find_pci_config_dword(struct aer_error *err, int where, ...@@ -181,14 +178,16 @@ static u32 *find_pci_config_dword(struct aer_error *err, int where,
return target; return target;
} }
static int pci_read_aer(struct pci_bus *bus, unsigned int devfn, int where, static int aer_inj_read_config(struct pci_bus *bus, unsigned int devfn,
int size, u32 *val) int where, int size, u32 *val)
{ {
u32 *sim; u32 *sim;
struct aer_error *err; struct aer_error *err;
unsigned long flags; unsigned long flags;
struct pci_ops *ops; struct pci_ops *ops;
struct pci_ops *my_ops;
int domain; int domain;
int rv;
spin_lock_irqsave(&inject_lock, flags); spin_lock_irqsave(&inject_lock, flags);
if (size != sizeof(u32)) if (size != sizeof(u32))
...@@ -208,19 +207,32 @@ static int pci_read_aer(struct pci_bus *bus, unsigned int devfn, int where, ...@@ -208,19 +207,32 @@ static int pci_read_aer(struct pci_bus *bus, unsigned int devfn, int where,
} }
out: out:
ops = __find_pci_bus_ops(bus); ops = __find_pci_bus_ops(bus);
/*
* pci_lock must already be held, so we can directly
* manipulate bus->ops. Many config access functions,
* including pci_generic_config_read() require the original
* bus->ops be installed to function, so temporarily put them
* back.
*/
my_ops = bus->ops;
bus->ops = ops;
rv = ops->read(bus, devfn, where, size, val);
bus->ops = my_ops;
spin_unlock_irqrestore(&inject_lock, flags); spin_unlock_irqrestore(&inject_lock, flags);
return ops->read(bus, devfn, where, size, val); return rv;
} }
static int pci_write_aer(struct pci_bus *bus, unsigned int devfn, int where, static int aer_inj_write_config(struct pci_bus *bus, unsigned int devfn,
int size, u32 val) int where, int size, u32 val)
{ {
u32 *sim; u32 *sim;
struct aer_error *err; struct aer_error *err;
unsigned long flags; unsigned long flags;
int rw1cs; int rw1cs;
struct pci_ops *ops; struct pci_ops *ops;
struct pci_ops *my_ops;
int domain; int domain;
int rv;
spin_lock_irqsave(&inject_lock, flags); spin_lock_irqsave(&inject_lock, flags);
if (size != sizeof(u32)) if (size != sizeof(u32))
...@@ -243,13 +255,24 @@ static int pci_write_aer(struct pci_bus *bus, unsigned int devfn, int where, ...@@ -243,13 +255,24 @@ static int pci_write_aer(struct pci_bus *bus, unsigned int devfn, int where,
} }
out: out:
ops = __find_pci_bus_ops(bus); ops = __find_pci_bus_ops(bus);
/*
* pci_lock must already be held, so we can directly
* manipulate bus->ops. Many config access functions,
* including pci_generic_config_write() require the original
* bus->ops be installed to function, so temporarily put them
* back.
*/
my_ops = bus->ops;
bus->ops = ops;
rv = ops->write(bus, devfn, where, size, val);
bus->ops = my_ops;
spin_unlock_irqrestore(&inject_lock, flags); spin_unlock_irqrestore(&inject_lock, flags);
return ops->write(bus, devfn, where, size, val); return rv;
} }
static struct pci_ops pci_ops_aer = { static struct pci_ops aer_inj_pci_ops = {
.read = pci_read_aer, .read = aer_inj_read_config,
.write = pci_write_aer, .write = aer_inj_write_config,
}; };
static void pci_bus_ops_init(struct pci_bus_ops *bus_ops, static void pci_bus_ops_init(struct pci_bus_ops *bus_ops,
...@@ -270,9 +293,9 @@ static int pci_bus_set_aer_ops(struct pci_bus *bus) ...@@ -270,9 +293,9 @@ static int pci_bus_set_aer_ops(struct pci_bus *bus)
bus_ops = kmalloc(sizeof(*bus_ops), GFP_KERNEL); bus_ops = kmalloc(sizeof(*bus_ops), GFP_KERNEL);
if (!bus_ops) if (!bus_ops)
return -ENOMEM; return -ENOMEM;
ops = pci_bus_set_ops(bus, &pci_ops_aer); ops = pci_bus_set_ops(bus, &aer_inj_pci_ops);
spin_lock_irqsave(&inject_lock, flags); spin_lock_irqsave(&inject_lock, flags);
if (ops == &pci_ops_aer) if (ops == &aer_inj_pci_ops)
goto out; goto out;
pci_bus_ops_init(bus_ops, bus, ops); pci_bus_ops_init(bus_ops, bus, ops);
list_add(&bus_ops->list, &pci_bus_ops_list); list_add(&bus_ops->list, &pci_bus_ops_list);
......
...@@ -396,7 +396,7 @@ static int pcie_pme_suspend(struct pcie_device *srv) ...@@ -396,7 +396,7 @@ static int pcie_pme_suspend(struct pcie_device *srv)
{ {
struct pcie_pme_service_data *data = get_service_data(srv); struct pcie_pme_service_data *data = get_service_data(srv);
struct pci_dev *port = srv->port; struct pci_dev *port = srv->port;
bool wakeup; bool wakeup, wake_irq_enabled = false;
int ret; int ret;
if (device_may_wakeup(&port->dev)) { if (device_may_wakeup(&port->dev)) {
...@@ -409,11 +409,12 @@ static int pcie_pme_suspend(struct pcie_device *srv) ...@@ -409,11 +409,12 @@ static int pcie_pme_suspend(struct pcie_device *srv)
spin_lock_irq(&data->lock); spin_lock_irq(&data->lock);
if (wakeup) { if (wakeup) {
ret = enable_irq_wake(srv->irq); ret = enable_irq_wake(srv->irq);
if (ret == 0) {
data->suspend_level = PME_SUSPEND_WAKEUP; data->suspend_level = PME_SUSPEND_WAKEUP;
wake_irq_enabled = true;
} }
if (!wakeup || ret) { }
struct pci_dev *port = srv->port; if (!wake_irq_enabled) {
pcie_pme_interrupt_enable(port, false); pcie_pme_interrupt_enable(port, false);
pcie_clear_root_pme_status(port); pcie_clear_root_pme_status(port);
data->suspend_level = PME_SUSPEND_NOIRQ; data->suspend_level = PME_SUSPEND_NOIRQ;
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include <linux/pci-aspm.h> #include <linux/pci-aspm.h>
#include <linux/aer.h> #include <linux/aer.h>
#include <linux/acpi.h> #include <linux/acpi.h>
#include <asm-generic/pci-bridge.h>
#include "pci.h" #include "pci.h"
#define CARDBUS_LATENCY_TIMER 176 /* secondary latency timer */ #define CARDBUS_LATENCY_TIMER 176 /* secondary latency timer */
...@@ -1803,6 +1802,13 @@ static int only_one_child(struct pci_bus *bus) ...@@ -1803,6 +1802,13 @@ static int only_one_child(struct pci_bus *bus)
return 0; return 0;
if (pci_pcie_type(parent) == PCI_EXP_TYPE_ROOT_PORT) if (pci_pcie_type(parent) == PCI_EXP_TYPE_ROOT_PORT)
return 1; return 1;
/*
* PCIe downstream ports are bridges that normally lead to only a
* device 0, but if PCI_SCAN_ALL_PCIE_DEVS is set, scan all
* possible devices, not just device 0. See PCIe spec r3.0,
* sec 7.3.1.
*/
if (parent->has_secondary_link && if (parent->has_secondary_link &&
!pci_has_flag(PCI_SCAN_ALL_PCIE_DEVS)) !pci_has_flag(PCI_SCAN_ALL_PCIE_DEVS))
return 1; return 1;
......
...@@ -3832,6 +3832,19 @@ static int pci_quirk_amd_sb_acs(struct pci_dev *dev, u16 acs_flags) ...@@ -3832,6 +3832,19 @@ static int pci_quirk_amd_sb_acs(struct pci_dev *dev, u16 acs_flags)
#endif #endif
} }
static int pci_quirk_cavium_acs(struct pci_dev *dev, u16 acs_flags)
{
/*
* Cavium devices matching this quirk do not perform peer-to-peer
* with other functions, allowing masking out these bits as if they
* were unimplemented in the ACS capability.
*/
acs_flags &= ~(PCI_ACS_SV | PCI_ACS_TB | PCI_ACS_RR |
PCI_ACS_CR | PCI_ACS_UF | PCI_ACS_DT);
return acs_flags ? 0 : 1;
}
/* /*
* Many Intel PCH root ports do provide ACS-like features to disable peer * Many Intel PCH root ports do provide ACS-like features to disable peer
* transactions and validate bus numbers in requests, but do not provide an * transactions and validate bus numbers in requests, but do not provide an
...@@ -3984,6 +3997,8 @@ static const struct pci_dev_acs_enabled { ...@@ -3984,6 +3997,8 @@ static const struct pci_dev_acs_enabled {
{ PCI_VENDOR_ID_INTEL, PCI_ANY_ID, pci_quirk_intel_pch_acs }, { PCI_VENDOR_ID_INTEL, PCI_ANY_ID, pci_quirk_intel_pch_acs },
{ 0x19a2, 0x710, pci_quirk_mf_endpoint_acs }, /* Emulex BE3-R */ { 0x19a2, 0x710, pci_quirk_mf_endpoint_acs }, /* Emulex BE3-R */
{ 0x10df, 0x720, pci_quirk_mf_endpoint_acs }, /* Emulex Skyhawk-R */ { 0x10df, 0x720, pci_quirk_mf_endpoint_acs }, /* Emulex Skyhawk-R */
/* Cavium ThunderX */
{ PCI_VENDOR_ID_CAVIUM, PCI_ANY_ID, pci_quirk_cavium_acs },
{ 0 } { 0 }
}; };
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/cache.h> #include <linux/cache.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <asm-generic/pci-bridge.h>
#include "pci.h" #include "pci.h"
unsigned int pci_flags; unsigned int pci_flags;
......
...@@ -18,11 +18,11 @@ ...@@ -18,11 +18,11 @@
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/pci.h>
#include <asm/dbdma.h> #include <asm/dbdma.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/prom.h> #include <asm/prom.h>
#include <asm/pci-bridge.h>
#include <asm/macio.h> #include <asm/macio.h>
#include <scsi/scsi.h> #include <scsi/scsi.h>
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/reboot.h> #include <linux/reboot.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/pci.h>
#include <asm/dbdma.h> #include <asm/dbdma.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
...@@ -38,7 +39,6 @@ ...@@ -38,7 +39,6 @@
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/machdep.h> #include <asm/machdep.h>
#include <asm/pmac_feature.h> #include <asm/pmac_feature.h>
#include <asm/pci-bridge.h>
#include <asm/macio.h> #include <asm/macio.h>
#include <scsi/scsi.h> #include <scsi/scsi.h>
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#ifdef CONFIG_PPC_PMAC #ifdef CONFIG_PPC_PMAC
#include <asm/machdep.h> #include <asm/machdep.h>
#include <asm/pmac_feature.h> #include <asm/pmac_feature.h>
#include <asm/pci-bridge.h>
#include <asm/prom.h> #include <asm/prom.h>
#endif #endif
......
...@@ -68,7 +68,6 @@ ...@@ -68,7 +68,6 @@
#include <asm/machdep.h> #include <asm/machdep.h>
#include <asm/pmac_feature.h> #include <asm/pmac_feature.h>
#include <asm/prom.h> #include <asm/prom.h>
#include <asm/pci-bridge.h>
#include "../macmodes.h" #include "../macmodes.h"
#endif #endif
......
...@@ -76,7 +76,6 @@ ...@@ -76,7 +76,6 @@
#ifdef CONFIG_PPC #ifdef CONFIG_PPC
#include <asm/pci-bridge.h>
#include "../macmodes.h" #include "../macmodes.h"
#ifdef CONFIG_BOOTX_TEXT #ifdef CONFIG_BOOTX_TEXT
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
#if defined(CONFIG_PPC) #if defined(CONFIG_PPC)
#include <linux/nvram.h> #include <linux/nvram.h>
#include <asm/prom.h> #include <asm/prom.h>
#include <asm/pci-bridge.h>
#include "macmodes.h" #include "macmodes.h"
#endif #endif
......
...@@ -47,7 +47,6 @@ ...@@ -47,7 +47,6 @@
#if defined(CONFIG_PPC_PMAC) #if defined(CONFIG_PPC_PMAC)
#include <asm/prom.h> #include <asm/prom.h>
#include <asm/pci-bridge.h>
#include "../macmodes.h" #include "../macmodes.h"
#endif #endif
......
...@@ -28,10 +28,6 @@ ...@@ -28,10 +28,6 @@
#include <linux/pci.h> #include <linux/pci.h>
#include <asm/io.h> #include <asm/io.h>
#ifdef CONFIG_PPC64
#include <asm/pci-bridge.h>
#endif
#ifdef CONFIG_PPC32 #ifdef CONFIG_PPC32
#include <asm/bootx.h> #include <asm/bootx.h>
#endif #endif
......
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
#ifndef _ASM_GENERIC_PCI_BRIDGE_H
#define _ASM_GENERIC_PCI_BRIDGE_H
#ifdef __KERNEL__
enum {
/* Force re-assigning all resources (ignore firmware
* setup completely)
*/
PCI_REASSIGN_ALL_RSRC = 0x00000001,
/* Re-assign all bus numbers */
PCI_REASSIGN_ALL_BUS = 0x00000002,
/* Do not try to assign, just use existing setup */
PCI_PROBE_ONLY = 0x00000004,
/* Don't bother with ISA alignment unless the bridge has
* ISA forwarding enabled
*/
PCI_CAN_SKIP_ISA_ALIGN = 0x00000008,
/* Enable domain numbers in /proc */
PCI_ENABLE_PROC_DOMAINS = 0x00000010,
/* ... except for domain 0 */
PCI_COMPAT_DOMAIN_0 = 0x00000020,
/* PCIe downstream ports are bridges that normally lead to only a
* device 0, but if this is set, we scan all possible devices, not
* just device 0.
*/
PCI_SCAN_ALL_PCIE_DEVS = 0x00000040,
};
#ifdef CONFIG_PCI
extern unsigned int pci_flags;
static inline void pci_set_flags(int flags)
{
pci_flags = flags;
}
static inline void pci_add_flags(int flags)
{
pci_flags |= flags;
}
static inline void pci_clear_flags(int flags)
{
pci_flags &= ~flags;
}
static inline int pci_has_flag(int flag)
{
return pci_flags & flag;
}
#else
static inline void pci_set_flags(int flags) { }
static inline void pci_add_flags(int flags) { }
static inline void pci_clear_flags(int flags) { }
static inline int pci_has_flag(int flag)
{
return 0;
}
#endif /* CONFIG_PCI */
#endif /* __KERNEL__ */
#endif /* _ASM_GENERIC_PCI_BRIDGE_H */
...@@ -746,9 +746,26 @@ struct pci_driver { ...@@ -746,9 +746,26 @@ struct pci_driver {
.vendor = PCI_VENDOR_ID_##vend, .device = (dev), \ .vendor = PCI_VENDOR_ID_##vend, .device = (dev), \
.subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID, 0, 0 .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID, 0, 0
enum {
PCI_REASSIGN_ALL_RSRC = 0x00000001, /* ignore firmware setup */
PCI_REASSIGN_ALL_BUS = 0x00000002, /* reassign all bus numbers */
PCI_PROBE_ONLY = 0x00000004, /* use existing setup */
PCI_CAN_SKIP_ISA_ALIGN = 0x00000008, /* don't do ISA alignment */
PCI_ENABLE_PROC_DOMAINS = 0x00000010, /* enable domains in /proc */
PCI_COMPAT_DOMAIN_0 = 0x00000020, /* ... except domain 0 */
PCI_SCAN_ALL_PCIE_DEVS = 0x00000040, /* scan all, not just dev 0 */
};
/* these external functions are only available when PCI support is enabled */ /* these external functions are only available when PCI support is enabled */
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
extern unsigned int pci_flags;
static inline void pci_set_flags(int flags) { pci_flags = flags; }
static inline void pci_add_flags(int flags) { pci_flags |= flags; }
static inline void pci_clear_flags(int flags) { pci_flags &= ~flags; }
static inline int pci_has_flag(int flag) { return pci_flags & flag; }
void pcie_bus_configure_settings(struct pci_bus *bus); void pcie_bus_configure_settings(struct pci_bus *bus);
enum pcie_bus_config_types { enum pcie_bus_config_types {
...@@ -1405,6 +1422,11 @@ void pci_register_set_vga_state(arch_set_vga_state_t func); ...@@ -1405,6 +1422,11 @@ void pci_register_set_vga_state(arch_set_vga_state_t func);
#else /* CONFIG_PCI is not enabled */ #else /* CONFIG_PCI is not enabled */
static inline void pci_set_flags(int flags) { }
static inline void pci_add_flags(int flags) { }
static inline void pci_clear_flags(int flags) { }
static inline int pci_has_flag(int flag) { return 0; }
/* /*
* If the system does not have PCI, clearly these return errors. Define * If the system does not have PCI, clearly these return errors. Define
* these as simple inline functions to avoid hair in drivers. * these as simple inline functions to avoid hair in drivers.
......
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
#include "pmac.h" #include "pmac.h"
#include <sound/pcm_params.h> #include <sound/pcm_params.h>
#include <asm/pmac_feature.h> #include <asm/pmac_feature.h>
#include <asm/pci-bridge.h>
/* fixed frequency table for awacs, screamer, burgundy, DACA (44100 max) */ /* fixed frequency table for awacs, screamer, burgundy, DACA (44100 max) */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册