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> |
Rick Chen | 842d580 | 2018-11-07 09:34:06 +0800 | [diff] [blame] | 9 | #include <asm/cache.h> |
Rick Chen | e76b804 | 2017-12-26 13:55:48 +0800 | [diff] [blame] | 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 */ |
Rick Chen | 842d580 | 2018-11-07 09:34:06 +0800 | [diff] [blame] | 22 | cache_flush(); |
| 23 | icache_disable(); |
| 24 | dcache_disable(); |
Rick Chen | e76b804 | 2017-12-26 13:55:48 +0800 | [diff] [blame] | 25 | |
| 26 | return 0; |
| 27 | } |