aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel/acpi/earlyquirk.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /arch/i386/kernel/acpi/earlyquirk.c
Linux-2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'arch/i386/kernel/acpi/earlyquirk.c')
-rw-r--r--arch/i386/kernel/acpi/earlyquirk.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/arch/i386/kernel/acpi/earlyquirk.c b/arch/i386/kernel/acpi/earlyquirk.c
new file mode 100644
index 00000000000..726a5ca4b16
--- /dev/null
+++ b/arch/i386/kernel/acpi/earlyquirk.c
@@ -0,0 +1,51 @@
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>
8#include <asm/pci-direct.h>
9#include <asm/acpi.h>
10
11static int __init check_bridge(int vendor, int device)
12{
13 /* According to Nvidia all timer overrides are bogus. Just ignore
14 them all. */
15 if (vendor == PCI_VENDOR_ID_NVIDIA) {
16 acpi_skip_timer_override = 1;
17 }
18 return 0;
19}
20
21void __init check_acpi_pci(void)
22{
23 int num,slot,func;
24
25 /* Assume the machine supports type 1. If not it will
26 always read ffffffff and should not have any side effect. */
27
28 /* Poor man's PCI discovery */
29 for (num = 0; num < 32; num++) {
30 for (slot = 0; slot < 32; slot++) {
31 for (func = 0; func < 8; func++) {
32 u32 class;
33 u32 vendor;
34 class = read_pci_config(num,slot,func,
35 PCI_CLASS_REVISION);
36 if (class == 0xffffffff)
37 break;
38
39 if ((class >> 16) != PCI_CLASS_BRIDGE_PCI)
40 continue;
41
42 vendor = read_pci_config(num, slot, func,
43 PCI_VENDOR_ID);
44
45 if (check_bridge(vendor&0xffff, vendor >> 16))
46 return;
47 }
48
49 }
50 }
51}