diff options
author | Will Deacon <will@kernel.org> | 2024-07-12 16:57:34 +0100 |
---|---|---|
committer | Will Deacon <will@kernel.org> | 2024-07-12 16:57:34 +0100 |
commit | 578cc98b66f5a5c607d03b4191a314ec51d19e5f (patch) | |
tree | f5ee9f63dd1b0560ab558661d5cf1dbeb4a17f27 /drivers/iommu/of_iommu.c | |
parent | 342d3c1cbf6f181e202c9984c5f9c68b808f4f61 (diff) | |
parent | 6bac3388889cec379ecb06e5557dd6f31a31544e (diff) |
Merge branch 'iommu/pci/ats' into iommu/next
* iommu/pci/ats:
arm64: dts: fvp: Enable PCIe ATS for Base RevC FVP
iommu/of: Support ats-supported device-tree property
dt-bindings: PCI: generic: Add ats-supported property
Diffstat (limited to 'drivers/iommu/of_iommu.c')
-rw-r--r-- | drivers/iommu/of_iommu.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/iommu/of_iommu.c b/drivers/iommu/of_iommu.c index 559c5db78edb..78d61da75257 100644 --- a/drivers/iommu/of_iommu.c +++ b/drivers/iommu/of_iommu.c @@ -100,6 +100,14 @@ static int of_iommu_configure_device(struct device_node *master_np, of_iommu_configure_dev(master_np, dev); } +static void of_pci_check_device_ats(struct device *dev, struct device_node *np) +{ + struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev); + + if (fwspec && of_property_read_bool(np, "ats-supported")) + fwspec->flags |= IOMMU_FWSPEC_PCI_RC_ATS; +} + /* * Returns: * 0 on success, an iommu was configured @@ -136,6 +144,7 @@ int of_iommu_configure(struct device *dev, struct device_node *master_np, pci_request_acs(); err = pci_for_each_dma_alias(to_pci_dev(dev), of_pci_iommu_init, &info); + of_pci_check_device_ats(dev, master_np); } else { err = of_iommu_configure_device(master_np, dev, id); } |