diff options
author | Robin Murphy <robin.murphy@arm.com> | 2018-03-26 08:35:15 -0400 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2018-03-27 09:12:06 -0400 |
commit | dcd189e6d2eca4663da6120463fbff0995bc06eb (patch) | |
tree | 8f73c5208f0ea272a81325421de7c8582c02d40e | |
parent | 6619c9138533597dc0ff52155d263f14e8578ca2 (diff) |
iommu/arm-smmu-v3: Support 52-bit virtual address
Stage 1 input addresses are effectively 64-bit in SMMUv3 anyway, so
really all that's involved is letting io-pgtable know the appropriate
upper bound for T0SZ.
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
-rw-r--r-- | drivers/iommu/arm-smmu-v3.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c index b73a5950eb65..1d647104bccc 100644 --- a/drivers/iommu/arm-smmu-v3.c +++ b/drivers/iommu/arm-smmu-v3.c | |||
@@ -92,6 +92,8 @@ | |||
92 | #define IDR5_OAS_44_BIT 4 | 92 | #define IDR5_OAS_44_BIT 4 |
93 | #define IDR5_OAS_48_BIT 5 | 93 | #define IDR5_OAS_48_BIT 5 |
94 | #define IDR5_OAS_52_BIT 6 | 94 | #define IDR5_OAS_52_BIT 6 |
95 | #define IDR5_VAX GENMASK(11, 10) | ||
96 | #define IDR5_VAX_52_BIT 1 | ||
95 | 97 | ||
96 | #define ARM_SMMU_CR0 0x20 | 98 | #define ARM_SMMU_CR0 0x20 |
97 | #define CR0_CMDQEN (1 << 3) | 99 | #define CR0_CMDQEN (1 << 3) |
@@ -551,6 +553,7 @@ struct arm_smmu_device { | |||
551 | #define ARM_SMMU_FEAT_STALLS (1 << 11) | 553 | #define ARM_SMMU_FEAT_STALLS (1 << 11) |
552 | #define ARM_SMMU_FEAT_HYP (1 << 12) | 554 | #define ARM_SMMU_FEAT_HYP (1 << 12) |
553 | #define ARM_SMMU_FEAT_STALL_FORCE (1 << 13) | 555 | #define ARM_SMMU_FEAT_STALL_FORCE (1 << 13) |
556 | #define ARM_SMMU_FEAT_VAX (1 << 14) | ||
554 | u32 features; | 557 | u32 features; |
555 | 558 | ||
556 | #define ARM_SMMU_OPT_SKIP_PREFETCH (1 << 0) | 559 | #define ARM_SMMU_OPT_SKIP_PREFETCH (1 << 0) |
@@ -1591,7 +1594,8 @@ static int arm_smmu_domain_finalise(struct iommu_domain *domain) | |||
1591 | 1594 | ||
1592 | switch (smmu_domain->stage) { | 1595 | switch (smmu_domain->stage) { |
1593 | case ARM_SMMU_DOMAIN_S1: | 1596 | case ARM_SMMU_DOMAIN_S1: |
1594 | ias = VA_BITS; | 1597 | ias = (smmu->features & ARM_SMMU_FEAT_VAX) ? 52 : 48; |
1598 | ias = min_t(unsigned long, ias, VA_BITS); | ||
1595 | oas = smmu->ias; | 1599 | oas = smmu->ias; |
1596 | fmt = ARM_64_LPAE_S1; | 1600 | fmt = ARM_64_LPAE_S1; |
1597 | finalise_stage_fn = arm_smmu_domain_finalise_s1; | 1601 | finalise_stage_fn = arm_smmu_domain_finalise_s1; |
@@ -2645,6 +2649,10 @@ static int arm_smmu_device_hw_probe(struct arm_smmu_device *smmu) | |||
2645 | if (reg & IDR5_GRAN4K) | 2649 | if (reg & IDR5_GRAN4K) |
2646 | smmu->pgsize_bitmap |= SZ_4K | SZ_2M | SZ_1G; | 2650 | smmu->pgsize_bitmap |= SZ_4K | SZ_2M | SZ_1G; |
2647 | 2651 | ||
2652 | /* Input address size */ | ||
2653 | if (FIELD_GET(IDR5_VAX, reg) == IDR5_VAX_52_BIT) | ||
2654 | smmu->features |= ARM_SMMU_FEAT_VAX; | ||
2655 | |||
2648 | /* Output address size */ | 2656 | /* Output address size */ |
2649 | switch (FIELD_GET(IDR5_OAS, reg)) { | 2657 | switch (FIELD_GET(IDR5_OAS, reg)) { |
2650 | case IDR5_OAS_32_BIT: | 2658 | case IDR5_OAS_32_BIT: |