]>
Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | /* |
2 | * Do early PCI probing for bug detection when the main PCI subsystem is | |
3 | * not up yet. | |
4 | */ | |
5 | #include <linux/init.h> | |
6 | #include <linux/kernel.h> | |
7 | #include <linux/pci.h> | |
d44647b0 AC |
8 | #include <linux/acpi.h> |
9 | ||
1da177e4 LT |
10 | #include <asm/pci-direct.h> |
11 | #include <asm/acpi.h> | |
f9262c12 | 12 | #include <asm/apic.h> |
b0d0a4ba | 13 | #include <asm/irq.h> |
1da177e4 | 14 | |
d44647b0 AC |
15 | #ifdef CONFIG_ACPI |
16 | ||
ceb6c468 | 17 | static int __init nvidia_hpet_check(struct acpi_table_header *header) |
d44647b0 | 18 | { |
d44647b0 AC |
19 | return 0; |
20 | } | |
21 | #endif | |
22 | ||
4be44fcd | 23 | static int __init check_bridge(int vendor, int device) |
1da177e4 | 24 | { |
f9262c12 | 25 | #ifdef CONFIG_ACPI |
afd3810d | 26 | static int warned; |
d44647b0 AC |
27 | /* According to Nvidia all timer overrides are bogus unless HPET |
28 | is enabled. */ | |
fa18f477 | 29 | if (!acpi_use_timer_override && vendor == PCI_VENDOR_ID_NVIDIA) { |
b2983f10 TV |
30 | if (!warned && acpi_table_parse(ACPI_SIG_HPET, |
31 | nvidia_hpet_check)) { | |
32 | warned = 1; | |
d44647b0 | 33 | acpi_skip_timer_override = 1; |
fa18f477 AK |
34 | printk(KERN_INFO "Nvidia board " |
35 | "detected. Ignoring ACPI " | |
36 | "timer override.\n"); | |
37 | printk(KERN_INFO "If you got timer trouble " | |
38 | "try acpi_use_timer_override\n"); | |
39 | ||
d44647b0 | 40 | } |
1da177e4 | 41 | } |
f9262c12 AK |
42 | #endif |
43 | if (vendor == PCI_VENDOR_ID_ATI && timer_over_8254 == 1) { | |
44 | timer_over_8254 = 0; | |
45 | printk(KERN_INFO "ATI board detected. Disabling timer routing " | |
46 | "over 8254.\n"); | |
47 | } | |
1da177e4 LT |
48 | return 0; |
49 | } | |
4be44fcd | 50 | |
b0d0a4ba SS |
51 | static void check_intel(void) |
52 | { | |
53 | u16 vendor, device; | |
54 | ||
55 | vendor = read_pci_config_16(0, 0, 0, PCI_VENDOR_ID); | |
56 | ||
57 | if (vendor != PCI_VENDOR_ID_INTEL) | |
58 | return; | |
59 | ||
60 | device = read_pci_config_16(0, 0, 0, PCI_DEVICE_ID); | |
61 | #ifdef CONFIG_SMP | |
62 | if (device == PCI_DEVICE_ID_INTEL_E7320_MCH || | |
63 | device == PCI_DEVICE_ID_INTEL_E7520_MCH || | |
64 | device == PCI_DEVICE_ID_INTEL_E7525_MCH) | |
65 | quirk_intel_irqbalance(); | |
66 | #endif | |
67 | } | |
68 | ||
4be44fcd LB |
69 | void __init check_acpi_pci(void) |
70 | { | |
71 | int num, slot, func; | |
1da177e4 LT |
72 | |
73 | /* Assume the machine supports type 1. If not it will | |
0637a70a AK |
74 | always read ffffffff and should not have any side effect. |
75 | Actually a few buggy systems can machine check. Allow the user | |
76 | to disable it by command line option at least -AK */ | |
77 | if (!early_pci_allowed()) | |
78 | return; | |
1da177e4 | 79 | |
b0d0a4ba SS |
80 | check_intel(); |
81 | ||
1da177e4 | 82 | /* Poor man's PCI discovery */ |
4be44fcd LB |
83 | for (num = 0; num < 32; num++) { |
84 | for (slot = 0; slot < 32; slot++) { | |
85 | for (func = 0; func < 8; func++) { | |
1da177e4 LT |
86 | u32 class; |
87 | u32 vendor; | |
4be44fcd | 88 | class = read_pci_config(num, slot, func, |
1da177e4 LT |
89 | PCI_CLASS_REVISION); |
90 | if (class == 0xffffffff) | |
4be44fcd | 91 | break; |
1da177e4 LT |
92 | |
93 | if ((class >> 16) != PCI_CLASS_BRIDGE_PCI) | |
4be44fcd LB |
94 | continue; |
95 | ||
96 | vendor = read_pci_config(num, slot, func, | |
1da177e4 | 97 | PCI_VENDOR_ID); |
4be44fcd LB |
98 | |
99 | if (check_bridge(vendor & 0xffff, vendor >> 16)) | |
100 | return; | |
101 | } | |
102 | ||
1da177e4 LT |
103 | } |
104 | } | |
105 | } |