blob: f092600e14dda779fabb90588236ed49ed8dbf11 [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>
Simon Glass1eb69ae2019-11-14 12:57:39 -070010#include <irq_func.h>
Rick Chen52923c62018-11-07 09:34:06 +080011#include <asm/cache.h>
Rick Chene8e39592017-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 Chen52923c62018-11-07 09:34:06 +080024 cache_flush();
25 icache_disable();
26 dcache_disable();
Rick Chene8e39592017-12-26 13:55:48 +080027
28 return 0;
29}