• Tomasz Nowicki's avatar
    PCI: Add MCFG quirks for Cavium ThunderX pass2.x host controller · 44f22bd9
    Tomasz Nowicki authored
    ThunderX PCIe controller to off-chip devices (so-called PEM) is not fully
    compliant with ECAM standard. It uses non-standard configuration space
    accessors (see thunder_pem_ecam_ops) and custom configuration space
    granulation (see bus_shift = 24). In order to access configuration space
    and probe PEM as ACPI-based PCI host controller we need to add MCFG quirk
    infrastructure. This involves:
    1. A new thunder_pem_acpi_init() init function to locate PEM-specific
       register ranges using ACPI.
    2. Export PEM thunder_pem_ecam_ops structure so it is visible to MCFG quirk
       code.
    3. New quirk entries for each PEM segment. Each contains platform IDs,
       mentioned thunder_pem_ecam_ops and CFG resources.
    
    Quirk is considered for ThunderX silicon pass2.x only which is identified
    via MCFG revision 1.
    
    ThunderX pass 2.x requires the following accessors:
    
      NUMA Node 0 PCI segments  0- 3: pci_generic_ecam_ops (ECAM-compliant)
      NUMA Node 0 PCI segments  4- 9: thunder_pem_ecam_ops (MCFG quirk)
      NUMA Node 1 PCI segments 10-13: pci_generic_ecam_ops (ECAM-compliant)
      NUMA Node 1 PCI segments 14-19: thunder_pem_ecam_ops (MCFG quirk)
    
    [bhelgaas: adapt to use acpi_get_rc_resources(), update Makefile/ifdefs so
    quirk doesn't depend on CONFIG_PCI_HOST_THUNDER_PEM]
    Signed-off-by: default avatarTomasz Nowicki <tn@semihalf.com>
    Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
    44f22bd9
pci-thunder-pem.c 10.4 KB