Skip to contentSkip to conversation

mach-k3: am62ax: enable caches for the SPL stage

PATCH In review Anshul Dalal 2 participants 3 messages May 22, 2025 – Jun 5, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mach-k3: am62ax: enable caches for the SPL stage

board_init_f for the am62a is missing the call to spl_enable_cache which exists for all other am62 platforms (check am625_init.c & am62p5_init.c).

This allows the usage of caches while loading and parsing the u-boot.img FIT resulting in ~2x speedup in the A53 SPL stage.

---
 arch/arm/mach-k3/am62ax/am62a7_init.c | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-k3/am62ax/am62a7_init.c +1 -0
index 52a21277227..1d8644bd073 100644
@@ -191,6 +191,7 @@ void board_init_f(ulong dummy)
 	if (ret)
 		panic("DRAM init failed: %d\n", ret);
 #endif
+	spl_enable_cache();
 
 	setup_qos();
 
Signature · 1 line
2.49.0
#1 lore raw
Quoted 17 lines · Anshul Dalal

board_init_f for the am62a is missing the call to spl_enable_cache which exists for all other am62 platforms (check am625_init.c & am62p5_init.c).

This allows the usage of caches while loading and parsing the u-boot.img FIT resulting in ~2x speedup in the A53 SPL stage.

---
 arch/arm/mach-k3/am62ax/am62a7_init.c | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-k3/am62ax/am62a7_init.c +0 -0
index 52a21277227..1d8644bd073 100644

arch/arm/mach-k3/am62ax/am62a7_init.c void board_init_f(ulong dummy) · line 196

Quoted 6 lines
arch/arm/mach-k3/am62ax/am62a7_init.c +1 -0
@@ -191,6 +191,7 @@ void board_init_f(ulong dummy)
 	if (ret)
 		panic("DRAM init failed: %d\n", ret);
 #endif
+	spl_enable_cache();
 
 	setup_qos();

This is, as it matches all of the other K3 platforms, almost, fine enough. But can we consolidate board_init_f for K3 anywhere? It seems like there's a whole of lot repetition in there between otherwise similar code paths. And then there's the few platforms that call spl_enable_caches in k3_mem_init instead, why? Thanks.

Signature · 1 line
Tom
#2 lore raw
In reply to Anshul Dalal
Quoted 8 lines · Anshul Dalal

board_init_f for the am62a is missing the call to spl_enable_cache which exists for all other am62 platforms (check am625_init.c & am62p5_init.c).

This allows the usage of caches while loading and parsing the u-boot.img FIT resulting in ~2x speedup in the A53 SPL stage.

[...]

Applied to u-boot/master, thanks!

[1/1] mach-k3: am62ax: enable caches for the SPL stage

      commit: 27cd65ca1bf16c21818c233c6d658f3e747f5e85
Signature · 1 line
Tom