Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Rick Chen | e8e3959 | 2017-12-26 13:55:48 +0800 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2017 Andes Technology Corporation |
| 4 | * Rick Chen, Andes Technology Corporation <rick@andestech.com> |
Rick Chen | e8e3959 | 2017-12-26 13:55:48 +0800 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | /* CPU specific code */ |
| 8 | #include <common.h> |
Simon Glass | 9edefc2 | 2019-11-14 12:57:37 -0700 | [diff] [blame] | 9 | #include <cpu_func.h> |
Rick Chen | 52923c6 | 2018-11-07 09:34:06 +0800 | [diff] [blame] | 10 | #include <asm/cache.h> |
Rick Chen | e8e3959 | 2017-12-26 13:55:48 +0800 | [diff] [blame] | 11 | |
| 12 | /* |
| 13 | * cleanup_before_linux() is called just before we call linux |
| 14 | * it prepares the processor for linux |
| 15 | * |
| 16 | * we disable interrupt and caches. |
| 17 | */ |
| 18 | int cleanup_before_linux(void) |
| 19 | { |
| 20 | disable_interrupts(); |
| 21 | |
| 22 | /* turn off I/D-cache */ |
Rick Chen | 52923c6 | 2018-11-07 09:34:06 +0800 | [diff] [blame] | 23 | cache_flush(); |
| 24 | icache_disable(); |
| 25 | dcache_disable(); |
Rick Chen | e8e3959 | 2017-12-26 13:55:48 +0800 | [diff] [blame] | 26 | |
| 27 | return 0; |
| 28 | } |