Commit 578cc98b authored by Will Deacon's avatar Will Deacon
Browse files

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
parents 342d3c1c 6bac3388
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -110,6 +110,12 @@ properties:
  iommu-map-mask: true
  msi-parent: true

  ats-supported:
    description:
      Indicates that a PCIe host controller supports ATS, and can handle Memory
      Requests with Address Type (AT).
    type: boolean

required:
  - compatible
  - reg
+1 −0
Original line number Diff line number Diff line
@@ -243,6 +243,7 @@ pci: pci@40000000 {
		iommu-map = <0x0 &smmu 0x0 0x10000>;

		dma-coherent;
		ats-supported;
	};

	smmu: iommu@2b400000 {
+9 −0
Original line number Diff line number Diff line
@@ -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);
	}