Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Rick Chen | e76b804 | 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 | e76b804 | 2017-12-26 13:55:48 +0800 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | /* CPU specific code */ |
| 8 | #include <common.h> |
Simon Glass | 1d91ba7 | 2019-11-14 12:57:37 -0700 | [diff] [blame] | 9 | #include <cpu_func.h> |
Simon Glass | 6333448 | 2019-11-14 12:57:39 -0700 | [diff] [blame] | 10 | #include <irq_func.h> |
Rick Chen | 842d580 | 2018-11-07 09:34:06 +0800 | [diff] [blame] | 11 | #include <asm/cache.h> |
Rick Chen | e76b804 | 2017-12-26 13:55:48 +0800 | [diff] [blame] | 12 | |
| 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 | */ |
| 19 | int cleanup_before_linux(void) |
| 20 | { |
| 21 | disable_interrupts(); |
| 22 | |
| 23 | /* turn off I/D-cache */ |
Rick Chen | 842d580 | 2018-11-07 09:34:06 +0800 | [diff] [blame] | 24 | cache_flush(); |
| 25 | icache_disable(); |
| 26 | dcache_disable(); |
Rick Chen | e76b804 | 2017-12-26 13:55:48 +0800 | [diff] [blame] | 27 | |
| 28 | return 0; |
| 29 | } |