summaryrefslogtreecommitdiffstats
path: root/arch/arm/cpu
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2023-05-31 11:58:51 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2023-06-01 09:05:25 +0200
commit87ee0ac87d25e4add4953fb987cc180a3d502b85 (patch)
tree9e36fa2f32d359c74ef7718d81235a3040f1cf91 /arch/arm/cpu
parentd2f143d809ca9acd9df3f18d2bdd11a54625091c (diff)
downloadbarebox-87ee0ac87d25e4add4953fb987cc180a3d502b85.tar.gz
barebox-87ee0ac87d25e4add4953fb987cc180a3d502b85.tar.xz
ARM: mmu_32: fix setting up zero page when it is in SDRAM
We used to skip setting the zero page to faulting when SDRAM starts at 0x0. As bootm code now explicitly sets the zero page accessible before copying ATAGs there this should no longer be necessary, so unconditionally set the zero page to faulting during MMU startup. This also moves the zero page and vector table setup after the point the SDRAM has been mapped cachable, because otherwise the zero page and possibly the vector table mapping would be overwritten. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Diffstat (limited to 'arch/arm/cpu')
-rw-r--r--arch/arm/cpu/mmu_32.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/arch/arm/cpu/mmu_32.c b/arch/arm/cpu/mmu_32.c
index c4e5a3bb0a..14775768a3 100644
--- a/arch/arm/cpu/mmu_32.c
+++ b/arch/arm/cpu/mmu_32.c
@@ -461,19 +461,14 @@ static int set_vector_table(unsigned long adr)
static void create_zero_page(void)
{
- struct resource *zero_sdram;
+ /*
+ * In case the zero page is in SDRAM request it to prevent others
+ * from using it
+ */
+ request_sdram_region("zero page", 0x0, PAGE_SIZE);
- zero_sdram = request_sdram_region("zero page", 0x0, PAGE_SIZE);
- if (zero_sdram) {
- /*
- * Here we would need to set the second level page table
- * entry to faulting. This is not yet implemented.
- */
- pr_debug("zero page is in SDRAM area, currently not supported\n");
- } else {
- zero_page_faulting();
- pr_debug("Created zero page\n");
- }
+ zero_page_faulting();
+ pr_debug("Created zero page\n");
}
/*
@@ -530,8 +525,6 @@ void __mmu_init(bool mmu_on)
pr_debug("ttb: 0x%p\n", ttb);
- vectors_init();
-
/*
* Early mmu init will have mapped everything but the initial memory area
* (excluding final OPTEE_SIZE bytes) uncached. We have now discovered
@@ -552,6 +545,8 @@ void __mmu_init(bool mmu_on)
remap_range((void *)pos, bank->start + bank->size - pos, MAP_CACHED);
}
+
+ vectors_init();
}
/*