From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH] ARM: mmu-early: On i.MX6 with HAB map ROM is mapped without XN
Date: Fri, 8 Nov 2019 09:28:00 +0100 [thread overview]
Message-ID: <20191108082800.22044-1-s.hauer@pengutronix.de> (raw)
On i.MX6 with HAB enabled we call into the ROM later in
imx6_hab_get_status(). This only works when the XN bit is not set for
this area, so remap the first MiB as cached which doesn't have the XN
bit set.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/cpu/mmu-early.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/arm/cpu/mmu-early.c b/arch/arm/cpu/mmu-early.c
index 7c30526b94..b985aa455f 100644
--- a/arch/arm/cpu/mmu-early.c
+++ b/arch/arm/cpu/mmu-early.c
@@ -58,5 +58,12 @@ void mmu_early_enable(unsigned long membase, unsigned long memsize,
/* maps main memory as cachable */
map_region(membase, memsize, PMD_SECT_DEF_CACHED);
+ /*
+ * With HAB enabled we call into the ROM code later in imx6_hab_get_status().
+ * Map the ROM cached which has the effect that the XN bit is not set.
+ */
+ if (IS_ENABLED(CONFIG_HABV4) && IS_ENABLED(CONFIG_ARCH_IMX6))
+ map_region(0x0, SZ_1M, PMD_SECT_DEF_CACHED);
+
__mmu_cache_on();
}
--
2.24.0.rc1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
reply other threads:[~2019-11-08 8:28 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20191108082800.22044-1-s.hauer@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