diff options
author | Stefan Roese <sr@denx.de> | 2007-03-31 13:44:12 +0200 |
---|---|---|
committer | Stefan Roese <sr@denx.de> | 2007-03-31 13:44:12 +0200 |
commit | 0e7d4916afaf83083b9b70ad779f29f7b57bd8ed (patch) | |
tree | 40e9396ee819149a89f520f551d1ed31cb8f5216 /lib_blackfin/cache.c | |
parent | da6ebc1bc082cbe3b6bbde079cafe09f7ebbad4b (diff) | |
parent | 6db7d0af2336c126e4d4b2f248cc23516bdd46a8 (diff) | |
download | u-boot-imx-0e7d4916afaf83083b9b70ad779f29f7b57bd8ed.zip u-boot-imx-0e7d4916afaf83083b9b70ad779f29f7b57bd8ed.tar.gz u-boot-imx-0e7d4916afaf83083b9b70ad779f29f7b57bd8ed.tar.bz2 |
Merge with git://www.denx.de/git/u-boot.git
Diffstat (limited to 'lib_blackfin/cache.c')
-rw-r--r-- | lib_blackfin/cache.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/lib_blackfin/cache.c b/lib_blackfin/cache.c index 847278d..a15914b 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; } |