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