summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Karlman <jonas@kwiboo.se>2024-02-17 12:34:04 +0000
committerKever Yang <kever.yang@rock-chips.com>2024-03-14 11:48:40 +0800
commit6d8cdfd15367b9ed0f8c9458a0f9a9962a767000 (patch)
treed9355c7b74af6510137f4dbe54a1389164d8a8c1
parent3e15dee38d45985b2ad666909720df1b4d412a98 (diff)
rockchip: spl: Enable caches to speed up checksum validation
FIT checksum validation is very slow in SPL due to D-cache not being enabled. Enable caches in SPL on ARM64 SoCs to speed up FIT checksum validation, from seconds to milliseconds. This change enables caches in SPL on all Rockchip ARM64 boards, the Kconfig options SPL_SYS_ICACHE_OFF and SPL_SYS_DCACHE_OFF can be used to disable caches for a specific board or SoC if needed. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
-rw-r--r--arch/arm/mach-rockchip/spl.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/arch/arm/mach-rockchip/spl.c b/arch/arm/mach-rockchip/spl.c
index 87280e2ba7c..1586a093fc3 100644
--- a/arch/arm/mach-rockchip/spl.c
+++ b/arch/arm/mach-rockchip/spl.c
@@ -3,7 +3,7 @@
* (C) Copyright 2019 Rockchip Electronics Co., Ltd
*/
-#include <common.h>
+#include <cpu_func.h>
#include <debug_uart.h>
#include <dm.h>
#include <hang.h>
@@ -136,6 +136,20 @@ void board_init_f(ulong dummy)
}
gd->ram_top = gd->ram_base + get_effective_memsize();
gd->ram_top = board_get_usable_ram_top(gd->ram_size);
+
+ if (IS_ENABLED(CONFIG_ARM64) && !CONFIG_IS_ENABLED(SYS_DCACHE_OFF)) {
+ gd->relocaddr = gd->ram_top;
+ arch_reserve_mmu();
+ enable_caches();
+ }
#endif
preloader_console_init();
}
+
+void spl_board_prepare_for_boot(void)
+{
+ if (!IS_ENABLED(CONFIG_ARM64) || CONFIG_IS_ENABLED(SYS_DCACHE_OFF))
+ return;
+
+ cleanup_before_linux();
+}