diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/pci/quirks.c | 105 |
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, | |||
449 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_0, quirk_ich4_lpc_acpi); | 449 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_0, quirk_ich4_lpc_acpi); |
450 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB_1, quirk_ich4_lpc_acpi); | 450 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB_1, quirk_ich4_lpc_acpi); |
451 | 451 | ||
452 | static void __devinit quirk_ich6_lpc_acpi(struct pci_dev *dev) | 452 | static 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, ®ion); | 459 | pci_read_config_dword(dev, 0x48, ®ion); |
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 | } |
462 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_0, quirk_ich6_lpc_acpi); | 462 | |
463 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_1, quirk_ich6_lpc_acpi); | 463 | static void __devinit ich6_lpc_generic_decode(struct pci_dev *dev, unsigned reg, const char *name, int dynsize) |
464 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_0, quirk_ich6_lpc_acpi); | 464 | { |
465 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_1, quirk_ich6_lpc_acpi); | 465 | u32 val; |
466 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_31, quirk_ich6_lpc_acpi); | 466 | u32 size, base; |
467 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_0, quirk_ich6_lpc_acpi); | 467 | |
468 | DECLARE_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); |
469 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_3, quirk_ich6_lpc_acpi); | 469 | |
470 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_1, quirk_ich6_lpc_acpi); | 470 | /* Enabled? */ |
471 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_4, quirk_ich6_lpc_acpi); | 471 | if (!(val & 1)) |
472 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_2, quirk_ich6_lpc_acpi); | 472 | return; |
473 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_4, quirk_ich6_lpc_acpi); | 473 | base = val & 0xfffc; |
474 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_7, quirk_ich6_lpc_acpi); | 474 | if (dynsize) { |
475 | DECLARE_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 | |||
491 | static 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 | } | ||
500 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_0, quirk_ich6_lpc); | ||
501 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_1, quirk_ich6_lpc); | ||
502 | |||
503 | static 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 */ | ||
527 | static 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 | } | ||
538 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_0, quirk_ich7_lpc); | ||
539 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_1, quirk_ich7_lpc); | ||
540 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_31, quirk_ich7_lpc); | ||
541 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_0, quirk_ich7_lpc); | ||
542 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_2, quirk_ich7_lpc); | ||
543 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_3, quirk_ich7_lpc); | ||
544 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_1, quirk_ich7_lpc); | ||
545 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_4, quirk_ich7_lpc); | ||
546 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_2, quirk_ich7_lpc); | ||
547 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_4, quirk_ich7_lpc); | ||
548 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_7, quirk_ich7_lpc); | ||
549 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_8, quirk_ich7_lpc); | ||
550 | DECLARE_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 |