Skip to content
  • Tomasz Nowicki's avatar
    PCI/ACPI: Check for platform-specific MCFG quirks · 5b69b85b
    Tomasz Nowicki authored
    
    
    The PCIe spec (r3.0, sec 7.2.2) specifies an "Enhanced Configuration Access
    Mechanism" (ECAM) for memory-mapped access to configuration space.  ECAM is
    required for PCIe systems unless there's a standard firmware interface for
    config access.
    
    In the absence of a firmware interface, we use pci_generic_ecam_ops, and on
    ACPI systems, we discover the ECAM space via the MCFG table and/or the _CBA
    method.
    
    Unfortunately some systems provide MCFG but don't implement ECAM according
    to spec, so we need a mechanism for quirks to make those systems work.
    
    Add an MCFG quirk mechanism to override the config accessor functions
    and/or the memory-mapped address space.
    
    A quirk is selected if it matches all of the following:
    
      - OEM ID
      - OEM Table ID
      - OEM Revision
      - PCI segment (from _SEG)
      - PCI bus number range (from _CRS, wildcard allowed)
    
    If the quirk specifies config accessor functions or a memory-mapped address
    range, these override the defaults.
    
    [bhelgaas: changelog, reorder quirk matching, fix oem_revision typo per
    Duc, add under #ifdef CONFIG_PCI_QUIRKS]
    Signed-off-by: default avatarTomasz Nowicki <tn@semihalf.com>
    Signed-off-by: default avatarDongdong Liu <liudongdong3@huawei.com>
    Signed-off-by: default avatarChristopher Covington <cov@codeaurora.org>
    Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
    5b69b85b