summaryrefslogtreecommitdiff
path: root/arch/nios2/lib
diff options
context:
space:
mode:
authorStefan Kristiansson <stefan.kristiansson@saunalahti.fi>2011-11-04 14:38:08 +0200
committerThomas Chou <thomas@wytron.com.tw>2012-02-23 07:53:03 +0800
commit8875833a86e567c0ca4258353116294089d24625 (patch)
tree086934c550126a648bc2d2c90a8ff8bf731f60bf /arch/nios2/lib
parent2acca35ce4604dcef933f07d90aa9c9c930e1049 (diff)
downloadu-boot-imx-8875833a86e567c0ca4258353116294089d24625.zip
u-boot-imx-8875833a86e567c0ca4258353116294089d24625.tar.gz
u-boot-imx-8875833a86e567c0ca4258353116294089d24625.tar.bz2
nios2: add flush_dcache_range function
exposes functionality to flush dcache according to the common.h API Signed-off-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi> Cc: Thomas Chou <thomas@wytron.com.tw> Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Diffstat (limited to 'arch/nios2/lib')
-rw-r--r--arch/nios2/lib/cache.S10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/nios2/lib/cache.S b/arch/nios2/lib/cache.S
index ee3b4b7..b952d0c 100644
--- a/arch/nios2/lib/cache.S
+++ b/arch/nios2/lib/cache.S
@@ -48,6 +48,16 @@ flush_icache:
bltu r4, r5, 1b
ret
+ .global flush_dcache_range
+
+flush_dcache_range:
+ movhi r8, %hi(CONFIG_SYS_DCACHELINE_SIZE)
+ ori r8, r8, %lo(CONFIG_SYS_DCACHELINE_SIZE)
+0: flushd 0(r4)
+ add r4, r4, r8
+ bltu r4, r5, 0b
+ ret
+
.global flush_cache
flush_cache: