aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/include
diff options
context:
space:
mode:
authorCyril Chemparathy <cyril@ti.com>2012-07-21 19:47:52 -0400
committerWill Deacon <will.deacon@arm.com>2013-05-30 11:02:11 -0400
commita7fbc0d62a4d46e642af889e7288fede5078bc46 (patch)
tree5ca6452ed4dd9f9e2b89441d829d5cd3fad4ed80 /arch/arm/include
parent1fc84ae84b5153e32a4b6ace507f9663e10b0cb2 (diff)
ARM: LPAE: factor out T1SZ and TTBR1 computations
This patch moves the TTBR1 offset calculation and the T1SZ calculation out of the TTB setup assembly code. This should not affect functionality in any way, but improves code readability as well as readability of subsequent patches in this series. Signed-off-by: Cyril Chemparathy <cyril@ti.com> Signed-off-by: Vitaly Andrianov <vitalya@ti.com> Acked-by: Nicolas Pitre <nico@linaro.org> Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Tested-by: Subash Patel <subash.rp@samsung.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm/include')
-rw-r--r--arch/arm/include/asm/pgtable-3level-hwdef.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/arm/include/asm/pgtable-3level-hwdef.h b/arch/arm/include/asm/pgtable-3level-hwdef.h
index 18f5cef82ad5..c6c6e6df22f3 100644
--- a/arch/arm/include/asm/pgtable-3level-hwdef.h
+++ b/arch/arm/include/asm/pgtable-3level-hwdef.h
@@ -79,4 +79,24 @@
79#define PHYS_MASK_SHIFT (40) 79#define PHYS_MASK_SHIFT (40)
80#define PHYS_MASK ((1ULL << PHYS_MASK_SHIFT) - 1) 80#define PHYS_MASK ((1ULL << PHYS_MASK_SHIFT) - 1)
81 81
82/*
83 * TTBR0/TTBR1 split (PAGE_OFFSET):
84 * 0x40000000: T0SZ = 2, T1SZ = 0 (not used)
85 * 0x80000000: T0SZ = 0, T1SZ = 1
86 * 0xc0000000: T0SZ = 0, T1SZ = 2
87 *
88 * Only use this feature if PHYS_OFFSET <= PAGE_OFFSET, otherwise
89 * booting secondary CPUs would end up using TTBR1 for the identity
90 * mapping set up in TTBR0.
91 */
92#if defined CONFIG_VMSPLIT_2G
93#define TTBR1_OFFSET 16 /* skip two L1 entries */
94#elif defined CONFIG_VMSPLIT_3G
95#define TTBR1_OFFSET (4096 * (1 + 3)) /* only L2, skip pgd + 3*pmd */
96#else
97#define TTBR1_OFFSET 0
98#endif
99
100#define TTBR1_SIZE (((PAGE_OFFSET >> 30) - 1) << 16)
101
82#endif 102#endif