9 #if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_SMP) && defined(CONFIG_PCI)
25 pci_read_config_byte(dev, 0xf4, &config);
26 pci_write_config_byte(dev, 0xf4, config|0x2);
32 pci_bus_read_config_word(dev->
bus,
PCI_DEVFN(8, 0), 0x4c, &word);
34 if (!(word & (1 << 13))) {
35 dev_info(&dev->
dev,
"Intel E7520/7320/7525 detected; "
36 "disabling irq balancing and affinity\n");
45 pci_write_config_byte(dev, 0xf4, config);
48 quirk_intel_irqbalance);
50 quirk_intel_irqbalance);
52 quirk_intel_irqbalance);
55 #if defined(CONFIG_HPET_TIMER)
56 unsigned long force_hpet_address;
59 NONE_FORCE_HPET_RESUME,
60 OLD_ICH_FORCE_HPET_RESUME,
61 ICH_FORCE_HPET_RESUME,
62 VT8237_FORCE_HPET_RESUME,
63 NVIDIA_FORCE_HPET_RESUME,
64 ATI_FORCE_HPET_RESUME,
65 } force_hpet_resume_type;
69 static void ich_force_hpet_resume(
void)
73 if (!force_hpet_address)
79 val =
readl(rcba_base + 0x3404);
82 writel(val | 0x80, rcba_base + 0x3404);
85 val =
readl(rcba_base + 0x3404);
94 static void ich_force_enable_hpet(
struct pci_dev *dev)
103 pci_read_config_dword(dev, 0xF0, &rcba);
107 "cannot force enable HPET\n");
113 if (rcba_base ==
NULL) {
115 "cannot force enable HPET\n");
120 val =
readl(rcba_base + 0x3404);
125 force_hpet_address = 0xFED00000 | (val << 12);
127 "0x%lx\n", force_hpet_address);
133 writel(val | 0x80, rcba_base + 0x3404);
135 val =
readl(rcba_base + 0x3404);
140 force_hpet_address = 0xFED00000 | (val << 12);
144 force_hpet_address = 0;
147 "Failed to force enable HPET\n");
149 force_hpet_resume_type = ICH_FORCE_HPET_RESUME;
151 "0x%lx\n", force_hpet_address);
156 ich_force_enable_hpet);
158 ich_force_enable_hpet);
160 ich_force_enable_hpet);
162 ich_force_enable_hpet);
164 ich_force_enable_hpet);
166 ich_force_enable_hpet);
168 ich_force_enable_hpet);
170 ich_force_enable_hpet);
172 ich_force_enable_hpet);
174 ich_force_enable_hpet);
176 static struct pci_dev *cached_dev;
178 static void hpet_print_force_info(
void)
181 "You might try hpet=force boot option\n");
184 static void old_ich_force_hpet_resume(
void)
189 if (!force_hpet_address || !cached_dev)
192 pci_read_config_dword(cached_dev, 0xD0, &gen_cntl);
193 gen_cntl &= (~(0x7 << 15));
194 gen_cntl |= (0x4 << 15);
196 pci_write_config_dword(cached_dev, 0xD0, gen_cntl);
197 pci_read_config_dword(cached_dev, 0xD0, &gen_cntl);
198 val = gen_cntl >> 15;
206 static void old_ich_force_enable_hpet(
struct pci_dev *dev)
214 pci_read_config_dword(dev, 0xD0, &gen_cntl);
219 val = gen_cntl >> 15;
223 force_hpet_address = 0xFED00000 | (val << 12);
233 gen_cntl &= (~(0x7 << 15));
234 gen_cntl |= (0x4 << 15);
235 pci_write_config_dword(dev, 0xD0, gen_cntl);
237 pci_read_config_dword(dev, 0xD0, &gen_cntl);
239 val = gen_cntl >> 15;
244 force_hpet_address = 0xFED00000 | (val << 12);
246 "0x%lx\n", force_hpet_address);
248 force_hpet_resume_type = OLD_ICH_FORCE_HPET_RESUME;
252 dev_printk(
KERN_DEBUG, &dev->
dev,
"Failed to force enable HPET\n");
259 static void old_ich_force_enable_hpet_user(
struct pci_dev *dev)
262 old_ich_force_enable_hpet(dev);
266 old_ich_force_enable_hpet_user);
268 old_ich_force_enable_hpet_user);
270 old_ich_force_enable_hpet_user);
272 old_ich_force_enable_hpet_user);
274 old_ich_force_enable_hpet_user);
276 old_ich_force_enable_hpet);
278 old_ich_force_enable_hpet);
281 static void vt8237_force_hpet_resume(
void)
285 if (!force_hpet_address || !cached_dev)
288 val = 0xfed00000 | 0x80;
289 pci_write_config_dword(cached_dev, 0x68, val);
291 pci_read_config_dword(cached_dev, 0x68, &val);
298 static void vt8237_force_enable_hpet(
struct pci_dev *dev)
306 hpet_print_force_info();
310 pci_read_config_dword(dev, 0x68, &val);
316 force_hpet_address = (val & ~0x3ff);
326 val = 0xfed00000 | 0x80;
327 pci_write_config_dword(dev, 0x68, val);
329 pci_read_config_dword(dev, 0x68, &val);
331 force_hpet_address = (val & ~0x3ff);
333 "0x%lx\n", force_hpet_address);
335 force_hpet_resume_type = VT8237_FORCE_HPET_RESUME;
339 dev_printk(
KERN_DEBUG, &dev->
dev,
"Failed to force enable HPET\n");
343 vt8237_force_enable_hpet);
345 vt8237_force_enable_hpet);
347 vt8237_force_enable_hpet);
349 static void ati_force_hpet_resume(
void)
351 pci_write_config_dword(cached_dev, 0x14, 0xfed00000);
355 static u32 ati_ixp4x0_rev(
struct pci_dev *dev)
360 pci_read_config_byte(dev, 0xac, &b);
362 pci_write_config_byte(dev, 0xac, b);
363 pci_read_config_dword(dev, 0x70, &d);
365 pci_write_config_dword(dev, 0x70, d);
366 pci_read_config_dword(dev, 0x8, &d);
368 dev_printk(
KERN_DEBUG, &dev->
dev,
"SB4X0 revision 0x%x\n", d);
372 static void ati_force_enable_hpet(
struct pci_dev *dev)
381 hpet_print_force_info();
385 d = ati_ixp4x0_rev(dev);
390 pci_write_config_dword(dev, 0x14, 0xfed00000);
391 pci_read_config_dword(dev, 0x14, &val);
394 outb(0x72, 0xcd6); b =
inb(0xcd7);
397 outb(0x72, 0xcd6); b =
inb(0xcd7);
400 pci_read_config_dword(dev, 0x64, &d);
402 pci_write_config_dword(dev, 0x64, d);
403 pci_read_config_dword(dev, 0x64, &d);
407 force_hpet_address =
val;
408 force_hpet_resume_type = ATI_FORCE_HPET_RESUME;
409 dev_printk(
KERN_DEBUG, &dev->
dev,
"Force enabled HPET at 0x%lx\n",
414 ati_force_enable_hpet);
419 static void nvidia_force_hpet_resume(
void)
421 pci_write_config_dword(cached_dev, 0x44, 0xfed00001);
425 static void nvidia_force_enable_hpet(
struct pci_dev *dev)
433 hpet_print_force_info();
437 pci_write_config_dword(dev, 0x44, 0xfed00001);
438 pci_read_config_dword(dev, 0x44, &val);
439 force_hpet_address = val & 0xfffffffe;
440 force_hpet_resume_type = NVIDIA_FORCE_HPET_RESUME;
441 dev_printk(
KERN_DEBUG, &dev->
dev,
"Force enabled HPET at 0x%lx\n",
449 nvidia_force_enable_hpet);
451 nvidia_force_enable_hpet);
455 nvidia_force_enable_hpet);
457 nvidia_force_enable_hpet);
459 nvidia_force_enable_hpet);
461 nvidia_force_enable_hpet);
463 nvidia_force_enable_hpet);
465 nvidia_force_enable_hpet);
467 nvidia_force_enable_hpet);
469 nvidia_force_enable_hpet);
471 nvidia_force_enable_hpet);
473 void force_hpet_resume(
void)
475 switch (force_hpet_resume_type) {
476 case ICH_FORCE_HPET_RESUME:
477 ich_force_hpet_resume();
479 case OLD_ICH_FORCE_HPET_RESUME:
480 old_ich_force_hpet_resume();
482 case VT8237_FORCE_HPET_RESUME:
483 vt8237_force_hpet_resume();
485 case NVIDIA_FORCE_HPET_RESUME:
486 nvidia_force_hpet_resume();
488 case ATI_FORCE_HPET_RESUME:
489 ati_force_hpet_resume();
509 force_disable_hpet_msi);
513 #if defined(CONFIG_PCI) && defined(CONFIG_NUMA)
527 pci_read_config_dword(nb_ht, 0x60, &val);
534 set_dev_node(&dev->
dev, node);