blob: 0534b37f5daa70f8c099ad3b9fb24532e23670f6 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Rick Chene8e39592017-12-26 13:55:48 +08002/*
3 * Copyright (C) 2017 Andes Technology Corporation
4 * Rick Chen, Andes Technology Corporation <rick@andestech.com>
Rick Chene8e39592017-12-26 13:55:48 +08005 */
6
7/* CPU specific code */
8#include <common.h>
Simon Glass9edefc22019-11-14 12:57:37 -07009#include <cpu_func.h>
Rick Chen52923c62018-11-07 09:34:06 +080010#include <asm/cache.h>
Rick Chene8e39592017-12-26 13:55:48 +080011
12/*
13 * cleanup_before_linux() is called just before we call linux
14 * it prepares the processor for linux
15 *
16 * we disable interrupt and caches.
17 */
18int cleanup_before_linux(void)
19{
20 disable_interrupts();
21
22 /* turn off I/D-cache */
Rick Chen52923c62018-11-07 09:34:06 +080023 cache_flush();
24 icache_disable();
25 dcache_disable();
Rick Chene8e39592017-12-26 13:55:48 +080026
27 return 0;
28}