diff options
author | Hiroshi DOYU <hdoyu@nvidia.com> | 2012-01-26 13:40:57 -0500 |
---|---|---|
committer | Joerg Roedel <joerg.roedel@amd.com> | 2012-07-11 06:25:57 -0400 |
commit | 23349902edec4d3d932bca1bb99261477139a36a (patch) | |
tree | 96eb09c80fd527125d8dd10f31a5c22f1966e57a /drivers/iommu | |
parent | 4be6a290b87af9136b482d5c22574f070ffdbdb8 (diff) |
iommu/tegra: Implement DOMAIN_ATTR_GEOMETRY attribute
Implement the attribute for the Tegra IOMMU drivers.
Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'drivers/iommu')
-rw-r--r-- | drivers/iommu/tegra-gart.c | 5 | ||||
-rw-r--r-- | drivers/iommu/tegra-smmu.c | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/drivers/iommu/tegra-gart.c b/drivers/iommu/tegra-gart.c index 0c0a37792218..c16e8fc8a4bd 100644 --- a/drivers/iommu/tegra-gart.c +++ b/drivers/iommu/tegra-gart.c | |||
@@ -165,6 +165,11 @@ static int gart_iommu_attach_dev(struct iommu_domain *domain, | |||
165 | return -EINVAL; | 165 | return -EINVAL; |
166 | domain->priv = gart; | 166 | domain->priv = gart; |
167 | 167 | ||
168 | domain->geometry.aperture_start = gart->iovmm_base; | ||
169 | domain->geometry.aperture_end = gart->iovmm_base + | ||
170 | gart->page_count * GART_PAGE_SIZE - 1; | ||
171 | domain->geometry.force_aperture = true; | ||
172 | |||
168 | client = devm_kzalloc(gart->dev, sizeof(*c), GFP_KERNEL); | 173 | client = devm_kzalloc(gart->dev, sizeof(*c), GFP_KERNEL); |
169 | if (!client) | 174 | if (!client) |
170 | return -ENOMEM; | 175 | return -ENOMEM; |
diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c index ecd679043d77..96e73d56451a 100644 --- a/drivers/iommu/tegra-smmu.c +++ b/drivers/iommu/tegra-smmu.c | |||
@@ -807,6 +807,11 @@ found: | |||
807 | spin_unlock_irqrestore(&as->lock, flags); | 807 | spin_unlock_irqrestore(&as->lock, flags); |
808 | domain->priv = as; | 808 | domain->priv = as; |
809 | 809 | ||
810 | domain->geometry.aperture_start = smmu->iovmm_base; | ||
811 | domain->geometry.aperture_end = smmu->iovmm_base + | ||
812 | smmu->page_count * SMMU_PAGE_SIZE - 1; | ||
813 | domain->geometry.force_aperture = true; | ||
814 | |||
810 | dev_dbg(smmu->dev, "smmu_as@%p\n", as); | 815 | dev_dbg(smmu->dev, "smmu_as@%p\n", as); |
811 | return 0; | 816 | return 0; |
812 | 817 | ||