]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - arch/arm/cpu/s3c44b0/cache.c
Add GPL-2.0+ SPDX-License-Identifier to source files
[karo-tx-uboot.git] / arch / arm / cpu / s3c44b0 / cache.c
1 /*
2  * (C) Copyright 2004
3  * DAVE Srl
4  * http://www.dave-tech.it
5  * http://www.wawnet.biz
6  * mailto:info@wawnet.biz
7  *
8  * SPDX-License-Identifier:     GPL-2.0+
9  */
10
11 #include <common.h>
12 #include <command.h>
13 #include <asm/hardware.h>
14
15 static void s3c44b0_flush_cache(void)
16 {
17         volatile int i;
18         /* flush cycle */
19         for(i=0x10002000;i<0x10004800;i+=16)
20         {
21                 *((int *)i)=0x0;
22         }
23 }
24
25 void icache_enable (void)
26 {
27         ulong reg;
28
29         s3c44b0_flush_cache();
30
31         /*
32                 Init cache
33                 Non-cacheable area (everything outside RAM)
34                 0x0000:0000 - 0x0C00:0000
35          */
36         NCACHBE0 = 0xC0000000;
37         NCACHBE1 = 0x00000000;
38
39         /*
40                 Enable chache
41         */
42         reg = SYSCFG;
43         reg |= 0x00000006; /* 8kB */
44         SYSCFG = reg;
45 }
46
47 void icache_disable (void)
48 {
49         ulong reg;
50
51         reg = SYSCFG;
52         reg &= ~0x00000006; /* 8kB */
53         SYSCFG = reg;
54 }
55
56 int icache_status (void)
57 {
58         return 0;
59 }
60
61 void dcache_enable (void)
62 {
63         icache_enable();
64 }
65
66 void dcache_disable (void)
67 {
68         icache_disable();
69 }
70
71 int dcache_status (void)
72 {
73         return dcache_status();
74 }