2 * (C) Copyright 2004 Texas Insturments
5 * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
6 * Marius Groeger <mgroeger@sysgo.de>
9 * Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
11 * SPDX-License-Identifier: GPL-2.0+
20 #include <asm/system.h>
22 static void cache_flush (void);
24 int cleanup_before_linux (void)
27 * this function is called just before we call linux
28 * it prepares the processor for linux
30 * we turn off caches etc ...
33 disable_interrupts ();
35 /* turn off I/D-cache */
45 static void cache_flush (void)
47 /* invalidate both caches and flush btb */
48 asm ("mcr p15, 0, %0, c7, c7, 0": :"r" (0));
49 /* mem barrier to sync things */
50 asm ("mcr p15, 0, %0, c7, c10, 4": :"r" (0));