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