[PATCH v5 24/25] rockchip: Relocate bloblist at the end of the SPL phase
Simon Glass
sjg at chromium.org
Mon May 26 12:15:10 CEST 2025
Where the bloblist is located in internal memory and TF-A's BL31 blob
removes access to this memory, the best option seems to be to relocate
the bloblist just before running TF-A.
Do this at the end of SPL.
Signed-off-by: Simon Glass <sjg at chromium.org>
Suggested-by: Raymond Mao <raymond.mao at linaro.org>
---
Changes in v5:
- Use 'SDRAM' instead of 'IRAM' in comment
- Drop mention of rk3399 since 64-boards always have TF-A after SPL
- Drop condition on VPL
Changes in v3:
- Add the BLOBLIST_RELOC condition as well
Changes in v2:
- Move this logic into board-specific code
arch/arm/mach-rockchip/spl.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/arch/arm/mach-rockchip/spl.c b/arch/arm/mach-rockchip/spl.c
index 305373a161c..503e55dfc3a 100644
--- a/arch/arm/mach-rockchip/spl.c
+++ b/arch/arm/mach-rockchip/spl.c
@@ -3,6 +3,7 @@
* (C) Copyright 2019 Rockchip Electronics Co., Ltd
*/
+#include <bloblist.h>
#include <cpu_func.h>
#include <debug_uart.h>
#include <dm.h>
@@ -133,6 +134,19 @@ void board_init_f(ulong dummy)
void spl_board_prepare_for_boot(void)
{
+ /*
+ * TF-A is executed after SPL and before U-Boot. It removes our access
+ * to the SRAM. So move the bloblist to RAM.
+ */
+ if (xpl_phase() == PHASE_SPL && CONFIG_IS_ENABLED(BLOBLIST_RELOC)) {
+ ulong addr = CONFIG_IF_ENABLED_INT(BLOBLIST_RELOC,
+ BLOBLIST_RELOC_ADDR);
+
+ log_debug("Relocating bloblist %p to %lx\n", gd_bloblist(),
+ addr);
+ bloblist_reloc(map_sysmem(addr, 0), bloblist_get_total_size());
+ }
+
if (!IS_ENABLED(CONFIG_ARM64) || CONFIG_IS_ENABLED(SYS_DCACHE_OFF))
return;
--
2.43.0
More information about the U-Boot
mailing list