diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2023-05-26 08:33:51 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2023-05-30 12:25:47 +0200 |
commit | 4b08ca92e572cd63b355131d6f522ef72db31f84 (patch) | |
tree | 620a082e89d9d4a9b50cdf321042943cbe0a1a1f | |
parent | ddc61b6fe4db95c460e5f283265b77d06ef272a2 (diff) | |
download | barebox-4b08ca92e572cd63b355131d6f522ef72db31f84.tar.gz barebox-4b08ca92e572cd63b355131d6f522ef72db31f84.tar.xz |
ARM: mmu64: request TTB region
ARM64 MMU code used to disable early MMU, reallocate TTB from malloc
area and then reenable it. This has recently been changed, so MMU is
left enabled like on ARM32, but unlike ARM32, the SDRAM region used in
PBL is not requested in barebox proper. Do that now.
Fixes: b53744ffe333 ("ARM: mmu64: Use two level pagetables in early code")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20230526063354.1145474-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | arch/arm/cpu/mmu_64.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/arm/cpu/mmu_64.c b/arch/arm/cpu/mmu_64.c index cdc4825422..1d5a5355c6 100644 --- a/arch/arm/cpu/mmu_64.c +++ b/arch/arm/cpu/mmu_64.c @@ -192,8 +192,20 @@ static void mmu_enable(void) */ void __mmu_init(bool mmu_on) { + uint64_t *ttb = get_ttb(); struct memory_bank *bank; + if (!request_sdram_region("ttb", (unsigned long)ttb, + ARM_EARLY_PAGETABLE_SIZE)) + /* + * This can mean that: + * - the early MMU code has put the ttb into a place + * which we don't have inside our available memory + * - Somebody else has occupied the ttb region which means + * the ttb will get corrupted. + */ + pr_crit("Can't request SDRAM region for ttb at %p\n", ttb); + for_each_memory_bank(bank) { struct resource *rsv; resource_size_t pos; |