diff options
Diffstat (limited to 'arch/x86/kernel/early-quirks.c')
-rw-r--r-- | arch/x86/kernel/early-quirks.c | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c index 9f51e1ea9e82..a0e11c0cc872 100644 --- a/arch/x86/kernel/early-quirks.c +++ b/arch/x86/kernel/early-quirks.c | |||
@@ -50,7 +50,7 @@ static void __init fix_hypertransport_config(int num, int slot, int func) | |||
50 | static void __init via_bugs(int num, int slot, int func) | 50 | static void __init via_bugs(int num, int slot, int func) |
51 | { | 51 | { |
52 | #ifdef CONFIG_GART_IOMMU | 52 | #ifdef CONFIG_GART_IOMMU |
53 | if ((end_pfn > MAX_DMA32_PFN || force_iommu) && | 53 | if ((max_pfn > MAX_DMA32_PFN || force_iommu) && |
54 | !gart_iommu_aperture_allowed) { | 54 | !gart_iommu_aperture_allowed) { |
55 | printk(KERN_INFO | 55 | printk(KERN_INFO |
56 | "Looks like a VIA chipset. Disabling IOMMU." | 56 | "Looks like a VIA chipset. Disabling IOMMU." |
@@ -98,17 +98,6 @@ static void __init nvidia_bugs(int num, int slot, int func) | |||
98 | 98 | ||
99 | } | 99 | } |
100 | 100 | ||
101 | static void __init ati_bugs(int num, int slot, int func) | ||
102 | { | ||
103 | #ifdef CONFIG_X86_IO_APIC | ||
104 | if (timer_over_8254 == 1) { | ||
105 | timer_over_8254 = 0; | ||
106 | printk(KERN_INFO | ||
107 | "ATI board detected. Disabling timer routing over 8254.\n"); | ||
108 | } | ||
109 | #endif | ||
110 | } | ||
111 | |||
112 | #define QFLAG_APPLY_ONCE 0x1 | 101 | #define QFLAG_APPLY_ONCE 0x1 |
113 | #define QFLAG_APPLIED 0x2 | 102 | #define QFLAG_APPLIED 0x2 |
114 | #define QFLAG_DONE (QFLAG_APPLY_ONCE|QFLAG_APPLIED) | 103 | #define QFLAG_DONE (QFLAG_APPLY_ONCE|QFLAG_APPLIED) |
@@ -126,14 +115,23 @@ static struct chipset early_qrk[] __initdata = { | |||
126 | PCI_CLASS_BRIDGE_PCI, PCI_ANY_ID, QFLAG_APPLY_ONCE, nvidia_bugs }, | 115 | PCI_CLASS_BRIDGE_PCI, PCI_ANY_ID, QFLAG_APPLY_ONCE, nvidia_bugs }, |
127 | { PCI_VENDOR_ID_VIA, PCI_ANY_ID, | 116 | { PCI_VENDOR_ID_VIA, PCI_ANY_ID, |
128 | PCI_CLASS_BRIDGE_PCI, PCI_ANY_ID, QFLAG_APPLY_ONCE, via_bugs }, | 117 | PCI_CLASS_BRIDGE_PCI, PCI_ANY_ID, QFLAG_APPLY_ONCE, via_bugs }, |
129 | { PCI_VENDOR_ID_ATI, PCI_ANY_ID, | ||
130 | PCI_CLASS_BRIDGE_PCI, PCI_ANY_ID, QFLAG_APPLY_ONCE, ati_bugs }, | ||
131 | { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_K8_NB, | 118 | { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_K8_NB, |
132 | PCI_CLASS_BRIDGE_HOST, PCI_ANY_ID, 0, fix_hypertransport_config }, | 119 | PCI_CLASS_BRIDGE_HOST, PCI_ANY_ID, 0, fix_hypertransport_config }, |
133 | {} | 120 | {} |
134 | }; | 121 | }; |
135 | 122 | ||
136 | static void __init check_dev_quirk(int num, int slot, int func) | 123 | /** |
124 | * check_dev_quirk - apply early quirks to a given PCI device | ||
125 | * @num: bus number | ||
126 | * @slot: slot number | ||
127 | * @func: PCI function | ||
128 | * | ||
129 | * Check the vendor & device ID against the early quirks table. | ||
130 | * | ||
131 | * If the device is single function, let early_quirks() know so we don't | ||
132 | * poke at this device again. | ||
133 | */ | ||
134 | static int __init check_dev_quirk(int num, int slot, int func) | ||
137 | { | 135 | { |
138 | u16 class; | 136 | u16 class; |
139 | u16 vendor; | 137 | u16 vendor; |
@@ -144,7 +142,7 @@ static void __init check_dev_quirk(int num, int slot, int func) | |||
144 | class = read_pci_config_16(num, slot, func, PCI_CLASS_DEVICE); | 142 | class = read_pci_config_16(num, slot, func, PCI_CLASS_DEVICE); |
145 | 143 | ||
146 | if (class == 0xffff) | 144 | if (class == 0xffff) |
147 | return; | 145 | return -1; /* no class, treat as single function */ |
148 | 146 | ||
149 | vendor = read_pci_config_16(num, slot, func, PCI_VENDOR_ID); | 147 | vendor = read_pci_config_16(num, slot, func, PCI_VENDOR_ID); |
150 | 148 | ||
@@ -167,7 +165,9 @@ static void __init check_dev_quirk(int num, int slot, int func) | |||
167 | type = read_pci_config_byte(num, slot, func, | 165 | type = read_pci_config_byte(num, slot, func, |
168 | PCI_HEADER_TYPE); | 166 | PCI_HEADER_TYPE); |
169 | if (!(type & 0x80)) | 167 | if (!(type & 0x80)) |
170 | return; | 168 | return -1; |
169 | |||
170 | return 0; | ||
171 | } | 171 | } |
172 | 172 | ||
173 | void __init early_quirks(void) | 173 | void __init early_quirks(void) |
@@ -180,6 +180,9 @@ void __init early_quirks(void) | |||
180 | /* Poor man's PCI discovery */ | 180 | /* Poor man's PCI discovery */ |
181 | for (num = 0; num < 32; num++) | 181 | for (num = 0; num < 32; num++) |
182 | for (slot = 0; slot < 32; slot++) | 182 | for (slot = 0; slot < 32; slot++) |
183 | for (func = 0; func < 8; func++) | 183 | for (func = 0; func < 8; func++) { |
184 | check_dev_quirk(num, slot, func); | 184 | /* Only probe function 0 on single fn devices */ |
185 | if (check_dev_quirk(num, slot, func)) | ||
186 | break; | ||
187 | } | ||
185 | } | 188 | } |