From 68d9da8026a7c78987038f6155ba59269e200910 Mon Sep 17 00:00:00 2001 From: Chintan Pandya Date: Thu, 13 Mar 2014 19:34:49 -0700 Subject: 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 --- drivers/iommu/msm_iommu-v1.c | 2 +- drivers/iommu/msm_iommu_dev-v1.c | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'drivers/iommu') 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); -- cgit v1.2.3