summaryrefslogtreecommitdiff
path: root/lib_blackfin/cache.c
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2008-11-01 15:59:35 +0100
committerWolfgang Denk <wd@denx.de>2008-11-01 15:59:35 +0100
commit4cc64742a89e8ce90c69c3c85e4e9f4706062f2f (patch)
tree38caa914ea08118a0613f3579790b2b76c217bb2 /lib_blackfin/cache.c
parent7c84fe6a06dad9f793ed85b39b1e6c11a7882f5c (diff)
parentf177f4250c729727b1629fa8d8d6556c999e9b8c (diff)
downloadu-boot-imx-4cc64742a89e8ce90c69c3c85e4e9f4706062f2f.zip
u-boot-imx-4cc64742a89e8ce90c69c3c85e4e9f4706062f2f.tar.gz
u-boot-imx-4cc64742a89e8ce90c69c3c85e4e9f4706062f2f.tar.bz2
Merge branch 'master' of git://git.denx.de/u-boot-blackfin
Diffstat (limited to 'lib_blackfin/cache.c')
-rw-r--r--lib_blackfin/cache.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/lib_blackfin/cache.c b/lib_blackfin/cache.c
index c2f6e28..870c5bf 100644
--- a/lib_blackfin/cache.c
+++ b/lib_blackfin/cache.c
@@ -11,6 +11,7 @@
#include <common.h>
#include <asm/blackfin.h>
+#include <asm/mach-common/bits/mpu.h>
void flush_cache(unsigned long addr, unsigned long size)
{
@@ -24,3 +25,37 @@ void flush_cache(unsigned long addr, unsigned long size)
if (dcache_status())
blackfin_dcache_flush_range((void *)addr, (void *)(addr + size));
}
+
+void icache_enable(void)
+{
+ bfin_write_IMEM_CONTROL(IMC | ENICPLB);
+ SSYNC();
+}
+
+void icache_disable(void)
+{
+ bfin_write_IMEM_CONTROL(0);
+ SSYNC();
+}
+
+int icache_status(void)
+{
+ return bfin_read_IMEM_CONTROL() & IMC;
+}
+
+void dcache_enable(void)
+{
+ bfin_write_DMEM_CONTROL(ACACHE_BCACHE | ENDCPLB | PORT_PREF0);
+ SSYNC();
+}
+
+void dcache_disable(void)
+{
+ bfin_write_DMEM_CONTROL(0);
+ SSYNC();
+}
+
+int dcache_status(void)
+{
+ return bfin_read_DMEM_CONTROL() & ACACHE_BCACHE;
+}