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> | |
8 | #include <asm/pci-direct.h> | |
9 | #include <asm/acpi.h> | |
f9262c12 | 10 | #include <asm/apic.h> |
1da177e4 | 11 | |
4be44fcd | 12 | static int __init check_bridge(int vendor, int device) |
1da177e4 | 13 | { |
f9262c12 | 14 | #ifdef CONFIG_ACPI |
1da177e4 LT |
15 | /* According to Nvidia all timer overrides are bogus. Just ignore |
16 | them all. */ | |
4be44fcd LB |
17 | if (vendor == PCI_VENDOR_ID_NVIDIA) { |
18 | acpi_skip_timer_override = 1; | |
1da177e4 | 19 | } |
f9262c12 AK |
20 | #endif |
21 | if (vendor == PCI_VENDOR_ID_ATI && timer_over_8254 == 1) { | |
22 | timer_over_8254 = 0; | |
23 | printk(KERN_INFO "ATI board detected. Disabling timer routing " | |
24 | "over 8254.\n"); | |
25 | } | |
1da177e4 LT |
26 | return 0; |
27 | } | |
4be44fcd LB |
28 | |
29 | void __init check_acpi_pci(void) | |
30 | { | |
31 | int num, slot, func; | |
1da177e4 LT |
32 | |
33 | /* Assume the machine supports type 1. If not it will | |
34 | always read ffffffff and should not have any side effect. */ | |
35 | ||
36 | /* Poor man's PCI discovery */ | |
4be44fcd LB |
37 | for (num = 0; num < 32; num++) { |
38 | for (slot = 0; slot < 32; slot++) { | |
39 | for (func = 0; func < 8; func++) { | |
1da177e4 LT |
40 | u32 class; |
41 | u32 vendor; | |
4be44fcd | 42 | class = read_pci_config(num, slot, func, |
1da177e4 LT |
43 | PCI_CLASS_REVISION); |
44 | if (class == 0xffffffff) | |
4be44fcd | 45 | break; |
1da177e4 LT |
46 | |
47 | if ((class >> 16) != PCI_CLASS_BRIDGE_PCI) | |
4be44fcd LB |
48 | continue; |
49 | ||
50 | vendor = read_pci_config(num, slot, func, | |
1da177e4 | 51 | PCI_VENDOR_ID); |
4be44fcd LB |
52 | |
53 | if (check_bridge(vendor & 0xffff, vendor >> 16)) | |
54 | return; | |
55 | } | |
56 | ||
1da177e4 LT |
57 | } |
58 | } | |
59 | } |