]> git.sur5r.net Git - u-boot/commitdiff
nios2: add flush_dcache_range function
authorStefan Kristiansson <stefan.kristiansson@saunalahti.fi>
Fri, 4 Nov 2011 12:38:08 +0000 (14:38 +0200)
committerThomas Chou <thomas@wytron.com.tw>
Wed, 22 Feb 2012 23:53:03 +0000 (07:53 +0800)
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>
arch/nios2/lib/cache.S

index ee3b4b79bf1a3d96810e4b9d65bdbf4605656534..b952d0c901aefa80f9fe1517fa88a1cece9f5972 100644 (file)
@@ -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: