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>
16 static int nvidia_hpet_detected __initdata
;
18 static int __init
nvidia_hpet_check(unsigned long phys
, unsigned long size
)
20 nvidia_hpet_detected
= 1;
25 static int __init
check_bridge(int vendor
, int device
)
28 /* According to Nvidia all timer overrides are bogus unless HPET
30 if (vendor
== PCI_VENDOR_ID_NVIDIA
) {
31 nvidia_hpet_detected
= 0;
32 acpi_table_parse(ACPI_HPET
, nvidia_hpet_check
);
33 if (nvidia_hpet_detected
== 0) {
34 acpi_skip_timer_override
= 1;
38 if (vendor
== PCI_VENDOR_ID_ATI
&& timer_over_8254
== 1) {
40 printk(KERN_INFO
"ATI board detected. Disabling timer routing "
46 void __init
check_acpi_pci(void)
50 /* Assume the machine supports type 1. If not it will
51 always read ffffffff and should not have any side effect.
52 Actually a few buggy systems can machine check. Allow the user
53 to disable it by command line option at least -AK */
54 if (!early_pci_allowed())
57 /* Poor man's PCI discovery */
58 for (num
= 0; num
< 32; num
++) {
59 for (slot
= 0; slot
< 32; slot
++) {
60 for (func
= 0; func
< 8; func
++) {
63 class = read_pci_config(num
, slot
, func
,
65 if (class == 0xffffffff)
68 if ((class >> 16) != PCI_CLASS_BRIDGE_PCI
)
71 vendor
= read_pci_config(num
, slot
, func
,
74 if (check_bridge(vendor
& 0xffff, vendor
>> 16))