blob: aeee02d85d2a371acc4d2b46362c552409b57228 [file] [log] [blame]
Jean-Christophe PLAGNIOL-VILLARDb2368752009-03-29 23:01:41 +02001/*
2 * (C) Copyright 2004
3 * DAVE Srl
4 * http://www.dave-tech.it
5 * http://www.wawnet.biz
6 * mailto:info@wawnet.biz
7 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02008 * SPDX-License-Identifier: GPL-2.0+
Jean-Christophe PLAGNIOL-VILLARDb2368752009-03-29 23:01:41 +02009 */
10
11#include <common.h>
12#include <command.h>
13#include <asm/hardware.h>
14
15static 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
25void 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
47void icache_disable (void)
48{
49 ulong reg;
50
51 reg = SYSCFG;
52 reg &= ~0x00000006; /* 8kB */
53 SYSCFG = reg;
54}
55
56int icache_status (void)
57{
58 return 0;
59}
60
61void dcache_enable (void)
62{
63 icache_enable();
64}
65
66void dcache_disable (void)
67{
68 icache_disable();
69}
70
71int dcache_status (void)
72{
73 return dcache_status();
74}