]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - arch/arm/cpu/arm926ejs/cpu.c
merged kc master branch
[karo-tx-uboot.git] / arch / arm / cpu / arm926ejs / cpu.c
1 /*
2  * (C) Copyright 2002
3  * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
4  * Marius Groeger <mgroeger@sysgo.de>
5  *
6  * (C) Copyright 2002
7  * Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
8  *
9  * SPDX-License-Identifier:     GPL-2.0+
10  */
11
12 /*
13  * CPU specific code
14  */
15
16 #include <common.h>
17 #include <command.h>
18 #include <lcd.h>
19 #include <asm/system.h>
20
21 static void cache_flush(void);
22
23 int cleanup_before_linux (void)
24 {
25         /*
26          * this function is called just before we call linux
27          * it prepares the processor for linux
28          *
29          * we turn off caches etc ...
30          */
31
32         disable_interrupts ();
33
34 #ifdef CONFIG_LCD
35         {
36                 /* switch off LCD panel */
37                 lcd_panel_disable();
38                 /* disable LCD controller */
39                 lcd_disable();
40         }
41 #endif
42
43         /* turn off I/D-cache */
44         icache_disable();
45         dcache_disable();
46         l2_cache_disable();
47
48         /* flush I/D-cache */
49         cache_flush();
50
51         return 0;
52 }
53
54 /* flush I/D-cache */
55 static void cache_flush (void)
56 {
57         unsigned long i = 0;
58
59         asm ("mcr p15, 0, %0, c7, c7, 0": :"r" (i));
60 }