* [PATCH] ARM: layerscape: ppa: Enable MMU when in EL2
@ 2023-11-27 7:28 Sascha Hauer
0 siblings, 0 replies; only message in thread
From: Sascha Hauer @ 2023-11-27 7:28 UTC (permalink / raw)
To: Barebox List
We enter EL2 with MMU disabled even when it was enabled in EL3. Enable
MMU in EL2 again.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/mach-layerscape/ppa.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/arm/mach-layerscape/ppa.c b/arch/arm/mach-layerscape/ppa.c
index 43145a7ece..996e881232 100644
--- a/arch/arm/mach-layerscape/ppa.c
+++ b/arch/arm/mach-layerscape/ppa.c
@@ -123,9 +123,16 @@ int ls1046a_ppa_init(resource_size_t ppa_start, resource_size_t ppa_size)
get_builtin_firmware(ppa_ls1046a_bin, &ppa_fw, &ppa_fw_size);
if (el == 3) {
+ unsigned int cr;
+
+ asm volatile("mrs %0, sctlr_el3" : "=r" (cr) : : "cc");
remap_range((void *)ppa_start, ppa_size, MAP_CACHED);
+
ret = ppa_init(ppa_fw, ppa_fw_size, (void *)ppa_start);
+
+ asm volatile("msr sctlr_el2, %0" : : "r" (cr) : "cc");
remap_range((void *)ppa_start, ppa_size, MAP_UNCACHED);
+
if (ret)
return ret;
}
--
2.39.2
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-11-27 7:30 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-27 7:28 [PATCH] ARM: layerscape: ppa: Enable MMU when in EL2 Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox