summaryrefslogtreecommitdiff
path: root/payloads
diff options
context:
space:
mode:
Diffstat (limited to 'payloads')
-rw-r--r--payloads/libpayload/arch/arm64/cache.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/payloads/libpayload/arch/arm64/cache.c b/payloads/libpayload/arch/arm64/cache.c
index 0755c56731..2d42522588 100644
--- a/payloads/libpayload/arch/arm64/cache.c
+++ b/payloads/libpayload/arch/arm64/cache.c
@@ -119,7 +119,11 @@ void dcache_invalidate_by_mva(void const *addr, size_t len)
void cache_sync_instructions(void)
{
- dcache_clean_all(); /* includes trailing DSB (in assembly) */
+ uint32_t sctlr = raw_read_sctlr_current();
+ if (sctlr & SCTLR_C)
+ dcache_clean_all(); /* includes trailing DSB (assembly) */
+ else if (sctlr & SCTLR_I)
+ dcache_clean_invalidate_all();
icache_invalidate_all(); /* includes leading DSB and trailing ISB */
}