mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: BAREBOX <barebox@lists.infradead.org>
Subject: [PATCH 6/6] ARM: rockchip: atf: enable MMU in PBL
Date: Fri, 20 Mar 2026 09:31:22 +0100	[thread overview]
Message-ID: <20260320-compressed-firmware-rockchip-v1-6-7d03c7e39d2f@pengutronix.de> (raw)
In-Reply-To: <20260320-compressed-firmware-rockchip-v1-0-7d03c7e39d2f@pengutronix.de>

Using compressed binaries for TF-A and OP-TEE comes with the penalty of
additional startup time. Enable the MMU before uncompressing to speed
that up significantly.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-rockchip/atf.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-rockchip/atf.c b/arch/arm/mach-rockchip/atf.c
index 4e1b9f6a21..aa2733bdac 100644
--- a/arch/arm/mach-rockchip/atf.c
+++ b/arch/arm/mach-rockchip/atf.c
@@ -7,6 +7,7 @@
 #include <tee/optee.h>
 #include <asm/atf_common.h>
 #include <asm/barebox-arm.h>
+#include <asm/mmu.h>
 #include <asm-generic/memory_layout.h>
 #include <asm-generic/sections.h>
 #include <mach/rockchip/dmc.h>
@@ -144,7 +145,6 @@ static struct fwobj bl32; /* OP-TEE in barebox image */
 			get_builtin_firmware_compressed(tee_bin, &bl32);	\
 	} while (0)
 
-
 static int rockchip_create_optee_fdt(void *buf, int bufsize)
 {
 	unsigned long base[ROCKCHIP_MAX_DRAM_RESOURCES];
@@ -171,6 +171,8 @@ static void rockchip_atf_load_bl31(void *fdt)
 {
 	unsigned long bl31_ep;
 
+	mmu_early_enable(membase[0], membase[0] + memsize[0]);
+
 	bl31_ep = load_elf64_image_phdr(&bl31);
 
 	if (IS_ENABLED(CONFIG_ARCH_ROCKCHIP_OPTEE))
@@ -181,6 +183,8 @@ static void rockchip_atf_load_bl31(void *fdt)
 			"r" ((ulong)barebox_load_address - 16) :
 			"cc");
 
+	mmu_disable();
+
 	bl31_entry(bl31_ep, optee_load_address,
 		   barebox_load_address, (uintptr_t)fdt);
 }

-- 
2.47.3




      parent reply	other threads:[~2026-03-20  8:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-20  8:31 [PATCH 0/6] Rockchip: Enable MMU before uncompressing TF-A and OP-TEE Sascha Hauer
2026-03-20  8:31 ` [PATCH 1/6] ARM: rockchip: dmc: rework DRAM functions Sascha Hauer
2026-03-20  8:31 ` [PATCH 2/6] ARM: rockchip: atf: make all memory banks available Sascha Hauer
2026-03-20  8:31 ` [PATCH 3/6] ARM: rockchip: atf: add OP-TEE fdt creation function for all SoCs Sascha Hauer
2026-03-20  8:31 ` [PATCH 4/6] ARM: Rockchip: Drop rk3xxx_atf_load_bl31() Sascha Hauer
2026-03-20  8:31 ` [PATCH 5/6] ARM: rockchip: separate physical DRAM start from usable start Sascha Hauer
2026-03-20  8:31 ` Sascha Hauer [this message]

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=20260320-compressed-firmware-rockchip-v1-6-7d03c7e39d2f@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