diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2019-11-25 15:27:43 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2019-11-27 12:34:06 +0100 |
commit | afdb72097b4f3bffcf88ede74bcdeb4b868dd9c7 (patch) | |
tree | 42e725db458995388720815dad7c2a1ec66ab2b4 /arch/arm/cpu/mmu_64.h | |
parent | 09177059593f77716ad6cd570b392ed0be9b30e4 (diff) | |
download | barebox-afdb72097b4f3bffcf88ede74bcdeb4b868dd9c7.tar.gz barebox-afdb72097b4f3bffcf88ede74bcdeb4b868dd9c7.tar.xz |
ARM64: Switch to 4 level page tables
3 level page tables only allow to resolve 39 bit addresses. Switch to 4
level page tables to add support for bigger physical address ranges.
This is needed for example on Layerscape SoCs where the PCI windows are
outside the 39bit range.
The early MMU support still uses 39bit addressing. We only use a single
level page table in early MMU support and with 48bit addresses we
wouldn't have enough granularity to map the SDRAM differently then the
rest of the address space.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/cpu/mmu_64.h')
-rw-r--r-- | arch/arm/cpu/mmu_64.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/arm/cpu/mmu_64.h b/arch/arm/cpu/mmu_64.h index e2e125686d..a2a5477569 100644 --- a/arch/arm/cpu/mmu_64.h +++ b/arch/arm/cpu/mmu_64.h @@ -75,7 +75,9 @@ static inline uint64_t level2mask(int level) { uint64_t mask = -EINVAL; - if (level == 1) + if (level == 0) + mask = L0_ADDR_MASK; + else if (level == 1) mask = L1_ADDR_MASK; else if (level == 2) mask = L2_ADDR_MASK; @@ -85,13 +87,12 @@ static inline uint64_t level2mask(int level) return mask; } -static inline uint64_t calc_tcr(int el) +static inline uint64_t calc_tcr(int el, int va_bits) { - u64 ips, va_bits; + u64 ips; u64 tcr; ips = 2; - va_bits = BITS_PER_VA; if (el == 1) tcr = (ips << 32) | TCR_EPD1_DISABLE; |