diff options
author | Wolfgang Denk <wd@denx.de> | 2008-11-01 15:59:35 +0100 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2008-11-01 15:59:35 +0100 |
commit | 4cc64742a89e8ce90c69c3c85e4e9f4706062f2f (patch) | |
tree | 38caa914ea08118a0613f3579790b2b76c217bb2 /lib_blackfin/cache.c | |
parent | 7c84fe6a06dad9f793ed85b39b1e6c11a7882f5c (diff) | |
parent | f177f4250c729727b1629fa8d8d6556c999e9b8c (diff) | |
download | u-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.c | 35 |
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; +} |