summaryrefslogtreecommitdiff
path: root/drivers/iommu
diff options
context:
space:
mode:
authorChintan Pandya <cpandya@codeaurora.org>2014-03-13 19:34:49 -0700
committerChintan Pandya <cpandya@codeaurora.org>2014-04-01 17:54:58 +0530
commit68d9da8026a7c78987038f6155ba59269e200910 (patch)
treebcce03beaa6f781026cbddc851e3e7b4b2970a5c /drivers/iommu
parent27a707958c041138defccfdb6adee2641f92b4b0 (diff)
iommu: msm: Support different implementations
Within SMMUv2, different implementation have different Software interface. Support IOMMU driver to be compatible with MMU-500. Change-Id: I7d18c5aad82acafa317fe95b021e29b992a082be Signed-off-by: Chintan Pandya <cpandya@codeaurora.org>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/msm_iommu-v1.c2
-rw-r--r--drivers/iommu/msm_iommu_dev-v1.c11
2 files changed, 7 insertions, 6 deletions
diff --git a/drivers/iommu/msm_iommu-v1.c b/drivers/iommu/msm_iommu-v1.c
index 81fb615feead..9691770ee38d 100644
--- a/drivers/iommu/msm_iommu-v1.c
+++ b/drivers/iommu/msm_iommu-v1.c
@@ -1058,7 +1058,7 @@ static phys_addr_t msm_iommu_iova_to_phys(struct iommu_domain *domain,
struct msm_iommu_ctx_drvdata, attached_elm);
iommu_drvdata = dev_get_drvdata(ctx_drvdata->pdev->dev.parent);
- if (iommu_drvdata->no_atos_support) {
+ if (iommu_drvdata->model == MMU_500) {
ret = msm_iommu_iova_to_phys_soft(domain, va);
mutex_unlock(&msm_iommu_lock);
return ret;
diff --git a/drivers/iommu/msm_iommu_dev-v1.c b/drivers/iommu/msm_iommu_dev-v1.c
index 365eaaa3daea..7d76c2be5f48 100644
--- a/drivers/iommu/msm_iommu_dev-v1.c
+++ b/drivers/iommu/msm_iommu_dev-v1.c
@@ -341,6 +341,9 @@ static int msm_iommu_probe(struct platform_device *pdev)
drvdata->glb_base = drvdata->base;
+ if (of_device_is_compatible(pdev->dev.of_node, "qcom,msm-mmu-500"))
+ drvdata->model = MMU_500;
+
if (of_get_property(pdev->dev.of_node, "vdd-supply", NULL)) {
drvdata->gdsc = devm_regulator_get(&pdev->dev, "vdd");
@@ -379,9 +382,6 @@ static int msm_iommu_probe(struct platform_device *pdev)
return PTR_ERR(drvdata->aiclk);
}
- drvdata->no_atos_support = of_property_read_bool(pdev->dev.of_node,
- "qcom,no-atos-support");
-
if (!of_property_read_u32(pdev->dev.of_node,
"qcom,cb-base-offset",
&temp))
@@ -408,8 +408,9 @@ static int msm_iommu_probe(struct platform_device *pdev)
if (ret)
return ret;
- dev_info(&pdev->dev, "device %s mapped at %p, with %d ctx banks\n",
- drvdata->name, drvdata->base, drvdata->ncb);
+ dev_info(&pdev->dev,
+ "device %s (model: %d) mapped at %p, with %d ctx banks\n",
+ drvdata->name, drvdata->model, drvdata->base, drvdata->ncb);
platform_set_drvdata(pdev, drvdata);