aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/quirks.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/quirks.c')
-rw-r--r--drivers/pci/quirks.c172
1 files changed, 172 insertions, 0 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index d1d7333bb71b..04618d4d7d74 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}
402DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3, quirk_piix4_acpi ); 402DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3, quirk_piix4_acpi );
403DECLARE_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}
683DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C597_0, quirk_vt82c598_id ); 684DECLARE_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 */
693static 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 &reg);
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
708DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8235, quirk_via_abnormal_poweroff);
709DECLARE_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
@@ -962,6 +990,11 @@ static void __init asus_hides_smbus_hostbridge(struct pci_dev *dev)
962 case 0x8070: /* P4G8X Deluxe */ 990 case 0x8070: /* P4G8X Deluxe */
963 asus_hides_smbus = 1; 991 asus_hides_smbus = 1;
964 } 992 }
993 if (dev->device == PCI_DEVICE_ID_INTEL_E7501_MCH)
994 switch (dev->subsystem_device) {
995 case 0x80c9: /* PU-DLS */
996 asus_hides_smbus = 1;
997 }
965 if (dev->device == PCI_DEVICE_ID_INTEL_82855GM_HB) 998 if (dev->device == PCI_DEVICE_ID_INTEL_82855GM_HB)
966 switch (dev->subsystem_device) { 999 switch (dev->subsystem_device) {
967 case 0x1751: /* M2N notebook */ 1000 case 0x1751: /* M2N notebook */
@@ -1030,6 +1063,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82845G_HB, asu
1030DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82850_HB, asus_hides_smbus_hostbridge ); 1063DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82850_HB, asus_hides_smbus_hostbridge );
1031DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82865_HB, asus_hides_smbus_hostbridge ); 1064DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82865_HB, asus_hides_smbus_hostbridge );
1032DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_7205_0, asus_hides_smbus_hostbridge ); 1065DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_7205_0, asus_hides_smbus_hostbridge );
1066DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E7501_MCH, asus_hides_smbus_hostbridge );
1033DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82855PM_HB, asus_hides_smbus_hostbridge ); 1067DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82855PM_HB, asus_hides_smbus_hostbridge );
1034DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82855GM_HB, asus_hides_smbus_hostbridge ); 1068DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82855GM_HB, asus_hides_smbus_hostbridge );
1035DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82915GM_HB, asus_hides_smbus_hostbridge ); 1069DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82915GM_HB, asus_hides_smbus_hostbridge );
@@ -1053,6 +1087,7 @@ static void __init asus_hides_smbus_lpc(struct pci_dev *dev)
1053} 1087}
1054DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_0, asus_hides_smbus_lpc ); 1088DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_0, asus_hides_smbus_lpc );
1055DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_0, asus_hides_smbus_lpc ); 1089DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_0, asus_hides_smbus_lpc );
1090DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_0, asus_hides_smbus_lpc );
1056DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_12, asus_hides_smbus_lpc ); 1091DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_12, asus_hides_smbus_lpc );
1057DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_12, asus_hides_smbus_lpc ); 1092DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_12, asus_hides_smbus_lpc );
1058DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_0, asus_hides_smbus_lpc ); 1093DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_0, asus_hides_smbus_lpc );
@@ -1174,6 +1209,55 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_962, quirk_sis_96x_
1174DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_963, quirk_sis_96x_smbus ); 1209DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_963, quirk_sis_96x_smbus );
1175DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_LPC, quirk_sis_96x_smbus ); 1210DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_LPC, quirk_sis_96x_smbus );
1176 1211
1212#if defined(CONFIG_SCSI_SATA) || defined(CONFIG_SCSI_SATA_MODULE)
1213
1214/*
1215 * If we are using libata we can drive this chip properly but must
1216 * do this early on to make the additional device appear during
1217 * the PCI scanning.
1218 */
1219
1220static void __devinit quirk_jmicron_dualfn(struct pci_dev *pdev)
1221{
1222 u32 conf;
1223 u8 hdr;
1224
1225 /* Only poke fn 0 */
1226 if (PCI_FUNC(pdev->devfn))
1227 return;
1228
1229 switch(pdev->device) {
1230 case PCI_DEVICE_ID_JMICRON_JMB365:
1231 case PCI_DEVICE_ID_JMICRON_JMB366:
1232 /* Redirect IDE second PATA port to the right spot */
1233 pci_read_config_dword(pdev, 0x80, &conf);
1234 conf |= (1 << 24);
1235 /* Fall through */
1236 pci_write_config_dword(pdev, 0x80, conf);
1237 case PCI_DEVICE_ID_JMICRON_JMB361:
1238 case PCI_DEVICE_ID_JMICRON_JMB363:
1239 pci_read_config_dword(pdev, 0x40, &conf);
1240 /* Enable dual function mode, AHCI on fn 0, IDE fn1 */
1241 /* Set the class codes correctly and then direct IDE 0 */
1242 conf &= ~0x000F0200; /* Clear bit 9 and 16-19 */
1243 conf |= 0x00C20002; /* Set bit 1, 17, 22, 23 */
1244 pci_write_config_dword(pdev, 0x40, conf);
1245
1246 /* Reconfigure so that the PCI scanner discovers the
1247 device is now multifunction */
1248
1249 pci_read_config_byte(pdev, PCI_HEADER_TYPE, &hdr);
1250 pdev->hdr_type = hdr & 0x7f;
1251 pdev->multifunction = !!(hdr & 0x80);
1252
1253 break;
1254 }
1255}
1256
1257DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, quirk_jmicron_dualfn);
1258
1259#endif
1260
1177#ifdef CONFIG_X86_IO_APIC 1261#ifdef CONFIG_X86_IO_APIC
1178static void __init quirk_alder_ioapic(struct pci_dev *pdev) 1262static void __init quirk_alder_ioapic(struct pci_dev *pdev)
1179{ 1263{
@@ -1341,6 +1425,37 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_0, quirk_pc
1341DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_1, quirk_pcie_pxh); 1425DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_1, quirk_pcie_pxh);
1342DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXHV, quirk_pcie_pxh); 1426DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXHV, quirk_pcie_pxh);
1343 1427
1428/*
1429 * Some Intel PCI Express chipsets have trouble with downstream
1430 * device power management.
1431 */
1432static void quirk_intel_pcie_pm(struct pci_dev * dev)
1433{
1434 pci_pm_d3_delay = 120;
1435 dev->no_d1d2 = 1;
1436}
1437
1438DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25e2, quirk_intel_pcie_pm);
1439DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25e3, quirk_intel_pcie_pm);
1440DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25e4, quirk_intel_pcie_pm);
1441DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25e5, quirk_intel_pcie_pm);
1442DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25e6, quirk_intel_pcie_pm);
1443DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25e7, quirk_intel_pcie_pm);
1444DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25f7, quirk_intel_pcie_pm);
1445DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25f8, quirk_intel_pcie_pm);
1446DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25f9, quirk_intel_pcie_pm);
1447DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25fa, quirk_intel_pcie_pm);
1448DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2601, quirk_intel_pcie_pm);
1449DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2602, quirk_intel_pcie_pm);
1450DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2603, quirk_intel_pcie_pm);
1451DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2604, quirk_intel_pcie_pm);
1452DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2605, quirk_intel_pcie_pm);
1453DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2606, quirk_intel_pcie_pm);
1454DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2607, quirk_intel_pcie_pm);
1455DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2608, quirk_intel_pcie_pm);
1456DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2609, quirk_intel_pcie_pm);
1457DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x260a, quirk_intel_pcie_pm);
1458DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x260b, quirk_intel_pcie_pm);
1344 1459
1345/* 1460/*
1346 * Fixup the cardbus bridges on the IBM Dock II docking station 1461 * Fixup the cardbus bridges on the IBM Dock II docking station
@@ -1403,6 +1518,63 @@ static void __devinit quirk_netmos(struct pci_dev *dev)
1403} 1518}
1404DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NETMOS, PCI_ANY_ID, quirk_netmos); 1519DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NETMOS, PCI_ANY_ID, quirk_netmos);
1405 1520
1521static void __devinit quirk_e100_interrupt(struct pci_dev *dev)
1522{
1523 u16 command;
1524 u32 bar;
1525 u8 __iomem *csr;
1526 u8 cmd_hi;
1527
1528 switch (dev->device) {
1529 /* PCI IDs taken from drivers/net/e100.c */
1530 case 0x1029:
1531 case 0x1030 ... 0x1034:
1532 case 0x1038 ... 0x103E:
1533 case 0x1050 ... 0x1057:
1534 case 0x1059:
1535 case 0x1064 ... 0x106B:
1536 case 0x1091 ... 0x1095:
1537 case 0x1209:
1538 case 0x1229:
1539 case 0x2449:
1540 case 0x2459:
1541 case 0x245D:
1542 case 0x27DC:
1543 break;
1544 default:
1545 return;
1546 }
1547
1548 /*
1549 * Some firmware hands off the e100 with interrupts enabled,
1550 * which can cause a flood of interrupts if packets are
1551 * received before the driver attaches to the device. So
1552 * disable all e100 interrupts here. The driver will
1553 * re-enable them when it's ready.
1554 */
1555 pci_read_config_word(dev, PCI_COMMAND, &command);
1556 pci_read_config_dword(dev, PCI_BASE_ADDRESS_0, &bar);
1557
1558 if (!(command & PCI_COMMAND_MEMORY) || !bar)
1559 return;
1560
1561 csr = ioremap(bar, 8);
1562 if (!csr) {
1563 printk(KERN_WARNING "PCI: Can't map %s e100 registers\n",
1564 pci_name(dev));
1565 return;
1566 }
1567
1568 cmd_hi = readb(csr + 3);
1569 if (cmd_hi == 0) {
1570 printk(KERN_WARNING "PCI: Firmware left %s e100 interrupts "
1571 "enabled, disabling\n", pci_name(dev));
1572 writeb(1, csr + 3);
1573 }
1574
1575 iounmap(csr);
1576}
1577DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_ANY_ID, quirk_e100_interrupt);
1406 1578
1407static void __devinit fixup_rev1_53c810(struct pci_dev* dev) 1579static void __devinit fixup_rev1_53c810(struct pci_dev* dev)
1408{ 1580{