diff options
author | Ali Saidi <alisaidi@amazon.com> | 2019-09-12 09:00:40 -0400 |
---|---|---|
committer | Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> | 2019-09-16 09:10:04 -0400 |
commit | 76e67e9e0f0f2debf9df192502a759bdd0cb4dab (patch) | |
tree | aaa717e752e5e8073187a95f17ce1ac24b418a21 | |
parent | 4a36a60c34f42f75e8b4f8cd24fcfade26111334 (diff) |
PCI: Add ACS quirk for Amazon Annapurna Labs root ports
The Amazon's Annapurna Labs root ports don't advertise an ACS
capability, but they don't allow peer-to-peer transactions and do
validate bus numbers through the SMMU. Additionally, it's not possible
for one RP to pass traffic to another RP.
Signed-off-by: Ali Saidi <alisaidi@amazon.com>
Signed-off-by: Jonathan Chocron <jonnyc@amazon.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
Reviewed-by: Andrew Murray <andrew.murray@arm.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
-rw-r--r-- | drivers/pci/quirks.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 208aacf39329..e96c03b4e494 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -4366,6 +4366,24 @@ static int pci_quirk_qcom_rp_acs(struct pci_dev *dev, u16 acs_flags) | |||
4366 | return ret; | 4366 | return ret; |
4367 | } | 4367 | } |
4368 | 4368 | ||
4369 | static int pci_quirk_al_acs(struct pci_dev *dev, u16 acs_flags) | ||
4370 | { | ||
4371 | if (pci_pcie_type(dev) != PCI_EXP_TYPE_ROOT_PORT) | ||
4372 | return -ENOTTY; | ||
4373 | |||
4374 | /* | ||
4375 | * Amazon's Annapurna Labs root ports don't include an ACS capability, | ||
4376 | * but do include ACS-like functionality. The hardware doesn't support | ||
4377 | * peer-to-peer transactions via the root port and each has a unique | ||
4378 | * segment number. | ||
4379 | * | ||
4380 | * Additionally, the root ports cannot send traffic to each other. | ||
4381 | */ | ||
4382 | acs_flags &= ~(PCI_ACS_SV | PCI_ACS_RR | PCI_ACS_CR | PCI_ACS_UF); | ||
4383 | |||
4384 | return acs_flags ? 0 : 1; | ||
4385 | } | ||
4386 | |||
4369 | /* | 4387 | /* |
4370 | * Sunrise Point PCH root ports implement ACS, but unfortunately as shown in | 4388 | * Sunrise Point PCH root ports implement ACS, but unfortunately as shown in |
4371 | * the datasheet (Intel 100 Series Chipset Family PCH Datasheet, Vol. 2, | 4389 | * the datasheet (Intel 100 Series Chipset Family PCH Datasheet, Vol. 2, |
@@ -4559,6 +4577,8 @@ static const struct pci_dev_acs_enabled { | |||
4559 | { PCI_VENDOR_ID_AMPERE, 0xE00A, pci_quirk_xgene_acs }, | 4577 | { PCI_VENDOR_ID_AMPERE, 0xE00A, pci_quirk_xgene_acs }, |
4560 | { PCI_VENDOR_ID_AMPERE, 0xE00B, pci_quirk_xgene_acs }, | 4578 | { PCI_VENDOR_ID_AMPERE, 0xE00B, pci_quirk_xgene_acs }, |
4561 | { PCI_VENDOR_ID_AMPERE, 0xE00C, pci_quirk_xgene_acs }, | 4579 | { PCI_VENDOR_ID_AMPERE, 0xE00C, pci_quirk_xgene_acs }, |
4580 | /* Amazon Annapurna Labs */ | ||
4581 | { PCI_VENDOR_ID_AMAZON_ANNAPURNA_LABS, 0x0031, pci_quirk_al_acs }, | ||
4562 | { 0 } | 4582 | { 0 } |
4563 | }; | 4583 | }; |
4564 | 4584 | ||