PCI: skip ISA ioresource alignment on some systems
[linux-2.6/mini2440.git] / arch / x86 / pci / acpi.c
blob1dd6f3fc077db0724aaea14752577c6882b23bed
1 #include <linux/pci.h>
2 #include <linux/acpi.h>
3 #include <linux/init.h>
4 #include <linux/irq.h>
5 #include <linux/dmi.h>
6 #include <asm/numa.h>
7 #include "pci.h"
9 static int __devinit can_skip_ioresource_align(struct dmi_system_id *d)
11 pci_probe |= PCI_CAN_SKIP_ISA_ALIGN;
12 printk(KERN_INFO "PCI: %s detected, can skip ISA alignment\n", d->ident);
13 return 0;
16 static struct dmi_system_id acpi_pciprobe_dmi_table[] = {
18 * Systems where PCI IO resource ISA alignment can be skipped
19 * when the ISA enable bit in the bridge control is not set
22 .callback = can_skip_ioresource_align,
23 .ident = "IBM System x3800",
24 .matches = {
25 DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
26 DMI_MATCH(DMI_PRODUCT_NAME, "x3800"),
30 .callback = can_skip_ioresource_align,
31 .ident = "IBM System x3850",
32 .matches = {
33 DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
34 DMI_MATCH(DMI_PRODUCT_NAME, "x3850"),
38 .callback = can_skip_ioresource_align,
39 .ident = "IBM System x3950",
40 .matches = {
41 DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
42 DMI_MATCH(DMI_PRODUCT_NAME, "x3950"),
48 struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_device *device, int domain, int busnum)
50 struct pci_bus *bus;
51 struct pci_sysdata *sd;
52 int pxm;
54 dmi_check_system(acpi_pciprobe_dmi_table);
56 /* Allocate per-root-bus (not per bus) arch-specific data.
57 * TODO: leak; this memory is never freed.
58 * It's arguable whether it's worth the trouble to care.
60 sd = kzalloc(sizeof(*sd), GFP_KERNEL);
61 if (!sd) {
62 printk(KERN_ERR "PCI: OOM, not probing PCI bus %02x\n", busnum);
63 return NULL;
66 if (domain != 0) {
67 printk(KERN_WARNING "PCI: Multiple domains not supported\n");
68 kfree(sd);
69 return NULL;
72 sd->node = -1;
74 pxm = acpi_get_pxm(device->handle);
75 #ifdef CONFIG_ACPI_NUMA
76 if (pxm >= 0)
77 sd->node = pxm_to_node(pxm);
78 #endif
80 bus = pci_scan_bus_parented(NULL, busnum, &pci_root_ops, sd);
81 if (!bus)
82 kfree(sd);
84 #ifdef CONFIG_ACPI_NUMA
85 if (bus != NULL) {
86 if (pxm >= 0) {
87 printk("bus %d -> pxm %d -> node %d\n",
88 busnum, pxm, sd->node);
91 #endif
93 return bus;
96 extern int pci_routeirq;
97 static int __init pci_acpi_init(void)
99 struct pci_dev *dev = NULL;
101 if (pcibios_scanned)
102 return 0;
104 if (acpi_noirq)
105 return 0;
107 printk(KERN_INFO "PCI: Using ACPI for IRQ routing\n");
108 acpi_irq_penalty_init();
109 pcibios_scanned++;
110 pcibios_enable_irq = acpi_pci_irq_enable;
111 pcibios_disable_irq = acpi_pci_irq_disable;
113 if (pci_routeirq) {
115 * PCI IRQ routing is set up by pci_enable_device(), but we
116 * also do it here in case there are still broken drivers that
117 * don't use pci_enable_device().
119 printk(KERN_INFO "PCI: Routing PCI interrupts for all devices because \"pci=routeirq\" specified\n");
120 for_each_pci_dev(dev)
121 acpi_pci_irq_enable(dev);
122 } else
123 printk(KERN_INFO "PCI: If a device doesn't work, try \"pci=routeirq\". If it helps, post a report\n");
125 #ifdef CONFIG_X86_IO_APIC
126 if (acpi_ioapic)
127 print_IO_APIC();
128 #endif
130 return 0;
132 subsys_initcall(pci_acpi_init);