Skip to content

Commit 578cc98

Browse files
committed
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
2 parents 342d3c1 + 6bac338 commit 578cc98

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

Documentation/devicetree/bindings/pci/host-generic-pci.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,12 @@ properties:
110110
iommu-map-mask: true
111111
msi-parent: true
112112

113+
ats-supported:
114+
description:
115+
Indicates that a PCIe host controller supports ATS, and can handle Memory
116+
Requests with Address Type (AT).
117+
type: boolean
118+
113119
required:
114120
- compatible
115121
- reg

arch/arm64/boot/dts/arm/fvp-base-revc.dts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@
243243
iommu-map = <0x0 &smmu 0x0 0x10000>;
244244

245245
dma-coherent;
246+
ats-supported;
246247
};
247248

248249
smmu: iommu@2b400000 {

drivers/iommu/of_iommu.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,14 @@ static int of_iommu_configure_device(struct device_node *master_np,
100100
of_iommu_configure_dev(master_np, dev);
101101
}
102102

103+
static void of_pci_check_device_ats(struct device *dev, struct device_node *np)
104+
{
105+
struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev);
106+
107+
if (fwspec && of_property_read_bool(np, "ats-supported"))
108+
fwspec->flags |= IOMMU_FWSPEC_PCI_RC_ATS;
109+
}
110+
103111
/*
104112
* Returns:
105113
* 0 on success, an iommu was configured
@@ -136,6 +144,7 @@ int of_iommu_configure(struct device *dev, struct device_node *master_np,
136144
pci_request_acs();
137145
err = pci_for_each_dma_alias(to_pci_dev(dev),
138146
of_pci_iommu_init, &info);
147+
of_pci_check_device_ats(dev, master_np);
139148
} else {
140149
err = of_iommu_configure_device(master_np, dev, id);
141150
}

0 commit comments

Comments
 (0)