U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] common: spl: Enable Instruction cache after relocation in board_init_r
@ 2025-03-17  6:45 Prasanth Babu Mantena
  2025-03-17 15:13 ` Tom Rini
  0 siblings, 1 reply; 8+ messages in thread
From: Prasanth Babu Mantena @ 2025-03-17  6:45 UTC (permalink / raw)
  To: trini, sjg, alpernebiyasak
  Cc: u-boot, vigneshr, u-kumar1, n-francis, vaishnav.a

ICACHE is enabled in board_init_f which executes only before relocation.
Instruction cache invalidation is needed after relocation as well in the
common spl, which is taken care in the u-boot init_sequence, but missing
for the spl. So, enable it at the start of board_init_r for spl, which
invalidates icache needed after instruction relocation.

Fixes: 52a86e69e20 ("arm: k3: Enable instruction cache for main domain SPL")
Signed-off-by: Prasanth Babu Mantena <p-mantena@ti.com>
---
 arch/arm/mach-k3/common.c | 1 +
 common/spl/spl.c          | 1 +
 2 files changed, 2 insertions(+)

diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c
index fa8cd93d664..e4eb33512e7 100644
--- a/arch/arm/mach-k3/common.c
+++ b/arch/arm/mach-k3/common.c
@@ -266,6 +266,7 @@ static __maybe_unused void k3_dma_remove(void)
 void spl_board_prepare_for_boot(void)
 {
 #if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF))
+	icache_disable();
 	dcache_disable();
 #endif
 #if IS_ENABLED(CONFIG_SPL_DMA) && IS_ENABLED(CONFIG_SPL_DM_DEVICE_REMOVE)
diff --git a/common/spl/spl.c b/common/spl/spl.c
index 76fd56dfe4b..1db9a258e35 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -696,6 +696,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
 	debug(">>" PHASE_PROMPT "board_init_r()\n");
 
 	spl_set_bd();
+	enable_caches();
 
 	if (IS_ENABLED(CONFIG_SPL_SYS_MALLOC)) {
 		mem_malloc_init(SPL_SYS_MALLOC_START, SPL_SYS_MALLOC_SIZE);
-- 
2.34.1


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

end of thread, other threads:[~2025-12-01 13:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-17  6:45 [PATCH] common: spl: Enable Instruction cache after relocation in board_init_r Prasanth Babu Mantena
2025-03-17 15:13 ` Tom Rini
2025-03-25  5:34   ` Prasanth Mantena
2025-11-26 11:34     ` Ernest Van Hoecke
2025-11-26 13:04       ` Kumar, Udit
2025-11-28 19:24         ` Ernest Van Hoecke
2025-11-29  4:26           ` Kumar, Udit
2025-12-01 10:06             ` Ernest Van Hoecke

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