OSDN Git Service

PCI: Add MCFG quirks for Cavium ThunderX pass2.x host controller
authorTomasz Nowicki <tn@semihalf.com>
Thu, 1 Dec 2016 06:07:56 +0000 (00:07 -0600)
committerBjorn Helgaas <helgaas@kernel.org>
Tue, 6 Dec 2016 19:45:49 +0000 (13:45 -0600)
commit44f22bd91e88f9a1203a6e564a237e593f5f2f74
treec4c5e1e3305986af0fc32be51e804be5e1f24d00
parent0d414268fb8d0844030f87027e904f69d96706be
PCI: Add MCFG quirks for Cavium ThunderX pass2.x host controller

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: Tomasz Nowicki <tn@semihalf.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/acpi/pci_mcfg.c
drivers/pci/host/Kconfig
drivers/pci/host/Makefile
drivers/pci/host/pci-thunder-pem.c
include/linux/pci-ecam.h