2005-04-16 15:20:36 -07:00
|
|
|
#include <linux/pci.h>
|
|
|
|
#include <linux/acpi.h>
|
|
|
|
#include <linux/init.h>
|
2005-09-30 09:34:42 -07:00
|
|
|
#include <linux/irq.h>
|
2005-09-12 09:49:24 -07:00
|
|
|
#include <asm/numa.h>
|
2005-04-16 15:20:36 -07:00
|
|
|
#include "pci.h"
|
|
|
|
|
|
|
|
struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_device *device, int domain, int busnum)
|
|
|
|
{
|
2005-09-12 09:49:24 -07:00
|
|
|
struct pci_bus *bus;
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
if (domain != 0) {
|
|
|
|
printk(KERN_WARNING "PCI: Multiple domains not supported\n");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2005-09-12 09:49:24 -07:00
|
|
|
bus = pcibios_scan_root(busnum);
|
|
|
|
#ifdef CONFIG_ACPI_NUMA
|
|
|
|
if (bus != NULL) {
|
|
|
|
int pxm = acpi_get_pxm(device->handle);
|
|
|
|
if (pxm >= 0) {
|
|
|
|
bus->sysdata = (void *)(unsigned long)pxm_to_node(pxm);
|
|
|
|
printk("bus %d -> pxm %d -> node %ld\n",
|
|
|
|
busnum, pxm, (long)(bus->sysdata));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return bus;
|
2005-04-16 15:20:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
extern int pci_routeirq;
|
|
|
|
static int __init pci_acpi_init(void)
|
|
|
|
{
|
|
|
|
struct pci_dev *dev = NULL;
|
|
|
|
|
|
|
|
if (pcibios_scanned)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
if (acpi_noirq)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
printk(KERN_INFO "PCI: Using ACPI for IRQ routing\n");
|
|
|
|
acpi_irq_penalty_init();
|
|
|
|
pcibios_scanned++;
|
|
|
|
pcibios_enable_irq = acpi_pci_irq_enable;
|
2005-07-27 20:02:00 -07:00
|
|
|
pcibios_disable_irq = acpi_pci_irq_disable;
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
if (pci_routeirq) {
|
|
|
|
/*
|
|
|
|
* PCI IRQ routing is set up by pci_enable_device(), but we
|
|
|
|
* also do it here in case there are still broken drivers that
|
|
|
|
* don't use pci_enable_device().
|
|
|
|
*/
|
|
|
|
printk(KERN_INFO "PCI: Routing PCI interrupts for all devices because \"pci=routeirq\" specified\n");
|
2005-11-07 00:39:36 -07:00
|
|
|
for_each_pci_dev(dev)
|
2005-04-16 15:20:36 -07:00
|
|
|
acpi_pci_irq_enable(dev);
|
|
|
|
} else
|
|
|
|
printk(KERN_INFO "PCI: If a device doesn't work, try \"pci=routeirq\". If it helps, post a report\n");
|
|
|
|
|
|
|
|
#ifdef CONFIG_X86_IO_APIC
|
|
|
|
if (acpi_ioapic)
|
|
|
|
print_IO_APIC();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
subsys_initcall(pci_acpi_init);
|