From: Sascha Hauer <s.hauer@pengutronix.de>
To: BAREBOX <barebox@lists.infradead.org>
Subject: [PATCH 3/4] ARM: pbl: MMU: drop unnecessary barebox mapping
Date: Mon, 23 Feb 2026 09:34:08 +0100 [thread overview]
Message-ID: <20260223-arm-mmu-v1-3-707d45f6f6e1@pengutronix.de> (raw)
In-Reply-To: <20260223-arm-mmu-v1-0-707d45f6f6e1@pengutronix.de>
mmu_early_enable() sets up a mapping for the barebox proper regions.
This is no longer necessary as they are configured from the ELF binary
afterwards anyway, so drop it and remove the unnecessary arguments.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/cpu/mmu_32.c | 4 ++--
arch/arm/cpu/mmu_64.c | 7 +------
arch/arm/cpu/uncompress.c | 2 +-
arch/arm/include/asm/mmu.h | 2 +-
4 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/arch/arm/cpu/mmu_32.c b/arch/arm/cpu/mmu_32.c
index a5ac9a3ff9..cdd4d07826 100644
--- a/arch/arm/cpu/mmu_32.c
+++ b/arch/arm/cpu/mmu_32.c
@@ -606,10 +606,10 @@ void mmu_disable(void)
__mmu_cache_off();
}
-void mmu_early_enable(unsigned long membase, unsigned long memsize, unsigned long barebox_start)
+void mmu_early_enable(unsigned long membase, unsigned long memsize)
{
uint32_t *ttb = (uint32_t *)arm_mem_ttb(membase + memsize);
- unsigned long barebox_size, optee_start;
+ unsigned long optee_start;
pr_debug("enabling MMU, ttb @ 0x%p\n", ttb);
diff --git a/arch/arm/cpu/mmu_64.c b/arch/arm/cpu/mmu_64.c
index 69d4b89dd8..7f38473079 100644
--- a/arch/arm/cpu/mmu_64.c
+++ b/arch/arm/cpu/mmu_64.c
@@ -378,11 +378,10 @@ static void early_init_range(size_t total_level0_tables)
}
}
-void mmu_early_enable(unsigned long membase, unsigned long memsize, unsigned long barebox_start)
+void mmu_early_enable(unsigned long membase, unsigned long memsize)
{
int el;
u64 optee_membase;
- unsigned long barebox_size;
unsigned long ttb = arm_mem_ttb(membase + memsize);
if (get_cr() & CR_M)
@@ -408,10 +407,6 @@ void mmu_early_enable(unsigned long membase, unsigned long memsize, unsigned lon
/* Default location for OP-TEE: end of DRAM, leave OPTEE_SIZE space for it */
optee_membase = membase + memsize - OPTEE_SIZE;
- barebox_size = optee_membase - barebox_start;
-
- early_remap_range(barebox_start, barebox_size, MAP_CACHED_RWX);
-
/* OP-TEE might be at location specified in OP-TEE header */
optee_get_membase(&optee_membase);
diff --git a/arch/arm/cpu/uncompress.c b/arch/arm/cpu/uncompress.c
index dffdd2c812..38f7dbc113 100644
--- a/arch/arm/cpu/uncompress.c
+++ b/arch/arm/cpu/uncompress.c
@@ -85,7 +85,7 @@ void __noreturn barebox_pbl_start(unsigned long membase, unsigned long memsize,
print_pbl_mem_layout(membase, endmem, barebox_base);
#endif
if (IS_ENABLED(CONFIG_MMU))
- mmu_early_enable(membase, memsize, barebox_base);
+ mmu_early_enable(membase, memsize);
else if (IS_ENABLED(CONFIG_ARMV7R_MPU))
set_cr(get_cr() | CR_C);
diff --git a/arch/arm/include/asm/mmu.h b/arch/arm/include/asm/mmu.h
index bcaa984a40..ce050babab 100644
--- a/arch/arm/include/asm/mmu.h
+++ b/arch/arm/include/asm/mmu.h
@@ -69,6 +69,6 @@ void __dma_clean_range(unsigned long, unsigned long);
void __dma_flush_range(unsigned long, unsigned long);
void __dma_inv_range(unsigned long, unsigned long);
-void mmu_early_enable(unsigned long membase, unsigned long memsize, unsigned long barebox_base);
+void mmu_early_enable(unsigned long membase, unsigned long memsize);
#endif /* __ASM_MMU_H */
--
2.47.3
next prev parent reply other threads:[~2026-02-23 8:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-23 8:34 [PATCH 0/4] ARM: MMU: Some cleanup after recent changes Sascha Hauer
2026-02-23 8:34 ` [PATCH 1/4] mmu: add MAP_CACHED_RWX mapping type Sascha Hauer
2026-02-23 8:34 ` [PATCH 2/4] ARM: MMU: drop forced pagewise mapping Sascha Hauer
2026-02-23 8:34 ` Sascha Hauer [this message]
2026-02-23 8:34 ` [PATCH 4/4] ARM: pbl: MMU: Make it callable multiple times Sascha Hauer
2026-02-23 8:41 ` Ahmad Fatoum
2026-02-23 9:10 ` Sascha Hauer
2026-02-23 15:32 ` (subset) [PATCH 0/4] ARM: MMU: Some cleanup after recent changes Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260223-arm-mmu-v1-3-707d45f6f6e1@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox