aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iommu
diff options
context:
space:
mode:
authorWill Deacon <will.deacon@arm.com>2014-06-24 12:30:10 -0400
committerWill Deacon <will.deacon@arm.com>2014-07-03 10:50:22 -0400
commitd0948945638635487111d0851218080e81de5104 (patch)
treeff113ddc055520b1db1a8d1daeb7262838a56f47 /drivers/iommu
parenta9a1b0b53d8b7ca60abef0687eae927f286f07c2 (diff)
iommu/arm-smmu: caps: add IOMMU_CAP_INTR_REMAP capability
MSIs are just seen as bog standard memory writes by the ARM SMMU, so they can be translated (and isolated) in the same way. This patch adds the IOMMU_CAP_INTR_REMAP capability to the ARM SMMU driver and reworks our capabaility code so that we don't assume the caps are organised as bits in a bitmask (since this isn't the intention). Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/arm-smmu.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index 373b6e4d6e15..3ae50be49269 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -1606,13 +1606,17 @@ static phys_addr_t arm_smmu_iova_to_phys(struct iommu_domain *domain,
1606static int arm_smmu_domain_has_cap(struct iommu_domain *domain, 1606static int arm_smmu_domain_has_cap(struct iommu_domain *domain,
1607 unsigned long cap) 1607 unsigned long cap)
1608{ 1608{
1609 unsigned long caps = 0;
1610 struct arm_smmu_domain *smmu_domain = domain->priv; 1609 struct arm_smmu_domain *smmu_domain = domain->priv;
1610 u32 features = smmu_domain->root_cfg.smmu->features;
1611 1611
1612 if (smmu_domain->root_cfg.smmu->features & ARM_SMMU_FEAT_COHERENT_WALK) 1612 switch (cap) {
1613 caps |= IOMMU_CAP_CACHE_COHERENCY; 1613 case IOMMU_CAP_CACHE_COHERENCY:
1614 1614 return features & ARM_SMMU_FEAT_COHERENT_WALK;
1615 return !!(cap & caps); 1615 case IOMMU_CAP_INTR_REMAP:
1616 return 1; /* MSIs are just memory writes */
1617 default:
1618 return 0;
1619 }
1616} 1620}
1617 1621
1618static int __arm_smmu_get_pci_sid(struct pci_dev *pdev, u16 alias, void *data) 1622static int __arm_smmu_get_pci_sid(struct pci_dev *pdev, u16 alias, void *data)