HACK: iommu/arm-smmu: fix swgroup configuration
Hiroshi Doyu [Fri, 7 Nov 2014 04:56:19 +0000 (06:56 +0200)]
The param "ASID" is numerically equal to the stream-ID. The cgid (for
nvhost this value is 22) has a one-to-one mapping to swid (for nvhost
cgidtoswid[22] = 6). Based on this value  the address of in
MS_SMMU_<swgroup>_ASID_0 is determined. (which is 0x22c1_0250). This
contains the value of the stream-ID to be passed to the SMMU Fastmodel.

We use swgroupID == streamID currently.

Change-Id: I5447b9b4fc76e872fcd43a7a52eba0c508503d83
Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
Reviewed-on: http://git-master/r/595780
Reviewed-by: Sri Krishna Chowdary <schowdary@nvidia.com>
GVS: Gerrit_Virtual_Submit

drivers/iommu/arm-smmu.c

index 43feb1d..a79ac71 100644 (file)
@@ -1251,10 +1251,11 @@ static void tegra_smmu_conf_swgroup(struct arm_smmu_device *smmu, int swgid,
        u32 val;
 
        offs = tegra_smmu_of_offset(swgid);
-       val = BIT(31) | cbndx;
+       val = BIT(31) | swgid; /* swgid == streamID */
        __writel(val, mc_base + offs);
 
-       pr_info("%s() ASID_0=0x%zx val=0x%08x\n", __func__, offs, val);
+       pr_info("%s() ASID_0=0x%zx val=0x%08x streamID=%d cbndx=%d\n",
+               __func__, offs, val, swgid, cbndx);
 }
 
 static int arm_smmu_domain_add_master(struct arm_smmu_domain *smmu_domain,