/* * (C) Copyright 2008 Texas Insturments * * (C) Copyright 2002 * Sysgo Real-Time Solutions, GmbH * Marius Groeger * * (C) Copyright 2002 * Gary Jennejohn, DENX Software Engineering, * * SPDX-License-Identifier: GPL-2.0+ */ #include #include #include #include int cleanup_before_linux(void) { /* * this function is called just before we call linux * it prepares the processor for linux * * disable interrupt and turn off caches etc ... */ disable_interrupts(); /* * Turn off I-cache and invalidate it */ icache_disable(); invalidate_icache_all(); /* * turn off D-cache * dcache_disable() in turn flushes the d-cache and disables MMU */ dcache_disable(); invalidate_dcache_all(); return 0; }