summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2023-05-10 12:08:29 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2023-05-22 12:38:17 +0200
commit8281881ce28770b44823f06263a133b2847201a3 (patch)
tree4cf71ca6f5e21c258c0d301b525555dc072ab871 /drivers
parent034196a6cc39ed99c329b122edfe887970be69d8 (diff)
downloadbarebox-8281881ce28770b44823f06263a133b2847201a3.tar.gz
barebox-8281881ce28770b44823f06263a133b2847201a3.tar.xz
ARM: i.MX: Drop HAB workaround
The i.MX HAB code on i.MX6 has to jump into ROM which happens to start at 0x0. To make that possible we used to map the ROM cached and jumped to it before the MMU is initialized. Instead, remap the ROM as needed in the HAB code so that we can safely jump into ROM with MMU enabled. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/hab/habv4.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/hab/habv4.c b/drivers/hab/habv4.c
index ca26773bf8..e8c7d3264d 100644
--- a/drivers/hab/habv4.c
+++ b/drivers/hab/habv4.c
@@ -11,6 +11,9 @@
#include <hab.h>
#include <init.h>
#include <types.h>
+#include <mmu.h>
+#include <zero_page.h>
+#include <linux/sizes.h>
#include <linux/arm-smccc.h>
#include <asm/cache.h>
@@ -616,12 +619,17 @@ static int init_imx6_hab_get_status(void)
/* can happen in multi-image builds and is not an error */
return 0;
+ arch_remap_range(0x0, SZ_1M, MAP_CACHED);
+
/*
* Nobody will check the return value if there were HAB errors, but the
* initcall will fail spectaculously with a strange error message.
*/
imx6_hab_get_status();
+ zero_page_faulting();
+ arch_remap_range((void *)PAGE_SIZE, SZ_1M - PAGE_SIZE, MAP_UNCACHED);
+
return 0;
}
@@ -630,7 +638,7 @@ static int init_imx6_hab_get_status(void)
* which will no longer be accessible when the MMU sets the zero page to
* faulting.
*/
-postconsole_initcall(init_imx6_hab_get_status);
+postmmu_initcall(init_imx6_hab_get_status);
int imx28_hab_get_status(void)
{