2 * Do early PCI probing for bug detection when the main PCI subsystem is
5 #include <linux/init.h>
6 #include <linux/kernel.h>
8 #include <linux/acpi.h>
10 #include <asm/pci-direct.h>
17 static int nvidia_hpet_detected __initdata
;
19 static int __init
nvidia_hpet_check(unsigned long phys
, unsigned long size
)
21 nvidia_hpet_detected
= 1;
26 static int __init
check_bridge(int vendor
, int device
)
29 /* According to Nvidia all timer overrides are bogus unless HPET
31 if (!acpi_use_timer_override
&& vendor
== PCI_VENDOR_ID_NVIDIA
) {
32 nvidia_hpet_detected
= 0;
33 acpi_table_parse(ACPI_HPET
, nvidia_hpet_check
);
34 if (nvidia_hpet_detected
== 0) {
35 acpi_skip_timer_override
= 1;
36 printk(KERN_INFO
"Nvidia board "
37 "detected. Ignoring ACPI "
39 printk(KERN_INFO
"If you got timer trouble "
40 "try acpi_use_timer_override\n");
45 if (vendor
== PCI_VENDOR_ID_ATI
&& timer_over_8254
== 1) {
47 printk(KERN_INFO
"ATI board detected. Disabling timer routing "
53 static void check_intel(void)
57 vendor
= read_pci_config_16(0, 0, 0, PCI_VENDOR_ID
);
59 if (vendor
!= PCI_VENDOR_ID_INTEL
)
62 device
= read_pci_config_16(0, 0, 0, PCI_DEVICE_ID
);
64 if (device
== PCI_DEVICE_ID_INTEL_E7320_MCH
||
65 device
== PCI_DEVICE_ID_INTEL_E7520_MCH
||
66 device
== PCI_DEVICE_ID_INTEL_E7525_MCH
)
67 quirk_intel_irqbalance();
71 void __init
check_acpi_pci(void)
75 /* Assume the machine supports type 1. If not it will
76 always read ffffffff and should not have any side effect.
77 Actually a few buggy systems can machine check. Allow the user
78 to disable it by command line option at least -AK */
79 if (!early_pci_allowed())
84 /* Poor man's PCI discovery */
85 for (num
= 0; num
< 32; num
++) {
86 for (slot
= 0; slot
< 32; slot
++) {
87 for (func
= 0; func
< 8; func
++) {
90 class = read_pci_config(num
, slot
, func
,
92 if (class == 0xffffffff)
95 if ((class >> 16) != PCI_CLASS_BRIDGE_PCI
)
98 vendor
= read_pci_config(num
, slot
, func
,
101 if (check_bridge(vendor
& 0xffff, vendor
>> 16))