blob: 76689b21d3d94c10350dc287361fd5b6fd5e7419 [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>
Rick Chen842d5802018-11-07 09:34:06 +08009#include <asm/cache.h>
Rick Chene76b8042017-12-26 13:55:48 +080010
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 */
17int cleanup_before_linux(void)
18{
19 disable_interrupts();
20
21 /* turn off I/D-cache */
Rick Chen842d5802018-11-07 09:34:06 +080022 cache_flush();
23 icache_disable();
24 dcache_disable();
Rick Chene76b8042017-12-26 13:55:48 +080025
26 return 0;
27}