• Home
  • Raw
  • Download

Lines Matching +full:pch +full:- +full:pic +full:- +full:1

1 // SPDX-License-Identifier: GPL-2.0
3 * This file contains work-arounds for many known PCI hardware bugs.
5 * should be handled in arch-specific code.
23 #include <linux/pci-aspm.h>
63 if ((f->class == (u32) (dev->class >> f->class_shift) || in pci_do_fixups()
64 f->class == (u32) PCI_ANY_ID) && in pci_do_fixups()
65 (f->vendor == dev->vendor || in pci_do_fixups()
66 f->vendor == (u16) PCI_ANY_ID) && in pci_do_fixups()
67 (f->device == dev->device || in pci_do_fixups()
68 f->device == (u16) PCI_ANY_ID)) { in pci_do_fixups()
71 hook = offset_to_ptr(&f->hook_offset); in pci_do_fixups()
73 hook = f->hook; in pci_do_fixups()
200 * key system devices. For devices that need to have mmio decoding always-on,
201 * we need to set the dev->mmio_always_on bit.
205 dev->mmio_always_on = 1; in quirk_mmio_always_on()
217 dev->broken_parity_status = 1; /* This device gives false positives */ in quirk_mellanox_tavor()
237 if (!(dlc & 1<<1)) { in quirk_passive_release()
239 dlc |= 1<<1; in quirk_passive_release()
250 * contacts at VIA ask them for me please -- Alan
258 isa_dma_bridge_buggy = 1; in quirk_isa_dma_hangs()
294 /* Chipsets where PCI->PCI transfers vanish or hang */
332 * Made according to a Windows driver-based patch by George E. Breese;
334 * Also see http://www.au-ja.org/review-kt133a-1-en.phtml for the info on
353 * 0x40 - 0x4f == 686B, 0x10 - 0x2f == 686A; in quirk_vialatency()
357 if (p->revision < 0x40 || p->revision > 0x42) in quirk_vialatency()
365 if (p->revision < 0x10 || p->revision > 0x12) in quirk_vialatency()
387 busarb &= ~(1<<5); in quirk_vialatency()
388 busarb |= (1<<4); in quirk_vialatency()
457 dev->cfg_size = 0xA0; in quirk_citrine()
467 dev->cfg_size = 0x600; in quirk_nfp6000()
480 struct resource *r = &dev->resource[i]; in quirk_extend_bar_to_page()
482 if (r->flags & IORESOURCE_MEM && resource_size(r) < PAGE_SIZE) { in quirk_extend_bar_to_page()
483 r->end = PAGE_SIZE - 1; in quirk_extend_bar_to_page()
484 r->start = 0; in quirk_extend_bar_to_page()
485 r->flags |= IORESOURCE_UNSET; in quirk_extend_bar_to_page()
495 * If it's needed, re-allocate the region.
499 struct resource *r = &dev->resource[0]; in quirk_s3_64M()
501 if ((r->start & 0x3ffffff) || r->end != r->start + 0x3ffffff) { in quirk_s3_64M()
502 r->flags |= IORESOURCE_UNSET; in quirk_s3_64M()
503 r->start = 0; in quirk_s3_64M()
504 r->end = 0x3ffffff; in quirk_s3_64M()
515 struct resource *res = dev->resource + pos; in quirk_io()
522 res->name = pci_name(dev); in quirk_io()
523 res->flags = region & ~PCI_BASE_ADDRESS_IO_MASK; in quirk_io()
524 res->flags |= in quirk_io()
526 region &= ~(size - 1); in quirk_io()
530 bus_region.end = region + size - 1; in quirk_io()
531 pcibios_bus_to_resource(dev->bus, res, &bus_region); in quirk_io()
543 * CS553x's ISA PCI BARs may also be read-only (ref:
544 * https://bugzilla.kernel.org/show_bug.cgi?id=85991 - Comment #4 forward).
552 quirk_io(dev, 1, 256, name); /* GPIO */ in quirk_cs5536_vsa()
565 struct resource *res = dev->resource + nr; in quirk_io_region()
568 region &= ~(size - 1); in quirk_io_region()
573 res->name = pci_name(dev); in quirk_io_region()
574 res->flags = IORESOURCE_IO; in quirk_io_region()
578 bus_region.end = region + size - 1; in quirk_io_region()
579 pcibios_bus_to_resource(dev->bus, res, &bus_region); in quirk_io_region()
587 * between 0x3b0->0x3bb or read 0x3d3
611 u32 class = pdev->class; in quirk_amd_nl_class()
614 pdev->class = PCI_CLASS_SERIAL_USB_DEVICE; in quirk_amd_nl_class()
615 …pci_info(pdev, "PCI class overridden (%#08x -> %#08x) so dwc3 driver can claim this instead of xhc… in quirk_amd_nl_class()
616 class, pdev->class); in quirk_amd_nl_class()
634 quirk_io_region(dev, 0xE2, 32, PCI_BRIDGE_RESOURCES+1, "ali7101 SMB"); in quirk_ali7101_acpi()
650 unsigned bit = size >> 1; in piix4_io_quirk()
660 base &= -size; in piix4_io_quirk()
661 pci_info(dev, "%s PIO at %04x-%04x\n", name, base, base + size - 1); in piix4_io_quirk()
676 unsigned bit = size >> 1; in piix4_mem_quirk()
686 base &= -size; in piix4_mem_quirk()
687 pci_info(dev, "%s MMIO at %04x-%04x\n", name, base, base + size - 1); in piix4_mem_quirk()
701 quirk_io_region(dev, 0x90, 16, PCI_BRIDGE_RESOURCES+1, "PIIX4 SMB"); in quirk_piix4_acpi()
712 if (res_a & (1 << 29)) { in quirk_piix4_acpi()
713 piix4_io_quirk(dev, "PIIX4 devres E", 0x68, 1 << 20); in quirk_piix4_acpi()
714 piix4_mem_quirk(dev, "PIIX4 devres F", 0x6c, 1 << 7); in quirk_piix4_acpi()
717 if (res_a & (1 << 30)) { in quirk_piix4_acpi()
718 piix4_io_quirk(dev, "PIIX4 devres G", 0x70, 1 << 20); in quirk_piix4_acpi()
719 piix4_mem_quirk(dev, "PIIX4 devres H", 0x74, 1 << 7); in quirk_piix4_acpi()
721 piix4_io_quirk(dev, "PIIX4 devres I", 0x78, 1 << 20); in quirk_piix4_acpi()
722 piix4_io_quirk(dev, "PIIX4 devres J", 0x7c, 1 << 20); in quirk_piix4_acpi()
739 * ICH4, ICH4-M, ICH5, ICH5-M ACPI: Three IO regions pointed to by longwords at
761 quirk_io_region(dev, ICH4_GPIOBASE, 64, PCI_BRIDGE_RESOURCES+1, in quirk_ich4_lpc_acpi()
786 quirk_io_region(dev, ICH6_GPIOBASE, 64, PCI_BRIDGE_RESOURCES+1, in ich6_lpc_acpi_gpio()
799 if (!(val & 1)) in ich6_lpc_generic_decode()
813 base &= ~(size-1); in ich6_lpc_generic_decode()
819 pci_info(dev, "%s PIO at %04x-%04x\n", name, base, base+size-1); in ich6_lpc_generic_decode()
827 /* ICH6-specific generic IO decode */ in quirk_ich6_lpc()
828 ich6_lpc_generic_decode(dev, 0x84, "LPC Generic IO decode 1", 0); in quirk_ich6_lpc()
829 ich6_lpc_generic_decode(dev, 0x88, "LPC Generic IO decode 2", 1); in quirk_ich6_lpc()
843 if (!(val & 1)) in ich7_lpc_generic_decode()
846 /* IO base in bits 15:2, mask in bits 23:18, both are dword-based */ in ich7_lpc_generic_decode()
858 /* ICH7-10 has the same common LPC generic IO decode registers */
865 ich7_lpc_generic_decode(dev, 0x84, "ICH7 LPC Generic IO decode 1"); in quirk_ich7_lpc()
890 if (dev->revision & 0x10) in quirk_vt82c586_acpi()
906 quirk_io_region(dev, 0x70, 128, PCI_BRIDGE_RESOURCES+1, in quirk_vt82c686_acpi()
907 "vt82c686 HW-mon"); in quirk_vt82c686_acpi()
921 quirk_io_region(dev, 0xd0, 16, PCI_BRIDGE_RESOURCES+1, "vt8235 SMB"); in quirk_vt8235_acpi()
926 * TI XIO2000a PCIe-PCI Bridge erroneously reports it supports fast
927 * back-to-back: Disable fast back-to-back on the secondary bus segment
934 pci_warn(dev, "TI XIO2000a quirk detected; secondary bus fast back-to-back transfers disabled\n"); in quirk_xio2000a()
935 list_for_each_entry(pdev, &dev->subordinate->devices, bus_list) { in quirk_xio2000a()
949 * VIA 686A/B: If an IO-APIC is active, we need to route all on-chip
952 * TODO: When we have device-specific interrupt routers, this code will go
959 if (nr_ioapics < 1) in quirk_via_ioapic()
962 tmp = 0x1f; /* all known bits (4-0) routed to external APIC */ in quirk_via_ioapic()
974 * VIA 8237: Some BIOSes don't set the 'Bypass APIC De-Assert Message' Bit.
986 pci_info(dev, "Bypassing VIA 8237 APIC De-Assert Message\n"); in quirk_via_vt8237_bypass_apic_deassert()
994 * The AMD IO-APIC can hang the box when an APIC IRQ is masked.
1004 if (dev->revision >= 0x02) { in quirk_amd_ioapic()
1016 /* Fix for improper SR-IOV configuration on Cavium cn88xx RNM device */ in quirk_cavium_sriov_rnm_link()
1017 if (dev->subsystem_device == 0xa118) in quirk_cavium_sriov_rnm_link()
1018 dev->sriov->link = dev->devfn; in quirk_cavium_sriov_rnm_link()
1025 * See AMD 8131 HyperTransport PCI-X Tunnel Revision Guide
1029 if (dev->subordinate && dev->revision <= 0x12) { in quirk_amd_8131_mmrbc()
1030 pci_info(dev, "AMD8131 rev %x detected; disabling PCI-X MMRBC\n", in quirk_amd_8131_mmrbc()
1031 dev->revision); in quirk_amd_8131_mmrbc()
1032 dev->subordinate->bus_flags |= PCI_BUS_FLAGS_NO_MMRBC; in quirk_amd_8131_mmrbc()
1042 * -jgarzik
1052 d->irq = irq; in quirk_via_acpi()
1058 static int via_vlink_dev_lo = -1, via_vlink_dev_hi = 18;
1063 switch (dev->device) { in quirk_via_bridge()
1070 via_vlink_dev_lo = PCI_SLOT(dev->devfn); in quirk_via_bridge()
1071 via_vlink_dev_hi = PCI_SLOT(dev->devfn); in quirk_via_bridge()
1098 * quirk_via_vlink - VIA VLink IRQ number update
1101 * If the device we are dealing with is on a PIC IRQ we need to ensure that
1113 if (via_vlink_dev_lo == -1) in quirk_via_vlink()
1116 new_irq = dev->irq; in quirk_via_vlink()
1123 if (dev->bus->number != 0 || PCI_SLOT(dev->devfn) > via_vlink_dev_hi || in quirk_via_vlink()
1124 PCI_SLOT(dev->devfn) < via_vlink_dev_lo) in quirk_via_vlink()
1128 * This is an internal VLink device on a PIC interrupt. The BIOS in quirk_via_vlink()
1149 pci_read_config_word(dev, PCI_DEVICE_ID, &dev->device); in quirk_vt82c598_id()
1184 pcic |= (1 << 23); /* Required in this mode */ in quirk_amd_ordering()
1192 * DreamWorks-provided workaround for Dunord I-3000 problem
1200 struct resource *r = &dev->resource[1]; in quirk_dunord()
1202 r->flags |= IORESOURCE_UNSET; in quirk_dunord()
1203 r->start = 0; in quirk_dunord()
1204 r->end = 0xffffff; in quirk_dunord()
1209 * i82380FB mobile docking controller: its PCI-to-PCI bridge is subtractive
1211 * Unfortunately, the ProgIf value is wrong - 0x80 instead of 0x01.
1215 dev->transparent = 1; in quirk_transparent_bridge()
1250 if (pdev->revision != 0x04) /* Only C0 requires this */ in quirk_disable_pxb()
1253 if (config & (1<<6)) { in quirk_disable_pxb()
1254 config &= ~(1<<6); in quirk_disable_pxb()
1264 /* set SBX00/Hudson-2 SATA in IDE mode to AHCI mode */ in quirk_amd_ide_mode()
1270 pci_write_config_byte(pdev, 0x40, tmp|1); in quirk_amd_ide_mode()
1271 pci_write_config_byte(pdev, 0x9, 1); in quirk_amd_ide_mode()
1275 pdev->class = PCI_CLASS_STORAGE_SATA_AHCI; in quirk_amd_ide_mode()
1295 pdev->class &= ~5; in quirk_svwks_csb5ide()
1302 /* Intel 82801CAM ICH3-M datasheet says IDE modes must be the same */
1309 if (((prog & 1) && !(prog & 4)) || ((prog & 4) && !(prog & 1))) { in quirk_ide_samemode()
1312 pdev->class &= ~5; in quirk_ide_samemode()
1321 pdev->dev_flags |= PCI_DEV_FLAGS_NO_D3; in quirk_no_ata_d3()
1337 * This was originally an Alpha-specific thing, but it really fits here.
1338 * The i82375 PCI/EISA bridge appears as non-classified. Fix that.
1342 dev->class = PCI_CLASS_BRIDGE_EISA << 8; in quirk_eisa_bridge()
1355 * becomes necessary to do this tweak in two steps -- the chosen trigger
1356 * is either the Host bridge (preferred) or on-board VGA controller.
1369 * the DSDT and double-check that there is no code accessing the SMBus.
1375 if (unlikely(dev->subsystem_vendor == PCI_VENDOR_ID_ASUSTEK)) { in asus_hides_smbus_hostbridge()
1376 if (dev->device == PCI_DEVICE_ID_INTEL_82845_HB) in asus_hides_smbus_hostbridge()
1377 switch (dev->subsystem_device) { in asus_hides_smbus_hostbridge()
1378 case 0x8025: /* P4B-LX */ in asus_hides_smbus_hostbridge()
1382 asus_hides_smbus = 1; in asus_hides_smbus_hostbridge()
1384 else if (dev->device == PCI_DEVICE_ID_INTEL_82845G_HB) in asus_hides_smbus_hostbridge()
1385 switch (dev->subsystem_device) { in asus_hides_smbus_hostbridge()
1386 case 0x80b1: /* P4GE-V */ in asus_hides_smbus_hostbridge()
1388 case 0x8093: /* P4B533-V */ in asus_hides_smbus_hostbridge()
1389 asus_hides_smbus = 1; in asus_hides_smbus_hostbridge()
1391 else if (dev->device == PCI_DEVICE_ID_INTEL_82850_HB) in asus_hides_smbus_hostbridge()
1392 switch (dev->subsystem_device) { in asus_hides_smbus_hostbridge()
1394 asus_hides_smbus = 1; in asus_hides_smbus_hostbridge()
1396 else if (dev->device == PCI_DEVICE_ID_INTEL_7205_0) in asus_hides_smbus_hostbridge()
1397 switch (dev->subsystem_device) { in asus_hides_smbus_hostbridge()
1399 asus_hides_smbus = 1; in asus_hides_smbus_hostbridge()
1401 else if (dev->device == PCI_DEVICE_ID_INTEL_E7501_MCH) in asus_hides_smbus_hostbridge()
1402 switch (dev->subsystem_device) { in asus_hides_smbus_hostbridge()
1403 case 0x80c9: /* PU-DLS */ in asus_hides_smbus_hostbridge()
1404 asus_hides_smbus = 1; in asus_hides_smbus_hostbridge()
1406 else if (dev->device == PCI_DEVICE_ID_INTEL_82855GM_HB) in asus_hides_smbus_hostbridge()
1407 switch (dev->subsystem_device) { in asus_hides_smbus_hostbridge()
1411 asus_hides_smbus = 1; in asus_hides_smbus_hostbridge()
1413 else if (dev->device == PCI_DEVICE_ID_INTEL_82855PM_HB) in asus_hides_smbus_hostbridge()
1414 switch (dev->subsystem_device) { in asus_hides_smbus_hostbridge()
1417 asus_hides_smbus = 1; in asus_hides_smbus_hostbridge()
1419 else if (dev->device == PCI_DEVICE_ID_INTEL_82865_HB) in asus_hides_smbus_hostbridge()
1420 switch (dev->subsystem_device) { in asus_hides_smbus_hostbridge()
1421 case 0x80f2: /* P4P800-X */ in asus_hides_smbus_hostbridge()
1422 asus_hides_smbus = 1; in asus_hides_smbus_hostbridge()
1424 else if (dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB) in asus_hides_smbus_hostbridge()
1425 switch (dev->subsystem_device) { in asus_hides_smbus_hostbridge()
1428 asus_hides_smbus = 1; in asus_hides_smbus_hostbridge()
1430 } else if (unlikely(dev->subsystem_vendor == PCI_VENDOR_ID_HP)) { in asus_hides_smbus_hostbridge()
1431 if (dev->device == PCI_DEVICE_ID_INTEL_82855PM_HB) in asus_hides_smbus_hostbridge()
1432 switch (dev->subsystem_device) { in asus_hides_smbus_hostbridge()
1435 asus_hides_smbus = 1; in asus_hides_smbus_hostbridge()
1437 else if (dev->device == PCI_DEVICE_ID_INTEL_82865_HB) in asus_hides_smbus_hostbridge()
1438 switch (dev->subsystem_device) { in asus_hides_smbus_hostbridge()
1442 asus_hides_smbus = 1; in asus_hides_smbus_hostbridge()
1444 else if (dev->device == PCI_DEVICE_ID_INTEL_82875_HB) in asus_hides_smbus_hostbridge()
1445 switch (dev->subsystem_device) { in asus_hides_smbus_hostbridge()
1447 asus_hides_smbus = 1; in asus_hides_smbus_hostbridge()
1449 } else if (unlikely(dev->subsystem_vendor == PCI_VENDOR_ID_SAMSUNG)) { in asus_hides_smbus_hostbridge()
1450 if (dev->device == PCI_DEVICE_ID_INTEL_82855PM_HB) in asus_hides_smbus_hostbridge()
1451 switch (dev->subsystem_device) { in asus_hides_smbus_hostbridge()
1453 asus_hides_smbus = 1; in asus_hides_smbus_hostbridge()
1455 } else if (unlikely(dev->subsystem_vendor == PCI_VENDOR_ID_COMPAQ)) { in asus_hides_smbus_hostbridge()
1456 if (dev->device == PCI_DEVICE_ID_INTEL_82855PM_HB) in asus_hides_smbus_hostbridge()
1457 switch (dev->subsystem_device) { in asus_hides_smbus_hostbridge()
1459 asus_hides_smbus = 1; in asus_hides_smbus_hostbridge()
1461 else if (dev->device == PCI_DEVICE_ID_INTEL_82810_IG3) in asus_hides_smbus_hostbridge()
1462 switch (dev->subsystem_device) { in asus_hides_smbus_hostbridge()
1463 case 0xB16C: /* Compaq Deskpro EP 401963-001 (PCA# 010174) */ in asus_hides_smbus_hostbridge()
1466 * its on-board VGA controller */ in asus_hides_smbus_hostbridge()
1467 asus_hides_smbus = 1; in asus_hides_smbus_hostbridge()
1469 else if (dev->device == PCI_DEVICE_ID_INTEL_82801DB_2) in asus_hides_smbus_hostbridge()
1470 switch (dev->subsystem_device) { in asus_hides_smbus_hostbridge()
1475 * subvendor/subdevice IDs and on-board VGA in asus_hides_smbus_hostbridge()
1478 * Controller #1 */ in asus_hides_smbus_hostbridge()
1479 asus_hides_smbus = 1; in asus_hides_smbus_hostbridge()
1481 else if (dev->device == PCI_DEVICE_ID_INTEL_82815_CGC) in asus_hides_smbus_hostbridge()
1482 switch (dev->subsystem_device) { in asus_hides_smbus_hostbridge()
1486 * its on-board VGA controller */ in asus_hides_smbus_hostbridge()
1487 asus_hides_smbus = 1; in asus_hides_smbus_hostbridge()
1626 pci_write_config_byte(dev, SIS_DETECT_REGISTER, reg | (1 << 6)); in quirk_sis_503()
1638 dev->device = devid; in quirk_sis_503()
1648 * -- bjd
1655 if (likely(dev->subsystem_vendor == PCI_VENDOR_ID_ASUSTEK)) { in asus_hides_ac97_lpc()
1656 if (dev->device == PCI_DEVICE_ID_VIA_8237) in asus_hides_ac97_lpc()
1657 asus_hides_ac97 = 1; in asus_hides_ac97_lpc()
1689 if (PCI_FUNC(pdev->devfn)) in quirk_jmicron_ata()
1695 conf1 &= ~0x00CFF302; /* Clear bit 1, 8, 9, 12-19, 22, 23 */ in quirk_jmicron_ata()
1696 conf5 &= ~(1 << 24); /* Clear bit 24 */ in quirk_jmicron_ata()
1698 switch (pdev->device) { in quirk_jmicron_ata()
1709 conf5 |= (1 << 24); in quirk_jmicron_ata()
1716 conf1 |= 0x00C2A1B3; /* Set 0, 1, 4, 5, 7, 8, 13, 15, 17, 22, 23 */ in quirk_jmicron_ata()
1730 pdev->hdr_type = hdr & 0x7f; in quirk_jmicron_ata()
1731 pdev->multifunction = !!(hdr & 0x80); in quirk_jmicron_ata()
1734 pdev->class = class >> 8; in quirk_jmicron_ata()
1759 if (dev->multifunction) { in quirk_jmicron_async_suspend()
1760 device_disable_async_suspend(&dev->dev); in quirk_jmicron_async_suspend()
1761 pci_info(dev, "async suspend disabled to avoid multi-function power-on ordering issue\n"); in quirk_jmicron_async_suspend()
1774 if ((pdev->class >> 8) != 0xff00) in quirk_alder_ioapic()
1778 * The first BAR is the location of the IO-APIC... we must in quirk_alder_ioapic()
1783 insert_resource(&iomem_resource, &pdev->resource[0]); in quirk_alder_ioapic()
1789 for (i = 1; i < 6; i++) in quirk_alder_ioapic()
1790 memset(&pdev->resource[i], 0, sizeof(pdev->resource[i])); in quirk_alder_ioapic()
1797 pdev->no_msi = 1; in quirk_pcie_mch()
1807 * together on certain PXH-based systems.
1811 dev->no_msi = 1; in quirk_pcie_pxh()
1827 dev->no_d1d2 = 1; in quirk_intel_pcie_pm()
1853 if (dev->d3_delay >= delay) in quirk_d3hot_delay()
1856 dev->d3_delay = delay; in quirk_d3hot_delay()
1857 pci_info(dev, "extending delay after power-on from D3hot to %d msec\n", in quirk_d3hot_delay()
1858 dev->d3_delay); in quirk_d3hot_delay()
1863 if (dev->subsystem_vendor == PCI_VENDOR_ID_APPLE && in quirk_radeon_pm()
1864 dev->subsystem_device == 0x00e2) in quirk_radeon_pm()
1875 * remain on in D3hot state. The D3hot-to-D0 transition then requires an
1888 noioapicreroute = 1; in dmi_disable_ioapicreroute()
1889 pr_info("%s detected: disable boot interrupt reroute\n", d->ident); in dmi_disable_ioapicreroute()
1900 .ident = "ASUSTek Computer INC. M2N-LR",
1903 DMI_MATCH(DMI_PRODUCT_NAME, "M2N-LR"),
1921 dev->irq_reroute_variant = INTEL_IRQ_REROUTE_VARIANT; in quirk_reroute_to_boot_interrupts_intel()
1923 dev->vendor, dev->device); in quirk_reroute_to_boot_interrupts_intel()
1948 * IO-APIC1 on 6300ESB generates boot interrupts, see Intel order no
1949 * 300641-004US, section 5.7.3.
1951 * Core IO on Xeon E5 1600/2600/4600, see Intel order no 326509-003.
1952 * Core IO on Xeon E5 v2, see Intel order no 329188-003.
1953 * Core IO on Xeon E7 v2, see Intel order no 329595-002.
1954 * Core IO on Xeon E5 v3, see Intel order no 330784-003.
1955 * Core IO on Xeon E7 v3, see Intel order no 332315-001US.
1956 * Core IO on Xeon E5 v4, see Intel order no 333810-002US.
1957 * Core IO on Xeon E7 v4, see Intel order no 332315-001US.
1958 * Core IO on Xeon D-1500, see Intel order no 332051-001.
1962 #define INTEL_6300_DISABLE_BOOT_IRQ (1<<14)
1965 #define INTEL_CIPINTRC_DIS_INTX_ICH (1<<25)
1975 switch (dev->device) { in quirk_disable_intel_boot_interrupt()
1986 case 0x6f28: /* Xeon D-1500 */ in quirk_disable_intel_boot_interrupt()
1998 dev->vendor, dev->device); in quirk_disable_intel_boot_interrupt()
2001 * Device 29 Func 5 Device IDs of IO-APIC
2037 /* Disable boot interrupts on HT-1000 */
2039 #define BC_HT1000_PIC_REGS_ENABLE (1<<0)
2063 dev->vendor, dev->device); in quirk_disable_broadcom_boot_interrupt()
2072 * rev. A0 and B0, NOIOAMODE needs to be disabled anyway to fix IO-APIC mode
2076 #define AMD_813X_NOIOAMODE (1<<0)
2086 if ((dev->revision == AMD_813X_REV_B1) || in quirk_disable_amd_813x_boot_interrupt()
2087 (dev->revision == AMD_813X_REV_B2)) in quirk_disable_amd_813x_boot_interrupt()
2095 dev->vendor, dev->device); in quirk_disable_amd_813x_boot_interrupt()
2114 dev->vendor, dev->device); in quirk_disable_amd_8111_boot_interrupt()
2119 dev->vendor, dev->device); in quirk_disable_amd_8111_boot_interrupt()
2126 * Toshiba TC86C001 IDE controller reports the standard 8-byte BAR0 size
2128 * Re-allocate the region if needed...
2132 struct resource *r = &dev->resource[0]; in quirk_tc86c001_ide()
2134 if (r->start & 0x8) { in quirk_tc86c001_ide()
2135 r->flags |= IORESOURCE_UNSET; in quirk_tc86c001_ide()
2136 r->start = 0; in quirk_tc86c001_ide()
2137 r->end = 0xf; in quirk_tc86c001_ide()
2149 * Re-allocate the regions to a 256-byte boundary if necessary.
2156 if (dev->revision >= 2) in quirk_plx_pci9050()
2158 for (bar = 0; bar <= 1; bar++) in quirk_plx_pci9050()
2161 struct resource *r = &dev->resource[bar]; in quirk_plx_pci9050()
2162 pci_info(dev, "Re-allocating PLX PCI 9050 BAR %u to length 256 to avoid bit 7 bug\n", in quirk_plx_pci9050()
2164 r->flags |= IORESOURCE_UNSET; in quirk_plx_pci9050()
2165 r->start = 0; in quirk_plx_pci9050()
2166 r->end = 0xff; in quirk_plx_pci9050()
2185 unsigned int num_parallel = (dev->subsystem_device & 0xf0) >> 4; in quirk_netmos()
2186 unsigned int num_serial = dev->subsystem_device & 0xf; in quirk_netmos()
2198 switch (dev->device) { in quirk_netmos()
2201 if (dev->subsystem_vendor == PCI_VENDOR_ID_IBM && in quirk_netmos()
2202 dev->subsystem_device == 0x0299) in quirk_netmos()
2211 dev->device, num_parallel, num_serial); in quirk_netmos()
2212 dev->class = (PCI_CLASS_COMMUNICATION_OTHER << 8) | in quirk_netmos()
2213 (dev->class & 0xff); in quirk_netmos()
2226 switch (dev->device) { in quirk_e100_interrupt()
2251 * re-enable them when it's ready. in quirk_e100_interrupt()
2262 if (dev->pm_cap) { in quirk_e100_interrupt()
2263 pci_read_config_word(dev, dev->pm_cap + PCI_PM_CTRL, &pmcsr); in quirk_e100_interrupt()
2278 writeb(1, csr + 3); in quirk_e100_interrupt()
2317 * ASM1083/1085 PCIe-PCI bridge devices cause AER timeout errors on the
2324 * Some Pericom PCIe-to-PCI bridges in reverse mode need the PCIe Retrain
2333 dev->clear_retrain_link = 1; in quirk_enable_clear_retrain_link()
2342 u32 class = dev->class; in fixup_rev1_53c810()
2345 * rev 1 ncr53c810 chips don't set the class at all which means in fixup_rev1_53c810()
2351 dev->class = PCI_CLASS_STORAGE_SCSI << 8; in fixup_rev1_53c810()
2352 pci_info(dev, "NCR 53c810 rev 1 PCI class overridden (%#08x -> %#08x)\n", in fixup_rev1_53c810()
2353 class, dev->class); in fixup_rev1_53c810()
2357 /* Enable 1k I/O space granularity on the Intel P64H2 */
2365 pci_info(dev, "Enable I/O Space to 1KB granularity\n"); in quirk_p64h2_1k_io()
2366 dev->io_window_1k = 1; in quirk_p64h2_1k_io()
2400 * VT6212L is found -- the CX700 core itself also contains a USB in quirk_via_cx700_pci_parking_caching()
2410 * p should contain the first (internal) VT6212L -- see if we have in quirk_via_cx700_pci_parking_caching()
2432 /* Set PCI Master Bus time-out to "1x16 PCLK" */ in quirk_via_cx700_pci_parking_caching()
2464 * DRBs - this is where we expose device 6.
2465 * http://www.x86-secret.com/articles/tweak/pat/patsecrets-2.htm
2506 if (dev->subordinate) { in quirk_disable_msi()
2508 dev->subordinate->bus_flags |= PCI_BUS_FLAGS_NO_MSI; in quirk_disable_msi()
2525 apc_bridge = pci_get_slot(host_bridge->bus, PCI_DEVFN(1, 0)); in quirk_amd_780_apc_msi()
2527 if (apc_bridge->device == 0x9602) in quirk_amd_780_apc_msi()
2536 * Go through the list of HyperTransport capabilities and return 1 if a HT
2544 while (pos && ttl--) { in msi_ht_cap_enabled()
2564 if (dev->subordinate && !msi_ht_cap_enabled(dev)) { in quirk_msi_ht_cap()
2566 dev->subordinate->bus_flags |= PCI_BUS_FLAGS_NO_MSI; in quirk_msi_ht_cap()
2580 if (!dev->subordinate) in quirk_nvidia_ck804_msi_ht_cap()
2587 pdev = pci_get_slot(dev->bus, 0); in quirk_nvidia_ck804_msi_ht_cap()
2592 dev->subordinate->bus_flags |= PCI_BUS_FLAGS_NO_MSI; in quirk_nvidia_ck804_msi_ht_cap()
2605 while (pos && ttl--) { in ht_enable_msi_mapping()
2626 * The P5N32-SLI motherboards from Asus have a problem with MSI
2635 (strstr(board_name, "P5N32-SLI PREMIUM") || in nvenet_msi_disable()
2636 strstr(board_name, "P5N32-E SLI"))) { in nvenet_msi_disable()
2637 pci_info(dev, "Disabling MSI for MCP55 NIC on P5N32-SLI\n"); in nvenet_msi_disable()
2638 dev->no_msi = 1; in nvenet_msi_disable()
2664 if (cfg & ((1 << 2) | (1 << 15))) { in nvbridge_check_legacy_irq_routing()
2666 cfg &= ~((1 << 2) | (1 << 15)); in nvbridge_check_legacy_irq_routing()
2684 while (pos && ttl--) { in ht_check_msi_mapping()
2687 if (found < 1) in ht_check_msi_mapping()
2688 found = 1; in ht_check_msi_mapping()
2712 dev_no = host_bridge->devfn >> 3; in host_bridge_with_leaf()
2713 for (i = dev_no + 1; i < 0x20; i++) { in host_bridge_with_leaf()
2714 dev = pci_get_slot(host_bridge->bus, PCI_DEVFN(i, 0)); in host_bridge_with_leaf()
2726 found = 1; in host_bridge_with_leaf()
2752 ctrl_off = ((flags >> 10) & 1) ? in is_end_of_ht_chain()
2756 if (ctrl & (1 << 6)) in is_end_of_ht_chain()
2757 end = 1; in is_end_of_ht_chain()
2770 dev_no = dev->devfn >> 3; in nv_ht_enable_msi_mapping()
2771 for (i = dev_no; i >= 0; i--) { in nv_ht_enable_msi_mapping()
2772 host_bridge = pci_get_slot(dev->bus, PCI_DEVFN(i, 0)); in nv_ht_enable_msi_mapping()
2778 found = 1; in nv_ht_enable_msi_mapping()
2807 while (pos && ttl--) { in ht_disable_msi_mapping()
2840 * a non-Hypertransport host bridge. Locate the host bridge... in __nv_msi_ht_cap_quirk()
2842 host_bridge = pci_get_domain_bus_and_slot(pci_domain_nr(dev->bus), 0, in __nv_msi_ht_cap_quirk()
2852 if (found == 1) { in __nv_msi_ht_cap_quirk()
2863 if (found == 1) in __nv_msi_ht_cap_quirk()
2875 return __nv_msi_ht_cap_quirk(dev, 1); in nv_msi_ht_cap_quirk_all()
2889 dev->dev_flags |= PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG; in quirk_msi_intx_disable_bug()
2906 if ((p->revision < 0x3B) && (p->revision >= 0x30)) in quirk_msi_intx_disable_ati_bug()
2907 dev->dev_flags |= PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG; in quirk_msi_intx_disable_ati_bug()
2914 if (dev->revision < 0x18) { in quirk_msi_intx_disable_qca_bug()
2916 dev->dev_flags |= PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG; in quirk_msi_intx_disable_qca_bug()
2982 * pci=hpmemsize=nnM and pci=hpiosize=nnM parameters. For some PCI-PCI
2989 dev->is_hotplug_bridge = 1; in quirk_hotplug_bridge()
3006 * MMC controller - so the SDHCI driver never sees them.
3016 * #1, and this will confuse the PCI core.
3030 if (PCI_FUNC(dev->devfn)) in ricoh_mmc_fixup_rl5c476()
3061 if (PCI_FUNC(dev->devfn)) in ricoh_mmc_fixup_r5c832()
3068 * 0x150 - SD2.0 mode enable for changing base clock in ricoh_mmc_fixup_r5c832()
3070 * 0xe1 - Base clock frequency in ricoh_mmc_fixup_r5c832()
3071 * 0x32 - 50Mhz new clock frequency in ricoh_mmc_fixup_r5c832()
3072 * 0xf9 - Key register for 0x150 in ricoh_mmc_fixup_r5c832()
3073 * 0xfc - key register for 0xe1 in ricoh_mmc_fixup_r5c832()
3075 if (dev->device == PCI_DEVICE_ID_RICOH_R5CE822 || in ricoh_mmc_fixup_r5c832()
3076 dev->device == PCI_DEVICE_ID_RICOH_R5CE823) { in ricoh_mmc_fixup_r5c832()
3111 #define VTD_MSK_SPEC_ERRORS (1 << 31)
3113 * This is a quirk for masking VT-d spec-defined errors to platform error
3116 * on the RAS config settings of the platform) when a VT-d fault happens.
3119 * VT-d spec-related errors are already handled by the VT-d OS code, so no
3135 u32 class = dev->class; in fixup_ti816x_class()
3138 dev->class = PCI_CLASS_MULTIMEDIA_VIDEO << 8; in fixup_ti816x_class()
3139 pci_info(dev, "PCI class overridden (%#08x -> %#08x)\n", in fixup_ti816x_class()
3140 class, dev->class); in fixup_ti816x_class()
3151 dev->pcie_mpss = 1; /* 256 bytes */ in fixup_mpss_256()
3165 * coalescing must be disabled. Unfortunately, it cannot be re-enabled because
3188 if (!(rcc & (1 << 10))) in quirk_intel_mc_errata()
3191 rcc &= ~(1 << 10); in quirk_intel_mc_errata()
3201 /* Intel 5000 series memory controllers and ports 2-7 */
3216 /* Intel 5100 series memory controllers and ports 2-7 */
3243 dev->resource[2].end = dev->resource[2].start + ((u64) 1 << val) - 1; in quirk_intel_ntb()
3249 dev->resource[4].end = dev->resource[4].start + ((u64) 1 << val) - 1; in quirk_intel_ntb()
3258 * and the interrupt ends up -somewhere-.
3298 dev->d3_delay = 0; in quirk_remove_d3_delay()
3304 /* Lynxpoint-H PCH devices do not need 10ms d3_delay */
3334 dev->broken_intx_masking = 1; in quirk_broken_intx_masking()
3347 * RTL8110SC - Fails under PCI device assignment using DisINTx masking.
3354 * DisINTx can be set but the interrupt status bit is non-functional.
3394 * Check ConnectX-4/LX FW version to see if it supports legacy interrupts.
3410 if (pdev->device == mellanox_broken_intx_devs[i]) { in mellanox_check_broken_intx_masking()
3411 pdev->broken_intx_masking = 1; in mellanox_check_broken_intx_masking()
3417 * Getting here means Connect-IB cards and up. Connect-IB has no INTx in mellanox_check_broken_intx_masking()
3420 if (pdev->device == PCI_DEVICE_ID_MELLANOX_CONNECTIB) in mellanox_check_broken_intx_masking()
3423 if (pdev->device != PCI_DEVICE_ID_MELLANOX_CONNECTX4 && in mellanox_check_broken_intx_masking()
3424 pdev->device != PCI_DEVICE_ID_MELLANOX_CONNECTX4_LX) in mellanox_check_broken_intx_masking()
3427 /* For ConnectX-4 and ConnectX-4LX, need to check FW support */ in mellanox_check_broken_intx_masking()
3435 pci_warn(pdev, "Can't map ConnectX-4 initialization segment\n"); in mellanox_check_broken_intx_masking()
3441 fw_sub_min = ioread32be(fw_ver + 1); in mellanox_check_broken_intx_masking()
3447 …pci_warn(pdev, "ConnectX-4: FW %u.%u.%u doesn't support INTx masking, disabling. Please upgrade FW… in mellanox_check_broken_intx_masking()
3448 fw_major, fw_minor, fw_subminor, pdev->device == in mellanox_check_broken_intx_masking()
3450 pdev->broken_intx_masking = 1; in mellanox_check_broken_intx_masking()
3463 dev->dev_flags |= PCI_DEV_FLAGS_NO_BUS_RESET; in quirk_no_bus_reset()
3468 * The device will throw a Link Down error on AER-capable systems and
3471 * http://www.spinics.net/lists/linux-pci/msg34797.html
3492 if (!pci_is_root_bus(dev->bus)) in quirk_no_pm_reset()
3493 dev->dev_flags |= PCI_DEV_FLAGS_NO_PM_RESET; in quirk_no_pm_reset()
3497 * Some AMD/ATI GPUS (HD8570 - Oland) report that a D3hot->D0 transition
3498 * causes a reset (i.e., they advertise NoSoftRst-). This transition seems
3509 * Entire 1st generation (Light Ridge, Eagle Ridge, Light Peak) and part
3510 * of the 2nd generation (Cactus Ridge 4C up to revision 1, Port Ridge).
3514 if (pdev->is_hotplug_bridge && in quirk_thunderbolt_hotplug_msi()
3515 (pdev->device != PCI_DEVICE_ID_INTEL_CACTUS_RIDGE_4C || in quirk_thunderbolt_hotplug_msi()
3516 pdev->revision <= 1)) in quirk_thunderbolt_hotplug_msi()
3517 pdev->no_msi = 1; in quirk_thunderbolt_hotplug_msi()
3554 bridge = ACPI_HANDLE(&dev->dev); in quirk_apple_poweroff_thunderbolt()
3572 acpi_execute_simple_method(SXIO, NULL, 1); in quirk_apple_poweroff_thunderbolt()
3606 sibling = pci_get_slot(dev->bus, 0x0); in quirk_apple_wait_for_thunderbolt()
3609 if (!sibling || !sibling->subordinate) in quirk_apple_wait_for_thunderbolt()
3611 nhi = pci_get_slot(sibling->subordinate, 0x0); in quirk_apple_wait_for_thunderbolt()
3614 if (nhi->vendor != PCI_VENDOR_ID_INTEL in quirk_apple_wait_for_thunderbolt()
3615 || (nhi->device != PCI_DEVICE_ID_INTEL_LIGHT_RIDGE && in quirk_apple_wait_for_thunderbolt()
3616 nhi->device != PCI_DEVICE_ID_INTEL_CACTUS_RIDGE_4C && in quirk_apple_wait_for_thunderbolt()
3617 nhi->device != PCI_DEVICE_ID_INTEL_FALCON_RIDGE_2C_NHI && in quirk_apple_wait_for_thunderbolt()
3618 nhi->device != PCI_DEVICE_ID_INTEL_FALCON_RIDGE_4C_NHI) in quirk_apple_wait_for_thunderbolt()
3619 || nhi->class != PCI_CLASS_SYSTEM_OTHER << 8) in quirk_apple_wait_for_thunderbolt()
3622 device_pm_wait_for_dev(&dev->dev, &nhi->dev); in quirk_apple_wait_for_thunderbolt()
3642 * Following are device-specific reset methods which can be used to
3643 * reset a single function if other methods (e.g. FLR, PM D0->D3) are
3649 * http://www.intel.com/content/dam/doc/datasheet/82599-10-gbe-controller-datasheet.pdf in reset_intel_82599_sfp_virtfn()
3679 return -ENOMEM; in reset_ivb_igd()
3710 /* Device-specific reset method for Chelsio T4-based adapters */
3717 * If this isn't a Chelsio T4-based device, return -ENOTTY indicating in reset_chelsio_generic_dev()
3718 * that we have no device-specific reset method. in reset_chelsio_generic_dev()
3720 if ((dev->device & 0xf000) != 0x4000) in reset_chelsio_generic_dev()
3721 return -ENOTTY; in reset_chelsio_generic_dev()
3747 * T4 also suffers a Head-Of-Line blocking problem if MSI-X interrupts in reset_chelsio_generic_dev()
3748 * are disabled when an MSI-X interrupt message needs to be delivered. in reset_chelsio_generic_dev()
3749 * So we briefly re-enable MSI-X interrupts for the duration of the in reset_chelsio_generic_dev()
3751 * MSI-X state. in reset_chelsio_generic_dev()
3753 pci_read_config_word(dev, dev->msix_cap+PCI_MSIX_FLAGS, &msix_flags); in reset_chelsio_generic_dev()
3755 pci_write_config_word(dev, dev->msix_cap+PCI_MSIX_FLAGS, in reset_chelsio_generic_dev()
3778 * FLR where config space reads from the device return -1. We seem to be
3795 if (dev->class != PCI_CLASS_STORAGE_EXPRESS || in nvme_disable_and_flr()
3797 return -ENOTTY; in nvme_disable_and_flr()
3804 return -ENOTTY; in nvme_disable_and_flr()
3832 timeout = ((NVME_CAP_TIMEOUT(cap) + 1) * HZ / 2) + jiffies; in nvme_disable_and_flr()
3866 return -ENOTTY; in delay_250ms_after_flr()
3893 * These device-specific reset methods are here rather than in a driver
3901 for (i = pci_dev_reset_methods; i->reset; i++) { in pci_dev_specific_reset()
3902 if ((i->vendor == dev->vendor || in pci_dev_specific_reset()
3903 i->vendor == (u16)PCI_ANY_ID) && in pci_dev_specific_reset()
3904 (i->device == dev->device || in pci_dev_specific_reset()
3905 i->device == (u16)PCI_ANY_ID)) in pci_dev_specific_reset()
3906 return i->reset(dev, probe); in pci_dev_specific_reset()
3909 return -ENOTTY; in pci_dev_specific_reset()
3914 if (PCI_FUNC(dev->devfn) != 0) in quirk_dma_func0_alias()
3915 pci_add_dma_alias(dev, PCI_DEVFN(PCI_SLOT(dev->devfn), 0)); in quirk_dma_func0_alias()
3928 if (PCI_FUNC(dev->devfn) != 1) in quirk_dma_func1_alias()
3929 pci_add_dma_alias(dev, PCI_DEVFN(PCI_SLOT(dev->devfn), 1)); in quirk_dma_func1_alias()
3933 * Marvell 88SE9123 uses function 1 as the requester ID for DMA. In some
3934 * SKUs function 1 is present and is a legacy IDE controller, in other
3979 DECLARE_PCI_FIXUP_HEADER(0x1c28, /* Lite-On */
3989 * processor. To software, this appears as a PCIe-to-PCI/X bridge with a
4001 .driver_data = PCI_DEVFN(1, 0) },
4004 .driver_data = PCI_DEVFN(1, 0) },
4014 pci_add_dma_alias(dev, id->driver_data); in quirk_fixed_dma_alias()
4020 * A few PCIe-to-PCI bridges fail to expose a PCIe capability, resulting in
4025 * is for a non-root, non-PCIe bridge where the upstream device is PCIe and
4026 * is not a PCIe-to-PCI bridge, then @pdev is actually a PCIe-to-PCI bridge.
4030 if (!pci_is_root_bus(pdev->bus) && in quirk_use_pcie_bridge_dma_alias()
4031 pdev->hdr_type == PCI_HEADER_TYPE_BRIDGE && in quirk_use_pcie_bridge_dma_alias()
4032 !pci_is_pcie(pdev) && pci_is_pcie(pdev->bus->self) && in quirk_use_pcie_bridge_dma_alias()
4033 pci_pcie_type(pdev->bus->self) != PCI_EXP_TYPE_PCI_BRIDGE) in quirk_use_pcie_bridge_dma_alias()
4034 pdev->dev_flags |= PCI_DEV_FLAG_PCIE_BRIDGE_ALIAS; in quirk_use_pcie_bridge_dma_alias()
4051 * when IOMMU is enabled. Following devfns have to match RIT-LUT table
4064 * Intel Visual Compute Accelerator (VCA) is a family of PCIe add-in devices
4104 pdev->dev_flags |= PCI_DEV_FLAGS_BRIDGE_XLATE_ROOT; in quirk_bridge_cavm_thrx2_pcie_root()
4112 * Intersil/Techwell TW686[4589]-based video capture cards have an empty (zero)
4117 u32 class = pdev->class; in quirk_tw686x_class()
4120 pdev->class = (PCI_CLASS_MULTIMEDIA_OTHER << 8) | 0x01; in quirk_tw686x_class()
4121 pci_info(pdev, "TW686x PCI class overridden (%#08x -> %#08x)\n", in quirk_tw686x_class()
4122 class, pdev->class); in quirk_tw686x_class()
4140 dev->dev_flags |= PCI_DEV_FLAGS_NO_RELAXED_ORDERING; in quirk_relaxedordering_disable()
4211 * outlined in Section 2.4.1 (PCI Express(r) Base Specification Revision 3.0
4227 * If a non-compliant device generates a completion with a different
4229 * seems non-compliant based on sec 2.3.2), or it may handle it as a
4233 * If the non-compliant device generates completions with zero attributes
4255 dev_name(&pdev->dev)); in quirk_disable_root_port_attributes()
4273 if ((pdev->device & 0xff00) == 0x5400) in quirk_chelsio_T5_disable_root_port_attributes()
4280 * pci_acs_ctrl_enabled - compare desired ACS controls with those provided
4286 * Return 1 if all ACS controls in the @acs_ctrl_req bitmask are included
4293 return 1; in pci_acs_ctrl_enabled()
4298 * AMD has indicated that the devices below do not support peer-to-peer
4301 * peer-to-peer between functions can claim to support a subset of ACS.
4329 if (!dev->multifunction || !pci_is_root_bus(dev->bus)) in pci_quirk_amd_sb_acs()
4330 return -ENODEV; in pci_quirk_amd_sb_acs()
4335 return -ENODEV; in pci_quirk_amd_sb_acs()
4344 return -ENODEV; in pci_quirk_amd_sb_acs()
4353 switch (dev->device) { in pci_quirk_cavium_acs_match()
4370 return -ENOTTY; in pci_quirk_cavium_acs()
4387 * X-Gene Root Ports matching this quirk do not allow peer-to-peer in pci_quirk_xgene_acs()
4396 * Many Intel PCH Root Ports do provide ACS-like features to disable peer
4402 /* Ibexpeak PCH */
4405 /* Cougarpoint PCH */
4408 /* Pantherpoint PCH */
4411 /* Lynxpoint-H PCH */
4414 /* Lynxpoint-LP PCH */
4417 /* Wildcat PCH */
4420 /* Patsburg (X79) PCH */
4422 /* Wellsburg (X99) PCH */
4425 /* Lynx Point (9 series) PCH */
4433 /* Filter out a few obvious non-matches first */ in pci_quirk_intel_pch_acs_match()
4438 if (pci_quirk_intel_pch_acs_ids[i] == dev->device) in pci_quirk_intel_pch_acs_match()
4447 return -ENOTTY; in pci_quirk_intel_pch_acs()
4449 if (dev->dev_flags & PCI_DEV_FLAGS_ACS_ENABLED_QUIRK) in pci_quirk_intel_pch_acs()
4457 * These QCOM Root Ports do provide ACS-like features to disable peer
4461 * Hardware doesn't support peer-to-peer and each Root Port is a Root
4473 * Sunrise Point PCH root ports implement ACS, but unfortunately as shown in
4474 * the datasheet (Intel 100 Series Chipset Family PCH Datasheet, Vol. 2,
4475 * 12.1.46, 12.1.47)[1] this chipset uses dwords for the ACS capability and
4480 * found in volume 1 of the datasheet[2]:
4482 * 0xa110-0xa11f Sunrise Point-H PCI Express Root Port #{0-16}
4483 * 0xa167-0xa16a Sunrise Point-H PCI Express Root Port #{17-20}
4491 * Hub, Specification Update, January 2017, Revision 001, Document# 335194-001,
4495 * 0xa290-0xa29f PCI Express Root port #{0-16}
4496 * 0xa2e7-0xa2ee PCI Express Root port #{17-24}
4502 * August 2017, Revision 002, Document#: 334660-002)[6]
4505 * Quad Core Platforms, Vol 1 of 2, August 2017, Document#: 334658-003)[7]
4507 * 0x9d10-0x9d1b PCI Express Root port #{1-12}
4509 * [1] http://www.intel.com/content/www/us/en/chipsets/100-series-chipset-datasheet-vol-2.html
4510 * [2] http://www.intel.com/content/www/us/en/chipsets/100-series-chipset-datasheet-vol-1.html
4511 * [3] http://www.intel.com/content/www/us/en/chipsets/100-series-chipset-spec-update.html
4512 * [4] http://www.intel.com/content/www/us/en/chipsets/200-series-chipset-pch-spec-update.html
4513 * [5] http://www.intel.com/content/www/us/en/chipsets/200-series-chipset-pch-datasheet-vol-1.html
4514 …ww.intel.com/content/www/us/en/processors/core/7th-gen-core-family-mobile-u-y-processor-lines-i-o-
4515 …tel.com/content/www/us/en/processors/core/7th-gen-core-family-mobile-u-y-processor-lines-i-o-datas…
4522 switch (dev->device) { in pci_quirk_intel_spt_pch_acs_match()
4540 return -ENOTTY; in pci_quirk_intel_spt_pch_acs()
4544 return -ENOTTY; in pci_quirk_intel_spt_pch_acs()
4561 * in their ACS capability if they support peer-to-peer transactions. in pci_quirk_mf_endpoint_acs()
4563 * perform peer-to-peer with other functions, allowing us to mask out in pci_quirk_mf_endpoint_acs()
4575 * addresses. Refer to Intel VT-d specification, r3.1, sec 3.16, in pci_quirk_rciep_acs()
4576 * "Root-Complex Peer to Peer Considerations". in pci_quirk_rciep_acs()
4579 return -ENOTTY; in pci_quirk_rciep_acs()
4589 * they do not allow peer-to-peer transactions between Root Ports. in pci_quirk_brcm_acs()
4659 /* 82571 (Quads omitted due to non-ACS switch) */
4671 /* Intel PCH root ports */
4674 { 0x19a2, 0x710, pci_quirk_mf_endpoint_acs }, /* Emulex BE3-R */
4675 { 0x10df, 0x720, pci_quirk_mf_endpoint_acs }, /* Emulex Skyhawk-R */
4678 /* APM X-Gene */
4694 * pci_dev_specific_acs_enabled - check whether device provides ACS controls
4699 * -ENOTTY: No quirk applies to this device; we can't tell whether the
4711 * or control to indicate their support here. Multi-function express in pci_dev_specific_acs_enabled()
4712 * devices which do not allow internal peer-to-peer between functions, in pci_dev_specific_acs_enabled()
4715 for (i = pci_dev_acs_enabled; i->acs_enabled; i++) { in pci_dev_specific_acs_enabled()
4716 if ((i->vendor == dev->vendor || in pci_dev_specific_acs_enabled()
4717 i->vendor == (u16)PCI_ANY_ID) && in pci_dev_specific_acs_enabled()
4718 (i->device == dev->device || in pci_dev_specific_acs_enabled()
4719 i->device == (u16)PCI_ANY_ID)) { in pci_dev_specific_acs_enabled()
4720 ret = i->acs_enabled(dev, acs_flags); in pci_dev_specific_acs_enabled()
4726 return -ENOTTY; in pci_dev_specific_acs_enabled()
4734 #define INTEL_LPC_RCBA_ENABLE (1 << 0)
4738 /* Backbone Peer Non-Posted Disable */
4739 #define INTEL_BSPR_REG_BPNPD (1 << 8)
4741 #define INTEL_BSPR_REG_BPPD (1 << 9)
4754 * Read the RCBA register from the LPC (D31:F0). PCH root ports in pci_quirk_enable_intel_lpc_acs()
4758 pci_bus_read_config_dword(dev->bus, PCI_DEVFN(31, 0), in pci_quirk_enable_intel_lpc_acs()
4761 return -EINVAL; in pci_quirk_enable_intel_lpc_acs()
4766 return -ENOMEM; in pci_quirk_enable_intel_lpc_acs()
4770 * therefore read-only. If both posted and non-posted peer cycles are in pci_quirk_enable_intel_lpc_acs()
4793 #define INTEL_MPC_REG_IRBNCE (1 << 26)
4816 return -ENOTTY; in pci_quirk_enable_intel_pch_acs()
4819 pci_warn(dev, "Failed to enable Intel PCH ACS quirk\n"); in pci_quirk_enable_intel_pch_acs()
4825 dev->dev_flags |= PCI_DEV_FLAGS_ACS_ENABLED_QUIRK; in pci_quirk_enable_intel_pch_acs()
4827 pci_info(dev, "Intel PCH root port ACS workaround enabled\n"); in pci_quirk_enable_intel_pch_acs()
4838 return -ENOTTY; in pci_quirk_enable_intel_spt_pch_acs()
4842 return -ENOTTY; in pci_quirk_enable_intel_spt_pch_acs()
4854 pci_info(dev, "Intel SPT PCH root port ACS workaround enabled\n"); in pci_quirk_enable_intel_spt_pch_acs()
4865 return -ENOTTY; in pci_quirk_disable_intel_spt_pch_acs_redir()
4869 return -ENOTTY; in pci_quirk_disable_intel_spt_pch_acs_redir()
4878 pci_info(dev, "Intel SPT PCH root port workaround: disabled ACS redirect\n"); in pci_quirk_disable_intel_spt_pch_acs_redir()
4905 if ((p->vendor == dev->vendor || in pci_dev_specific_enable_acs()
4906 p->vendor == (u16)PCI_ANY_ID) && in pci_dev_specific_enable_acs()
4907 (p->device == dev->device || in pci_dev_specific_enable_acs()
4908 p->device == (u16)PCI_ANY_ID) && in pci_dev_specific_enable_acs()
4909 p->enable_acs) { in pci_dev_specific_enable_acs()
4910 ret = p->enable_acs(dev); in pci_dev_specific_enable_acs()
4916 return -ENOTTY; in pci_dev_specific_enable_acs()
4926 if ((p->vendor == dev->vendor || in pci_dev_specific_disable_acs_redir()
4927 p->vendor == (u16)PCI_ANY_ID) && in pci_dev_specific_disable_acs_redir()
4928 (p->device == dev->device || in pci_dev_specific_disable_acs_redir()
4929 p->device == (u16)PCI_ANY_ID) && in pci_dev_specific_disable_acs_redir()
4930 p->disable_acs_redir) { in pci_dev_specific_disable_acs_redir()
4931 ret = p->disable_acs_redir(dev); in pci_dev_specific_disable_acs_redir()
4937 return -ENOTTY; in pci_dev_specific_disable_acs_redir()
4955 if (pdev->pcie_cap || pci_find_capability(pdev, PCI_CAP_ID_EXP)) in quirk_intel_qat_vf_cap()
4967 pci_read_config_byte(pdev, pos + 1, &next_cap); in quirk_intel_qat_vf_cap()
4975 * Open-code some of set_pcie_port_type() and pci_cfg_space_size_ext() in quirk_intel_qat_vf_cap()
4988 pdev->pcie_cap = pos; in quirk_intel_qat_vf_cap()
4990 pdev->pcie_flags_reg = reg16; in quirk_intel_qat_vf_cap()
4992 pdev->pcie_mpss = reg16 & PCI_EXP_DEVCAP_PAYLOAD; in quirk_intel_qat_vf_cap()
4994 pdev->cfg_size = PCI_CFG_SPACE_EXP_SIZE; in quirk_intel_qat_vf_cap()
4997 pdev->cfg_size = PCI_CFG_SPACE_SIZE; in quirk_intel_qat_vf_cap()
5007 state->cap.cap_nr = PCI_CAP_ID_EXP; in quirk_intel_qat_vf_cap()
5008 state->cap.cap_extended = 0; in quirk_intel_qat_vf_cap()
5009 state->cap.size = size; in quirk_intel_qat_vf_cap()
5010 cap = (u16 *)&state->cap.data[0]; in quirk_intel_qat_vf_cap()
5018 hlist_add_head(&state->next, &pdev->saved_cap_space); in quirk_intel_qat_vf_cap()
5035 dev->dev_flags |= PCI_DEV_FLAGS_NO_FLR_RESET; in quirk_no_flr()
5045 struct pci_host_bridge *bridge = pci_find_host_bridge(pdev->bus); in quirk_no_ext_tags()
5050 bridge->no_ext_tags = 1; in quirk_no_ext_tags()
5053 pci_walk_bus(bridge->bus, pci_configure_extended_tags, NULL); in quirk_no_ext_tags()
5071 if ((pdev->device == 0x7312 && pdev->revision != 0x00) || in quirk_amd_harvest_no_ats()
5072 (pdev->device == 0x7340 && pdev->revision != 0xc5)) in quirk_amd_harvest_no_ats()
5076 pdev->ats_cap = 0; in quirk_amd_harvest_no_ats()
5093 pdev->no_msi = 1; in quirk_fsl_no_msi()
5098 * Although not allowed by the spec, some multi-function devices have
5111 if (PCI_FUNC(pdev->devfn) != consumer) in pci_create_device_link()
5114 supplier_pdev = pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus), in pci_create_device_link()
5115 pdev->bus->number, in pci_create_device_link()
5116 PCI_DEVFN(PCI_SLOT(pdev->devfn), supplier)); in pci_create_device_link()
5117 if (!supplier_pdev || (supplier_pdev->class >> class_shift) != class) { in pci_create_device_link()
5122 if (device_link_add(&pdev->dev, &supplier_pdev->dev, in pci_create_device_link()
5130 pm_runtime_allow(&pdev->dev); in pci_create_device_link()
5140 pci_create_device_link(hda, 1, 0, PCI_BASE_CLASS_DISPLAY, 16); in quirk_gpu_hda()
5161 * Create device link for NVIDIA GPU with integrated Type-C UCSI controller
5185 if (gpu->device < PCI_DEVICE_ID_NVIDIA_GEFORCE_320M) in quirk_nvidia_hda()
5196 /* The GPU becomes a multi-function device when the HDA is enabled */ in quirk_nvidia_hda()
5198 gpu->multifunction = !!(hdr_type & 0x80); in quirk_nvidia_hda()
5209 * Validation. Here's the text of IDT 89H32H8G3-YC, erratum #36:
5211 * Item #36 - Downstream port applies ACS Source Validation to Completions
5224 * write, so we do config reads until we receive a non-Config Request Retry
5235 struct pci_dev *bridge = bus->self; in pci_idt_bus_quirk()
5249 /* Write Vendor ID (read-only) so the endpoint latches its bus/dev */ in pci_idt_bus_quirk()
5253 /* Re-enable ACS_SV if it was previously enabled */ in pci_idt_bus_quirk()
5295 partition = ioread8(&mmio_ntb->partition_id); in quirk_switchtec_ntb_dma_alias()
5297 partition_map = ioread32(&mmio_ntb->ep_map); in quirk_switchtec_ntb_dma_alias()
5298 partition_map |= ((u64) ioread32(&mmio_ntb->ep_map + 4)) << 32; in quirk_switchtec_ntb_dma_alias()
5299 partition_map &= ~(1ULL << partition); in quirk_switchtec_ntb_dma_alias()
5306 if (!(partition_map & (1ULL << pp))) in quirk_switchtec_ntb_dma_alias()
5313 table_sz = ioread16(&mmio_peer_ctrl->req_id_table_size); in quirk_switchtec_ntb_dma_alias()
5330 rid_entry = ioread32(&mmio_peer_ctrl->req_id_table[te]); in quirk_switchtec_ntb_dma_alias()
5331 devfn = (rid_entry >> 1) & 0xFF; in quirk_switchtec_ntb_dma_alias()
5398 if (pdev->subsystem_vendor != PCI_VENDOR_ID_LENOVO || in quirk_reset_lenovo_thinkpad_p50_nvgpu()
5399 pdev->subsystem_device != 0x222e || in quirk_reset_lenovo_thinkpad_p50_nvgpu()
5400 !pdev->reset_fn) in quirk_reset_lenovo_thinkpad_p50_nvgpu()
5436 * Device [1b21:2142]
5442 dev->pme_support &= ~(PCI_PM_CAP_PME_D0 >> PCI_PM_CAP_PME_SHIFT); in pci_fixup_no_d0_pme()
5454 dev->pme_support = 0; in pci_fixup_no_pme()
5461 pdev->class = (PCI_CLASS_SYSTEM_OTHER << 8) | pdev->class; in apex_pci_fixup_class()