Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Heiko Schocher | ee00918 | 2016-08-17 09:13:25 +0200 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2016 |
| 4 | * Heiko Schocher, DENX Software Engineering, hs@denx.de. |
Heiko Schocher | ee00918 | 2016-08-17 09:13:25 +0200 | [diff] [blame] | 5 | */ |
| 6 | #include <linux/types.h> |
| 7 | #include <common.h> |
| 8 | |
| 9 | void enable_caches(void) |
| 10 | { |
| 11 | #ifndef CONFIG_SYS_ICACHE_OFF |
| 12 | icache_enable(); |
| 13 | #endif |
| 14 | } |
| 15 | |
| 16 | #ifndef CONFIG_SYS_ICACHE_OFF |
| 17 | /* Invalidate entire I-cache and branch predictor array */ |
| 18 | void invalidate_icache_all(void) |
| 19 | { |
| 20 | unsigned long i = 0; |
| 21 | |
| 22 | asm ("mcr p15, 0, %0, c7, c5, 0" : : "r" (i)); |
| 23 | } |
| 24 | #else |
| 25 | void invalidate_icache_all(void) |
| 26 | { |
| 27 | } |
| 28 | #endif |