xref: /openbmc/u-boot/arch/riscv/cpu/ax25/cpu.c (revision 81ea0083)
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * Copyright (C) 2017 Andes Technology Corporation
4  * Rick Chen, Andes Technology Corporation <rick@andestech.com>
5  */
6 
7 /* CPU specific code */
8 #include <common.h>
9 #include <asm/cache.h>
10 
11 /*
12  * cleanup_before_linux() is called just before we call linux
13  * it prepares the processor for linux
14  *
15  * we disable interrupt and caches.
16  */
17 int cleanup_before_linux(void)
18 {
19 	disable_interrupts();
20 
21 	/* turn off I/D-cache */
22 	cache_flush();
23 	icache_disable();
24 	dcache_disable();
25 
26 	return 0;
27 }
28