From 2da287ad13e1b488c1c39afc4721d733d6b83cd7 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Sun, 16 Jun 2024 19:31:04 +0200 Subject: [PATCH] arm: implement invalidate_icache_all on ARM11 In EFI sub-system we rely on invalidate_icache_all() to invalidate the instruction cache after loading binaries. Add the missing implementation on ARM1136, ARM1176. Signed-off-by: Heinrich Schuchardt --- arch/arm/cpu/arm11/cpu.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm/cpu/arm11/cpu.c b/arch/arm/cpu/arm11/cpu.c index 1e16b89d00..d092c58b52 100644 --- a/arch/arm/cpu/arm11/cpu.c +++ b/arch/arm/cpu/arm11/cpu.c @@ -117,3 +117,15 @@ void enable_caches(void) #endif } #endif + +#if !CONFIG_IS_ENABLED(SYS_ICACHE_OFF) +/* Invalidate entire I-cache */ +void invalidate_icache_all(void) +{ + unsigned long i = 0; + + asm ("mcr p15, 0, %0, c7, c5, 0" : : "r" (i)); +} +#else +void invalidate_icache_all(void) {} +#endif -- 2.39.5