Skip to content

Commit

Permalink
iommu/tegra: Implement DOMAIN_ATTR_GEOMETRY attribute
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Hiroshi DOYU authored and Joerg Roedel committed Jul 11, 2012
1 parent 4be6a29 commit 2334990
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/iommu/tegra-gart.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@ static int gart_iommu_attach_dev(struct iommu_domain *domain,
return -EINVAL;
domain->priv = gart;

domain->geometry.aperture_start = gart->iovmm_base;
domain->geometry.aperture_end = gart->iovmm_base +
gart->page_count * GART_PAGE_SIZE - 1;
domain->geometry.force_aperture = true;

client = devm_kzalloc(gart->dev, sizeof(*c), GFP_KERNEL);
if (!client)
return -ENOMEM;
Expand Down
5 changes: 5 additions & 0 deletions drivers/iommu/tegra-smmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,11 @@ static int smmu_iommu_domain_init(struct iommu_domain *domain)
spin_unlock_irqrestore(&as->lock, flags);
domain->priv = as;

domain->geometry.aperture_start = smmu->iovmm_base;
domain->geometry.aperture_end = smmu->iovmm_base +
smmu->page_count * SMMU_PAGE_SIZE - 1;
domain->geometry.force_aperture = true;

dev_dbg(smmu->dev, "smmu_as@%p\n", as);
return 0;

Expand Down

0 comments on commit 2334990

Please sign in to comment.