blob: 024c8f5f3e962a87bd2ab75f00dc4320528b86ab [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Heiko Schocheree009182016-08-17 09:13:25 +02002/*
3 * (C) Copyright 2016
4 * Heiko Schocher, DENX Software Engineering, hs@denx.de.
Heiko Schocheree009182016-08-17 09:13:25 +02005 */
6#include <linux/types.h>
7#include <common.h>
8
9void 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 */
18void 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
25void invalidate_icache_all(void)
26{
27}
28#endif