aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2007-10-19 14:35:03 -0400
committerThomas Gleixner <tglx@linutronix.de>2007-10-19 14:35:03 -0400
commit54ef34009a69f95c25685247e73673dfeb435c71 (patch)
tree2a8e01d4bcfd24f467a1a30218005ccfe9c06a70 /arch/x86
parent158ad3260ba3b006e3c6dfad05298e9d7889c5b1 (diff)
x86: Unify i386 and x86-64 early quirks
They were already very similar; just use the same file now. [ tglx: arch/x86 adaptation ] Cc: lenb@kernel.org Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kernel/Makefile_321
-rw-r--r--arch/x86/kernel/Makefile_642
-rw-r--r--arch/x86/kernel/acpi/Makefile_323
-rw-r--r--arch/x86/kernel/acpi/earlyquirk_32.c84
-rw-r--r--arch/x86/kernel/early-quirks.c (renamed from arch/x86/kernel/early-quirks_64.c)19
-rw-r--r--arch/x86/kernel/setup_32.c4
6 files changed, 17 insertions, 96 deletions
diff --git a/arch/x86/kernel/Makefile_32 b/arch/x86/kernel/Makefile_32
index 69990f0ba86e..ccea590bbb92 100644
--- a/arch/x86/kernel/Makefile_32
+++ b/arch/x86/kernel/Makefile_32
@@ -17,6 +17,7 @@ obj-$(CONFIG_MCA) += mca_32.o
17obj-$(CONFIG_X86_MSR) += msr.o 17obj-$(CONFIG_X86_MSR) += msr.o
18obj-$(CONFIG_X86_CPUID) += cpuid.o 18obj-$(CONFIG_X86_CPUID) += cpuid.o
19obj-$(CONFIG_MICROCODE) += microcode.o 19obj-$(CONFIG_MICROCODE) += microcode.o
20obj-$(CONFIG_PCI) += early-quirks.o
20obj-$(CONFIG_APM) += apm_32.o 21obj-$(CONFIG_APM) += apm_32.o
21obj-$(CONFIG_X86_SMP) += smp_32.o smpboot_32.o tsc_sync.o 22obj-$(CONFIG_X86_SMP) += smp_32.o smpboot_32.o tsc_sync.o
22obj-$(CONFIG_SMP) += smpcommon_32.o 23obj-$(CONFIG_SMP) += smpcommon_32.o
diff --git a/arch/x86/kernel/Makefile_64 b/arch/x86/kernel/Makefile_64
index 2fc3d3f2c27e..dec06e769281 100644
--- a/arch/x86/kernel/Makefile_64
+++ b/arch/x86/kernel/Makefile_64
@@ -39,7 +39,7 @@ obj-$(CONFIG_K8_NB) += k8.o
39obj-$(CONFIG_AUDIT) += audit_64.o 39obj-$(CONFIG_AUDIT) += audit_64.o
40 40
41obj-$(CONFIG_MODULES) += module_64.o 41obj-$(CONFIG_MODULES) += module_64.o
42obj-$(CONFIG_PCI) += early-quirks_64.o 42obj-$(CONFIG_PCI) += early-quirks.o
43 43
44obj-y += topology.o 44obj-y += topology.o
45obj-y += intel_cacheinfo.o 45obj-y += intel_cacheinfo.o
diff --git a/arch/x86/kernel/acpi/Makefile_32 b/arch/x86/kernel/acpi/Makefile_32
index a4852a2e9190..045dd54b33e0 100644
--- a/arch/x86/kernel/acpi/Makefile_32
+++ b/arch/x86/kernel/acpi/Makefile_32
@@ -1,7 +1,4 @@
1obj-$(CONFIG_ACPI) += boot.o 1obj-$(CONFIG_ACPI) += boot.o
2ifneq ($(CONFIG_PCI),)
3obj-$(CONFIG_X86_IO_APIC) += earlyquirk_32.o
4endif
5obj-$(CONFIG_ACPI_SLEEP) += sleep_32.o wakeup_32.o 2obj-$(CONFIG_ACPI_SLEEP) += sleep_32.o wakeup_32.o
6 3
7ifneq ($(CONFIG_ACPI_PROCESSOR),) 4ifneq ($(CONFIG_ACPI_PROCESSOR),)
diff --git a/arch/x86/kernel/acpi/earlyquirk_32.c b/arch/x86/kernel/acpi/earlyquirk_32.c
deleted file mode 100644
index 23f78efc577d..000000000000
--- a/arch/x86/kernel/acpi/earlyquirk_32.c
+++ /dev/null
@@ -1,84 +0,0 @@
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 <linux/acpi.h>
9
10#include <asm/pci-direct.h>
11#include <asm/acpi.h>
12#include <asm/apic.h>
13
14#ifdef CONFIG_ACPI
15
16static int __init nvidia_hpet_check(struct acpi_table_header *header)
17{
18 return 0;
19}
20#endif
21
22static int __init check_bridge(int vendor, int device)
23{
24#ifdef CONFIG_ACPI
25 static int warned;
26 /* According to Nvidia all timer overrides are bogus unless HPET
27 is enabled. */
28 if (!acpi_use_timer_override && vendor == PCI_VENDOR_ID_NVIDIA) {
29 if (!warned && acpi_table_parse(ACPI_SIG_HPET,
30 nvidia_hpet_check)) {
31 warned = 1;
32 acpi_skip_timer_override = 1;
33 printk(KERN_INFO "Nvidia board "
34 "detected. Ignoring ACPI "
35 "timer override.\n");
36 printk(KERN_INFO "If you got timer trouble "
37 "try acpi_use_timer_override\n");
38
39 }
40 }
41#endif
42 if (vendor == PCI_VENDOR_ID_ATI && timer_over_8254 == 1) {
43 timer_over_8254 = 0;
44 printk(KERN_INFO "ATI board detected. Disabling timer routing "
45 "over 8254.\n");
46 }
47 return 0;
48}
49
50void __init check_acpi_pci(void)
51{
52 int num, slot, func;
53
54 /* Assume the machine supports type 1. If not it will
55 always read ffffffff and should not have any side effect.
56 Actually a few buggy systems can machine check. Allow the user
57 to disable it by command line option at least -AK */
58 if (!early_pci_allowed())
59 return;
60
61 /* Poor man's PCI discovery */
62 for (num = 0; num < 32; num++) {
63 for (slot = 0; slot < 32; slot++) {
64 for (func = 0; func < 8; func++) {
65 u32 class;
66 u32 vendor;
67 class = read_pci_config(num, slot, func,
68 PCI_CLASS_REVISION);
69 if (class == 0xffffffff)
70 break;
71
72 if ((class >> 16) != PCI_CLASS_BRIDGE_PCI)
73 continue;
74
75 vendor = read_pci_config(num, slot, func,
76 PCI_VENDOR_ID);
77
78 if (check_bridge(vendor & 0xffff, vendor >> 16))
79 return;
80 }
81
82 }
83 }
84}
diff --git a/arch/x86/kernel/early-quirks_64.c b/arch/x86/kernel/early-quirks.c
index 13aa4fd728f3..dc34acbd54aa 100644
--- a/arch/x86/kernel/early-quirks_64.c
+++ b/arch/x86/kernel/early-quirks.c
@@ -13,9 +13,13 @@
13#include <linux/acpi.h> 13#include <linux/acpi.h>
14#include <linux/pci_ids.h> 14#include <linux/pci_ids.h>
15#include <asm/pci-direct.h> 15#include <asm/pci-direct.h>
16#include <asm/proto.h>
17#include <asm/iommu.h>
18#include <asm/dma.h> 16#include <asm/dma.h>
17#include <asm/io_apic.h>
18#include <asm/apic.h>
19
20#ifdef CONFIG_IOMMU
21#include <asm/iommu.h>
22#endif
19 23
20static void __init via_bugs(void) 24static void __init via_bugs(void)
21{ 25{
@@ -23,7 +27,8 @@ static void __init via_bugs(void)
23 if ((end_pfn > MAX_DMA32_PFN || force_iommu) && 27 if ((end_pfn > MAX_DMA32_PFN || force_iommu) &&
24 !iommu_aperture_allowed) { 28 !iommu_aperture_allowed) {
25 printk(KERN_INFO 29 printk(KERN_INFO
26 "Looks like a VIA chipset. Disabling IOMMU. Override with iommu=allowed\n"); 30 "Looks like a VIA chipset. Disabling IOMMU."
31 " Override with iommu=allowed\n");
27 iommu_aperture_disabled = 1; 32 iommu_aperture_disabled = 1;
28 } 33 }
29#endif 34#endif
@@ -40,6 +45,7 @@ static int __init nvidia_hpet_check(struct acpi_table_header *header)
40static void __init nvidia_bugs(void) 45static void __init nvidia_bugs(void)
41{ 46{
42#ifdef CONFIG_ACPI 47#ifdef CONFIG_ACPI
48#ifdef CONFIG_X86_IO_APIC
43 /* 49 /*
44 * All timer overrides on Nvidia are 50 * All timer overrides on Nvidia are
45 * wrong unless HPET is enabled. 51 * wrong unless HPET is enabled.
@@ -59,17 +65,20 @@ static void __init nvidia_bugs(void)
59 "try acpi_use_timer_override\n"); 65 "try acpi_use_timer_override\n");
60 } 66 }
61#endif 67#endif
68#endif
62 /* RED-PEN skip them on mptables too? */ 69 /* RED-PEN skip them on mptables too? */
63 70
64} 71}
65 72
66static void __init ati_bugs(void) 73static void __init ati_bugs(void)
67{ 74{
75#ifdef CONFIG_X86_IO_APIC
68 if (timer_over_8254 == 1) { 76 if (timer_over_8254 == 1) {
69 timer_over_8254 = 0; 77 timer_over_8254 = 0;
70 printk(KERN_INFO 78 printk(KERN_INFO
71 "ATI board detected. Disabling timer routing over 8254.\n"); 79 "ATI board detected. Disabling timer routing over 8254.\n");
72 } 80 }
81#endif
73} 82}
74 83
75struct chipset { 84struct chipset {
@@ -104,7 +113,7 @@ void __init early_quirks(void)
104 if (class == 0xffffffff) 113 if (class == 0xffffffff)
105 break; 114 break;
106 115
107 if ((class >> 16) != PCI_CLASS_BRIDGE_PCI) 116 if ((class >> 16) != PCI_CLASS_BRIDGE_PCI)
108 continue; 117 continue;
109 118
110 vendor = read_pci_config(num, slot, func, 119 vendor = read_pci_config(num, slot, func,
diff --git a/arch/x86/kernel/setup_32.c b/arch/x86/kernel/setup_32.c
index b87a6fd5ba48..d357d60431f0 100644
--- a/arch/x86/kernel/setup_32.c
+++ b/arch/x86/kernel/setup_32.c
@@ -622,9 +622,7 @@ void __init setup_arch(char **cmdline_p)
622#endif 622#endif
623 623
624#ifdef CONFIG_PCI 624#ifdef CONFIG_PCI
625#ifdef CONFIG_X86_IO_APIC 625 early_quirks();
626 check_acpi_pci(); /* Checks more than just ACPI actually */
627#endif
628#endif 626#endif
629 627
630#ifdef CONFIG_ACPI 628#ifdef CONFIG_ACPI