summaryrefslogtreecommitdiff
path: root/lib_blackfin/cache.c
diff options
context:
space:
mode:
authorAubrey.Li <aubrey.adi@gmail.com>2007-03-09 13:38:44 +0800
committerAubrey.Li <aubrey.adi@gmail.com>2007-03-09 13:38:44 +0800
commit3f0606ad0b5639f7f22848fe5b4574e754d0470f (patch)
tree3cb4fd316134b6a176607ad61739720aeb971a5a /lib_blackfin/cache.c
parenteb92f613556800f7483666db09d9a237ad911d4a (diff)
[Blackfin]PATCH-1/2]: Remove obsolete blackfin port and add bf533 platform support
Diffstat (limited to 'lib_blackfin/cache.c')
-rw-r--r--lib_blackfin/cache.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/lib_blackfin/cache.c b/lib_blackfin/cache.c
index 847278d226e..a15914b1098 100644
--- a/lib_blackfin/cache.c
+++ b/lib_blackfin/cache.c
@@ -26,15 +26,26 @@
*/
/* for now: just dummy functions to satisfy the linker */
-extern void blackfin_icache_range (unsigned long *, unsigned long *);
-extern void blackfin_dcache_range (unsigned long *, unsigned long *);
-void flush_cache (unsigned long dummy1, unsigned long dummy2)
+#include <config.h>
+#include <common.h>
+#include <asm/blackfin.h>
+
+extern void blackfin_icache_flush_range(unsigned long, unsigned long);
+extern void blackfin_dcache_flush_range(unsigned long, unsigned long);
+
+void flush_cache(unsigned long dummy1, unsigned long dummy2)
{
- if (icache_status ()) {
- blackfin_icache_flush_range (dummy1, dummy1 + dummy2);
- }
- if (dcache_status ()) {
- blackfin_dcache_flush_range (dummy1, dummy1 + dummy2);
- }
+ if ((dummy1 >= L1_ISRAM) && (dummy1 < L1_ISRAM_END))
+ return;
+ if ((dummy1 >= DATA_BANKA_SRAM) && (dummy1 < DATA_BANKA_SRAM_END))
+ return;
+ if ((dummy1 >= DATA_BANKB_SRAM) && (dummy1 < DATA_BANKB_SRAM_END))
+ return;
+
+ if (icache_status())
+ blackfin_icache_flush_range(dummy1, dummy1 + dummy2);
+ if (dcache_status())
+ blackfin_dcache_flush_range(dummy1, dummy1 + dummy2);
+
return;
}