summaryrefslogtreecommitdiff
path: root/drivers/iommu
diff options
context:
space:
mode:
authorHiroshi Doyu <hdoyu@nvidia.com>2013-09-02 15:50:51 +0300
committerDan Willemsen <dwillemsen@nvidia.com>2013-09-27 12:51:52 -0700
commit7c26a79def7c8e8f0761290dd5e2b468b6dccc98 (patch)
tree8d2fde1c793b6b631e66e94b29d06e989330222f /drivers/iommu
parent41797576db9434854211956abe9cc56ad79f2a9c (diff)
iommu/tegra: smmu: Add debug_dma_platformdata()
For DMA_API_DEBUG to show platform specific data. Bug 1173494 Change-Id: I421a0bb3675c7bc6906140f7c1ef867f15e80164 Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com> Reviewed-on: http://git-master/r/269147 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/tegra-smmu.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c
index 9eb4571a9275..a674f6473c17 100644
--- a/drivers/iommu/tegra-smmu.c
+++ b/drivers/iommu/tegra-smmu.c
@@ -1343,6 +1343,24 @@ static int smmu_iommu_domain_has_cap(struct iommu_domain *domain,
return 0;
}
+#if defined(CONFIG_DMA_API_DEBUG) || defined(CONFIG_FTRACE)
+char *debug_dma_platformdata(struct device *dev)
+{
+ static char buf[21];
+ struct dma_iommu_mapping *mapping = to_dma_iommu_mapping(dev);
+ struct smmu_as *as;
+ int asid = -1;
+
+ if (mapping) {
+ as = mapping->domain->priv;
+ asid = as->asid;
+ }
+
+ sprintf(buf, "%d", asid);
+ return buf;
+}
+#endif
+
static int smmu_iommu_attach_dev(struct iommu_domain *domain,
struct device *dev)
{