aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/quirks.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-12-06 13:10:10 -0500
committerJesse Barnes <jbarnes@virtuousgeek.org>2009-01-07 14:12:39 -0500
commit894886e5d3de0bde2eded8a39bf7e76023fbd791 (patch)
treebaacfdcfc5669bb4398e325455b9875d1e18c864 /drivers/pci/quirks.c
parent90d25f246ddefbb743764f8d45ae97e545a6ee86 (diff)
PCI: extend on the ICH motherboard IO decode quirk list
This adds more LPC controller IO range decode quirks for the Intel ICH family of chipsets. They differ a bit between the older ICH6 chipset and the more modern layout of the ICH7-ICH10 chipsets. This patch just prints out the IO decode information found by the quirks, but eventually we may want to add them to the resource tree, in order to know to avoid allocating things over them. That's especially true if it turns out that any firmware ends up putting the magic motherboard resources in an address range that we use for dynamic allocations (ie above PCIBIOS_MIN_IO, which is 0x1000 on x86). Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: Rafael J. Wysocki <rjw@sisk.pl> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Cc: Greg KH <greg@kroah.com> Cc: Frans Pop <elendil@planet.nl> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/quirks.c')
-rw-r--r--drivers/pci/quirks.c105
1 files changed, 90 insertions, 15 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index e915a17b36c3..d3a9e0f38682 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -449,7 +449,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_12,
449DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_0, quirk_ich4_lpc_acpi); 449DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_0, quirk_ich4_lpc_acpi);
450DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB_1, quirk_ich4_lpc_acpi); 450DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB_1, quirk_ich4_lpc_acpi);
451 451
452static void __devinit quirk_ich6_lpc_acpi(struct pci_dev *dev) 452static void __devinit ich6_lpc_acpi_gpio(struct pci_dev *dev)
453{ 453{
454 u32 region; 454 u32 region;
455 455
@@ -459,20 +459,95 @@ static void __devinit quirk_ich6_lpc_acpi(struct pci_dev *dev)
459 pci_read_config_dword(dev, 0x48, &region); 459 pci_read_config_dword(dev, 0x48, &region);
460 quirk_io_region(dev, region, 64, PCI_BRIDGE_RESOURCES+1, "ICH6 GPIO"); 460 quirk_io_region(dev, region, 64, PCI_BRIDGE_RESOURCES+1, "ICH6 GPIO");
461} 461}
462DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_0, quirk_ich6_lpc_acpi); 462
463DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_1, quirk_ich6_lpc_acpi); 463static void __devinit ich6_lpc_generic_decode(struct pci_dev *dev, unsigned reg, const char *name, int dynsize)
464DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_0, quirk_ich6_lpc_acpi); 464{
465DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_1, quirk_ich6_lpc_acpi); 465 u32 val;
466DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_31, quirk_ich6_lpc_acpi); 466 u32 size, base;
467DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_0, quirk_ich6_lpc_acpi); 467
468DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_2, quirk_ich6_lpc_acpi); 468 pci_read_config_dword(dev, reg, &val);
469DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_3, quirk_ich6_lpc_acpi); 469
470DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_1, quirk_ich6_lpc_acpi); 470 /* Enabled? */
471DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_4, quirk_ich6_lpc_acpi); 471 if (!(val & 1))
472DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_2, quirk_ich6_lpc_acpi); 472 return;
473DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_4, quirk_ich6_lpc_acpi); 473 base = val & 0xfffc;
474DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_7, quirk_ich6_lpc_acpi); 474 if (dynsize) {
475DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_8, quirk_ich6_lpc_acpi); 475 /*
476 * This is not correct. It is 16, 32 or 64 bytes depending on
477 * register D31:F0:ADh bits 5:4.
478 *
479 * But this gets us at least _part_ of it.
480 */
481 size = 16;
482 } else {
483 size = 128;
484 }
485 base &= ~(size-1);
486
487 /* Just print it out for now. We should reserve it after more debugging */
488 dev_info(&dev->dev, "%s PIO at %04x-%04x\n", name, base, base+size-1);
489}
490
491static void __devinit quirk_ich6_lpc(struct pci_dev *dev)
492{
493 /* Shared ACPI/GPIO decode with all ICH6+ */
494 ich6_lpc_acpi_gpio(dev);
495
496 /* ICH6-specific generic IO decode */
497 ich6_lpc_generic_decode(dev, 0x84, "LPC Generic IO decode 1", 0);
498 ich6_lpc_generic_decode(dev, 0x88, "LPC Generic IO decode 2", 1);
499}
500DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_0, quirk_ich6_lpc);
501DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_1, quirk_ich6_lpc);
502
503static void __devinit ich7_lpc_generic_decode(struct pci_dev *dev, unsigned reg, const char *name)
504{
505 u32 val;
506 u32 mask, base;
507
508 pci_read_config_dword(dev, reg, &val);
509
510 /* Enabled? */
511 if (!(val & 1))
512 return;
513
514 /*
515 * IO base in bits 15:2, mask in bits 23:18, both
516 * are dword-based
517 */
518 base = val & 0xfffc;
519 mask = (val >> 16) & 0xfc;
520 mask |= 3;
521
522 /* Just print it out for now. We should reserve it after more debugging */
523 dev_info(&dev->dev, "%s PIO at %04x (mask %04x)\n", name, base, mask);
524}
525
526/* ICH7-10 has the same common LPC generic IO decode registers */
527static void __devinit quirk_ich7_lpc(struct pci_dev *dev)
528{
529 /* We share the common ACPI/DPIO decode with ICH6 */
530 ich6_lpc_acpi_gpio(dev);
531
532 /* And have 4 ICH7+ generic decodes */
533 ich7_lpc_generic_decode(dev, 0x84, "ICH7 LPC Generic IO decode 1");
534 ich7_lpc_generic_decode(dev, 0x88, "ICH7 LPC Generic IO decode 2");
535 ich7_lpc_generic_decode(dev, 0x8c, "ICH7 LPC Generic IO decode 3");
536 ich7_lpc_generic_decode(dev, 0x90, "ICH7 LPC Generic IO decode 4");
537}
538DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_0, quirk_ich7_lpc);
539DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_1, quirk_ich7_lpc);
540DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_31, quirk_ich7_lpc);
541DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_0, quirk_ich7_lpc);
542DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_2, quirk_ich7_lpc);
543DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_3, quirk_ich7_lpc);
544DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_1, quirk_ich7_lpc);
545DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_4, quirk_ich7_lpc);
546DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_2, quirk_ich7_lpc);
547DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_4, quirk_ich7_lpc);
548DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_7, quirk_ich7_lpc);
549DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_8, quirk_ich7_lpc);
550DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH10_1, quirk_ich7_lpc);
476 551
477/* 552/*
478 * VIA ACPI: One IO region pointed to by longword at 553 * VIA ACPI: One IO region pointed to by longword at