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>
* (C) Copyright 2019 Rockchip Electronics Co., Ltd
*/
-#include <common.h>
+#include <cpu_func.h>
#include <debug_uart.h>
#include <dm.h>
#include <hang.h>
}
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();
+}