[PATCH v2 3/3] ARM: rockchip: initialize PBL malloc

Sascha Hauer s.hauer at pengutronix.de
Mon May 18 11:32:50 PDT 2026


Rockchip uses compressed firmware binaries. Depending on the compression
algorithm we might use early malloc space for decompressing. Initialize
the PBL malloc space to the memory end to make pbl_malloc() work. This
memory area will be overwritten later in barebox_pbl_start(), but it's
ok as the memory is only needed during decompression of the firmware
files.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
Reviewed-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
Tested-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 arch/arm/mach-rockchip/atf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-rockchip/atf.c b/arch/arm/mach-rockchip/atf.c
index 3e2e18ac29..14797a1e06 100644
--- a/arch/arm/mach-rockchip/atf.c
+++ b/arch/arm/mach-rockchip/atf.c
@@ -173,6 +173,7 @@ static void rockchip_atf_load_bl31(void *fdt)
 	unsigned long bl31_ep;
 
 	mmu_early_enable(membase[0], memsize[0]);
+	pbl_malloc_init(membase[0] + memsize[0] - PBL_MALLOC_SIZE, PBL_MALLOC_SIZE);
 
 	bl31_ep = load_elf64_image_phdr(&bl31);
 
-- 
2.47.3




More information about the barebox mailing list