iommu/tegra: Implement DOMAIN_ATTR_GEOMETRY attribute
authorHiroshi DOYU <hdoyu@nvidia.com>
Thu, 26 Jan 2012 18:40:57 +0000 (19:40 +0100)
committerJoerg Roedel <joerg.roedel@amd.com>
Wed, 11 Jul 2012 10:25:57 +0000 (12:25 +0200)
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>
drivers/iommu/tegra-gart.c
drivers/iommu/tegra-smmu.c

index 0c0a37792218452fb9d48f7b84364604564669b0..c16e8fc8a4bd11677971140d6c2d20f48e6e3582 100644 (file)
@@ -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;
index ecd679043d7740e6883aae9cbee68da6321fedc1..96e73d56451a01aa34e76dd693443fdc810ece9d 100644 (file)
@@ -807,6 +807,11 @@ found:
        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;