mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] ARM: mmu64: setup ttb for EL2 as well
@ 2023-11-20 14:44 Sascha Hauer
  2023-11-20 14:44 ` [PATCH 2/2] ARM: layerscape: ppa: Fix starting PPA Sascha Hauer
  0 siblings, 1 reply; 5+ messages in thread
From: Sascha Hauer @ 2023-11-20 14:44 UTC (permalink / raw)
  To: Barebox List

The TF-A is often started before the MMU is initialized. There are some
exceptions though. On Layerscape  the TF-A (or: PPA in that case) is
started while the MMU is running. The PPA is then executed in EL3 and
returns in EL2. For this case setup the TTB for EL2 as well so that we
have a valid MMU setup when the PPA returns.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/cpu/mmu_64.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/cpu/mmu_64.c b/arch/arm/cpu/mmu_64.c
index b718cb1efa..716e717c72 100644
--- a/arch/arm/cpu/mmu_64.c
+++ b/arch/arm/cpu/mmu_64.c
@@ -297,6 +297,8 @@ void mmu_early_enable(unsigned long membase, unsigned long memsize)
 
 	el = current_el();
 	set_ttbr_tcr_mair(el, ttb, calc_tcr(el, BITS_PER_VA), MEMORY_ATTRIBUTES);
+	if (el == 3)
+		set_ttbr_tcr_mair(2, ttb, calc_tcr(2, BITS_PER_VA), MEMORY_ATTRIBUTES);
 
 	memset((void *)ttb, 0, GRANULE_SIZE);
 
-- 
2.39.2




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-11-21 13:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-20 14:44 [PATCH 1/2] ARM: mmu64: setup ttb for EL2 as well Sascha Hauer
2023-11-20 14:44 ` [PATCH 2/2] ARM: layerscape: ppa: Fix starting PPA Sascha Hauer
2023-11-20 14:54   ` Ahmad Fatoum
2023-11-20 15:12     ` Sascha Hauer
2023-11-21 13:42       ` Ahmad Fatoum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox