blob: 8813706232e1b073e7d8ec661fd87b43b4923ec5 [file] [log] [blame]
Heiko Schocheree009182016-08-17 09:13:25 +02001/*
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
10void 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 */
19void 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
26void invalidate_icache_all(void)
27{
28}
29#endif