aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iommu/arm-smmu.c
diff options
context:
space:
mode:
authorWill Deacon <will.deacon@arm.com>2014-06-24 13:26:26 -0400
committerWill Deacon <will.deacon@arm.com>2014-07-02 06:55:49 -0400
commita65217a4bcdb654e04fcc42b302d8a15708e14ce (patch)
tree1affd8e038912b297f888f0ed84631a758968816 /drivers/iommu/arm-smmu.c
parent7171511eaec5bf23fb06078f59784a3a0626b38f (diff)
iommu/arm-smmu: fix calculation of TCR.T0SZ
T0SZ controls the input address range for TTBR0, so use the input address range rather than the output address range for the calculation. For stage-2, this means using the output size of stage-1. Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'drivers/iommu/arm-smmu.c')
-rw-r--r--drivers/iommu/arm-smmu.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index 1599354e974d..81e8ec290756 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -800,6 +800,8 @@ static void arm_smmu_init_context_bank(struct arm_smmu_domain *smmu_domain)
800 reg = TTBCR_TG0_64K; 800 reg = TTBCR_TG0_64K;
801 801
802 if (!stage1) { 802 if (!stage1) {
803 reg |= (64 - smmu->s1_output_size) << TTBCR_T0SZ_SHIFT;
804
803 switch (smmu->s2_output_size) { 805 switch (smmu->s2_output_size) {
804 case 32: 806 case 32:
805 reg |= (TTBCR2_ADDR_32 << TTBCR_PASIZE_SHIFT); 807 reg |= (TTBCR2_ADDR_32 << TTBCR_PASIZE_SHIFT);
@@ -821,7 +823,7 @@ static void arm_smmu_init_context_bank(struct arm_smmu_domain *smmu_domain)
821 break; 823 break;
822 } 824 }
823 } else { 825 } else {
824 reg |= (64 - smmu->s1_output_size) << TTBCR_T0SZ_SHIFT; 826 reg |= (64 - smmu->input_size) << TTBCR_T0SZ_SHIFT;
825 } 827 }
826 } else { 828 } else {
827 reg = 0; 829 reg = 0;