diff options
author | Hiroshi DOYU <hdoyu@nvidia.com> | 2012-07-13 19:42:22 +0300 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2012-08-01 17:35:08 -0700 |
commit | b147a3da3e867fc4279fec7fa59655f1eebbe6d6 (patch) | |
tree | c72d6f26efbe17646cadd47777c36885e5f96e57 /drivers/iommu | |
parent | b246a36660e1797dac05accd7565f5a9a9f8ecf9 (diff) |
iommu/tegra: smmu: Use tegra_smmu_window() to get iova range
*HACK*
To adjust legacy name internally to support IOMMU and IOVMM at once.
Change-Id: I765530328e6dda4b3a6fad05e2e55327e29ba5ca
Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com>
Reviewed-on: http://git-master/r/118707
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>
Diffstat (limited to 'drivers/iommu')
-rw-r--r-- | drivers/iommu/tegra-smmu.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c index 622d7d0774a8..915763c748f1 100644 --- a/drivers/iommu/tegra-smmu.c +++ b/drivers/iommu/tegra-smmu.c @@ -1080,7 +1080,8 @@ static int tegra_smmu_resume(struct device *dev) static int tegra_smmu_probe(struct platform_device *pdev) { struct smmu_device *smmu; - struct resource *regs, *regs2, *window; + struct resource *regs, *regs2; + struct tegra_smmu_window *window; struct device *dev = &pdev->dev; int i, err = 0; @@ -1091,7 +1092,7 @@ static int tegra_smmu_probe(struct platform_device *pdev) regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); regs2 = platform_get_resource(pdev, IORESOURCE_MEM, 1); - window = platform_get_resource(pdev, IORESOURCE_MEM, 2); + window = tegra_smmu_window(0); if (!regs || !regs2 || !window) { dev_err(dev, "No SMMU resources\n"); return -ENODEV; @@ -1106,7 +1107,7 @@ static int tegra_smmu_probe(struct platform_device *pdev) smmu->dev = dev; smmu->num_as = SMMU_NUM_ASIDS; smmu->iovmm_base = (unsigned long)window->start; - smmu->page_count = resource_size(window) >> SMMU_PAGE_SHIFT; + smmu->page_count = (window->end + 1 - window->start) >> SMMU_PAGE_SHIFT; smmu->regs = devm_ioremap(dev, regs->start, resource_size(regs)); smmu->regs_ahbarb = devm_ioremap(dev, regs2->start, resource_size(regs2)); |