iommu/arm-smmu: adjust SMMU AMAP size calculated
Hiroshi Doyu [Mon, 10 Nov 2014 09:41:07 +0000 (11:41 +0200)]
In ARM,SMMU SMMU, register range size(AMAP) is used to calculate some
internal base addresses so that it's adjusted by calculated one(correct
one).

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

drivers/iommu/arm-smmu.c

index b77a81d..5f8e027 100644 (file)
@@ -2141,10 +2141,12 @@ static int arm_smmu_device_cfg_probe(struct arm_smmu_device *smmu)
        size = 1 <<
                (((id >> ID1_NUMPAGENDXB_SHIFT) & ID1_NUMPAGENDXB_MASK) + 1);
        size *= 2 << smmu->pgshift;
-       if (smmu->size != size)
+       if (smmu->size != size) {
                dev_info(smmu->dev,
                        "SMMU address space size (0x%lx) differs from mapped region size (0x%lx)!\n",
                        size, smmu->size);
+               smmu->size = size;
+       }
 
        smmu->num_s2_context_banks = (id >> ID1_NUMS2CB_SHIFT) &
                                      ID1_NUMS2CB_MASK;