diff options
Diffstat (limited to 'drivers/pci/quirks.c')
| -rw-r--r-- | drivers/pci/quirks.c | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index d1d7333bb71b..e3c78c39b7e4 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
| @@ -400,6 +400,7 @@ static void __devinit quirk_piix4_acpi(struct pci_dev *dev) | |||
| 400 | piix4_io_quirk(dev, "PIIX4 devres J", 0x7c, 1 << 20); | 400 | piix4_io_quirk(dev, "PIIX4 devres J", 0x7c, 1 << 20); |
| 401 | } | 401 | } |
| 402 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3, quirk_piix4_acpi ); | 402 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3, quirk_piix4_acpi ); |
| 403 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443MX_3, quirk_piix4_acpi ); | ||
| 403 | 404 | ||
| 404 | /* | 405 | /* |
| 405 | * ICH4, ICH4-M, ICH5, ICH5-M ACPI: Three IO regions pointed to by longwords at | 406 | * ICH4, ICH4-M, ICH5, ICH5-M ACPI: Three IO regions pointed to by longwords at |
| @@ -682,6 +683,33 @@ static void __devinit quirk_vt82c598_id(struct pci_dev *dev) | |||
| 682 | } | 683 | } |
| 683 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C597_0, quirk_vt82c598_id ); | 684 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C597_0, quirk_vt82c598_id ); |
| 684 | 685 | ||
| 686 | #ifdef CONFIG_ACPI_SLEEP | ||
| 687 | |||
| 688 | /* | ||
| 689 | * Some VIA systems boot with the abnormal status flag set. This can cause | ||
| 690 | * the BIOS to re-POST the system on resume rather than passing control | ||
| 691 | * back to the OS. Clear the flag on boot | ||
| 692 | */ | ||
| 693 | static void __devinit quirk_via_abnormal_poweroff(struct pci_dev *dev) | ||
| 694 | { | ||
| 695 | u32 reg; | ||
| 696 | |||
| 697 | acpi_hw_register_read(ACPI_MTX_DO_NOT_LOCK, ACPI_REGISTER_PM1_STATUS, | ||
| 698 | ®); | ||
| 699 | |||
| 700 | if (reg & 0x800) { | ||
| 701 | printk("Clearing abnormal poweroff flag\n"); | ||
| 702 | acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, | ||
| 703 | ACPI_REGISTER_PM1_STATUS, | ||
| 704 | (u16)0x800); | ||
| 705 | } | ||
| 706 | } | ||
| 707 | |||
| 708 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8235, quirk_via_abnormal_poweroff); | ||
| 709 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237, quirk_via_abnormal_poweroff); | ||
| 710 | |||
| 711 | #endif | ||
| 712 | |||
| 685 | /* | 713 | /* |
| 686 | * CardBus controllers have a legacy base address that enables them | 714 | * CardBus controllers have a legacy base address that enables them |
| 687 | * to respond as i82365 pcmcia controllers. We don't want them to | 715 | * to respond as i82365 pcmcia controllers. We don't want them to |
| @@ -1174,6 +1202,55 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_962, quirk_sis_96x_ | |||
| 1174 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_963, quirk_sis_96x_smbus ); | 1202 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_963, quirk_sis_96x_smbus ); |
| 1175 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_LPC, quirk_sis_96x_smbus ); | 1203 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_LPC, quirk_sis_96x_smbus ); |
| 1176 | 1204 | ||
| 1205 | #if defined(CONFIG_SCSI_SATA) || defined(CONFIG_SCSI_SATA_MODULE) | ||
| 1206 | |||
| 1207 | /* | ||
| 1208 | * If we are using libata we can drive this chip properly but must | ||
| 1209 | * do this early on to make the additional device appear during | ||
| 1210 | * the PCI scanning. | ||
| 1211 | */ | ||
| 1212 | |||
| 1213 | static void __devinit quirk_jmicron_dualfn(struct pci_dev *pdev) | ||
| 1214 | { | ||
| 1215 | u32 conf; | ||
| 1216 | u8 hdr; | ||
| 1217 | |||
| 1218 | /* Only poke fn 0 */ | ||
| 1219 | if (PCI_FUNC(pdev->devfn)) | ||
| 1220 | return; | ||
| 1221 | |||
| 1222 | switch(pdev->device) { | ||
| 1223 | case PCI_DEVICE_ID_JMICRON_JMB365: | ||
| 1224 | case PCI_DEVICE_ID_JMICRON_JMB366: | ||
| 1225 | /* Redirect IDE second PATA port to the right spot */ | ||
| 1226 | pci_read_config_dword(pdev, 0x80, &conf); | ||
| 1227 | conf |= (1 << 24); | ||
| 1228 | /* Fall through */ | ||
| 1229 | pci_write_config_dword(pdev, 0x80, conf); | ||
| 1230 | case PCI_DEVICE_ID_JMICRON_JMB361: | ||
| 1231 | case PCI_DEVICE_ID_JMICRON_JMB363: | ||
| 1232 | pci_read_config_dword(pdev, 0x40, &conf); | ||
| 1233 | /* Enable dual function mode, AHCI on fn 0, IDE fn1 */ | ||
| 1234 | /* Set the class codes correctly and then direct IDE 0 */ | ||
| 1235 | conf &= ~0x000F0200; /* Clear bit 9 and 16-19 */ | ||
| 1236 | conf |= 0x00C20002; /* Set bit 1, 17, 22, 23 */ | ||
| 1237 | pci_write_config_dword(pdev, 0x40, conf); | ||
| 1238 | |||
| 1239 | /* Reconfigure so that the PCI scanner discovers the | ||
| 1240 | device is now multifunction */ | ||
| 1241 | |||
| 1242 | pci_read_config_byte(pdev, PCI_HEADER_TYPE, &hdr); | ||
| 1243 | pdev->hdr_type = hdr & 0x7f; | ||
| 1244 | pdev->multifunction = !!(hdr & 0x80); | ||
| 1245 | |||
| 1246 | break; | ||
| 1247 | } | ||
| 1248 | } | ||
| 1249 | |||
| 1250 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, quirk_jmicron_dualfn); | ||
| 1251 | |||
| 1252 | #endif | ||
| 1253 | |||
| 1177 | #ifdef CONFIG_X86_IO_APIC | 1254 | #ifdef CONFIG_X86_IO_APIC |
| 1178 | static void __init quirk_alder_ioapic(struct pci_dev *pdev) | 1255 | static void __init quirk_alder_ioapic(struct pci_dev *pdev) |
| 1179 | { | 1256 | { |
| @@ -1341,6 +1418,37 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_0, quirk_pc | |||
| 1341 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_1, quirk_pcie_pxh); | 1418 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_1, quirk_pcie_pxh); |
| 1342 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXHV, quirk_pcie_pxh); | 1419 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXHV, quirk_pcie_pxh); |
| 1343 | 1420 | ||
| 1421 | /* | ||
| 1422 | * Some Intel PCI Express chipsets have trouble with downstream | ||
| 1423 | * device power management. | ||
| 1424 | */ | ||
| 1425 | static void quirk_intel_pcie_pm(struct pci_dev * dev) | ||
| 1426 | { | ||
| 1427 | pci_pm_d3_delay = 120; | ||
| 1428 | dev->no_d1d2 = 1; | ||
| 1429 | } | ||
| 1430 | |||
| 1431 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25e2, quirk_intel_pcie_pm); | ||
| 1432 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25e3, quirk_intel_pcie_pm); | ||
| 1433 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25e4, quirk_intel_pcie_pm); | ||
| 1434 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25e5, quirk_intel_pcie_pm); | ||
| 1435 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25e6, quirk_intel_pcie_pm); | ||
| 1436 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25e7, quirk_intel_pcie_pm); | ||
| 1437 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25f7, quirk_intel_pcie_pm); | ||
| 1438 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25f8, quirk_intel_pcie_pm); | ||
| 1439 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25f9, quirk_intel_pcie_pm); | ||
| 1440 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25fa, quirk_intel_pcie_pm); | ||
| 1441 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2601, quirk_intel_pcie_pm); | ||
| 1442 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2602, quirk_intel_pcie_pm); | ||
| 1443 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2603, quirk_intel_pcie_pm); | ||
| 1444 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2604, quirk_intel_pcie_pm); | ||
| 1445 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2605, quirk_intel_pcie_pm); | ||
| 1446 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2606, quirk_intel_pcie_pm); | ||
| 1447 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2607, quirk_intel_pcie_pm); | ||
| 1448 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2608, quirk_intel_pcie_pm); | ||
| 1449 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2609, quirk_intel_pcie_pm); | ||
| 1450 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x260a, quirk_intel_pcie_pm); | ||
| 1451 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x260b, quirk_intel_pcie_pm); | ||
| 1344 | 1452 | ||
| 1345 | /* | 1453 | /* |
| 1346 | * Fixup the cardbus bridges on the IBM Dock II docking station | 1454 | * Fixup the cardbus bridges on the IBM Dock II docking station |
