2018-05-06 21:58:06 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
2017-12-26 05:55:48 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2017 Andes Technology Corporation
|
|
|
|
* Rick Chen, Andes Technology Corporation <rick@andestech.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* CPU specific code */
|
|
|
|
#include <common.h>
|
2019-11-14 19:57:37 +00:00
|
|
|
#include <cpu_func.h>
|
2019-11-14 19:57:39 +00:00
|
|
|
#include <irq_func.h>
|
2018-11-07 01:34:06 +00:00
|
|
|
#include <asm/cache.h>
|
2017-12-26 05:55:48 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* cleanup_before_linux() is called just before we call linux
|
|
|
|
* it prepares the processor for linux
|
|
|
|
*
|
|
|
|
* we disable interrupt and caches.
|
|
|
|
*/
|
|
|
|
int cleanup_before_linux(void)
|
|
|
|
{
|
|
|
|
disable_interrupts();
|
|
|
|
|
|
|
|
/* turn off I/D-cache */
|
2018-11-07 01:34:06 +00:00
|
|
|
cache_flush();
|
|
|
|
icache_disable();
|
|
|
|
dcache_disable();
|
2017-12-26 05:55:48 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|