Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
drivers/pci: Add ecam quirk for Ampere Altra SOC.
Browse files Browse the repository at this point in the history
Ampere Altra SOC only supports 32bit PCI ecam read. Therefore,
add an ecam quirk for the platform.

Signed-off-by: Tuan Phan <[email protected]>
  • Loading branch information
tphan-ampere committed Jun 30, 2020
1 parent 283833f commit 0d8dd94
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
20 changes: 20 additions & 0 deletions drivers/acpi/pci_mcfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,26 @@ static struct mcfg_fixup mcfg_quirks[] = {
{"BRCM ", "BRCM-SRX", rev, seg, MCFG_BUS_ANY, \
&iproc_pcie_paxcv2_ecam_ops }
BCM_ECAM_MCFG(1, 8),

#define AMPERE_ECAM32(rev, seg) \
{ "Ampere", "Altra ", rev, seg, MCFG_BUS_ANY, &pci_32b_read_ops }

AMPERE_ECAM32(1, 0),
AMPERE_ECAM32(1, 1),
AMPERE_ECAM32(1, 2),
AMPERE_ECAM32(1, 3),
AMPERE_ECAM32(1, 4),
AMPERE_ECAM32(1, 5),
AMPERE_ECAM32(1, 6),
AMPERE_ECAM32(1, 7),
AMPERE_ECAM32(1, 8),
AMPERE_ECAM32(1, 9),
AMPERE_ECAM32(1, 10),
AMPERE_ECAM32(1, 11),
AMPERE_ECAM32(1, 12),
AMPERE_ECAM32(1, 13),
AMPERE_ECAM32(1, 14),
AMPERE_ECAM32(1, 15),
};

static char mcfg_oem_id[ACPI_OEM_ID_SIZE];
Expand Down
9 changes: 9 additions & 0 deletions drivers/pci/ecam.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,13 @@ struct pci_ecam_ops pci_32b_ops = {
.write = pci_generic_config_write32,
}
};

struct pci_ecam_ops pci_32b_read_ops = {
.bus_shift = 20,
.pci_ops = {
.map_bus = pci_ecam_map_bus,
.read = pci_generic_config_read32,
.write = pci_generic_config_write,
}
};
#endif
1 change: 1 addition & 0 deletions include/linux/pci-ecam.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ extern struct pci_ecam_ops pci_thunder_ecam_ops; /* Cavium ThunderX 1.x */
extern struct pci_ecam_ops xgene_v1_pcie_ecam_ops; /* APM X-Gene PCIe v1 */
extern struct pci_ecam_ops xgene_v2_pcie_ecam_ops; /* APM X-Gene PCIe v2.x */
extern struct pci_ecam_ops iproc_pcie_paxcv2_ecam_ops; /* iProc PAXCv2 */
extern struct pci_ecam_ops pci_32b_read_ops; /* 32-bit read accesses only */
#endif

#ifdef CONFIG_PCI_HOST_COMMON
Expand Down

0 comments on commit 0d8dd94

Please sign in to comment.