aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm/cache-v7.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mm/cache-v7.S')
-rw-r--r--arch/arm/mm/cache-v7.S36
1 files changed, 36 insertions, 0 deletions
diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S
index 39e3fb3db801..d1fa2f66d8c0 100644
--- a/arch/arm/mm/cache-v7.S
+++ b/arch/arm/mm/cache-v7.S
@@ -33,6 +33,24 @@ ENTRY(v7_flush_icache_all)
33 mov pc, lr 33 mov pc, lr
34ENDPROC(v7_flush_icache_all) 34ENDPROC(v7_flush_icache_all)
35 35
36 /*
37 * v7_flush_dcache_louis()
38 *
39 * Flush the D-cache up to the Level of Unification Inner Shareable
40 *
41 * Corrupted registers: r0-r7, r9-r11 (r6 only in Thumb mode)
42 */
43
44ENTRY(v7_flush_dcache_louis)
45 dmb @ ensure ordering with previous memory accesses
46 mrc p15, 1, r0, c0, c0, 1 @ read clidr, r0 = clidr
47 ands r3, r0, #0xe00000 @ extract LoUIS from clidr
48 mov r3, r3, lsr #20 @ r3 = LoUIS * 2
49 moveq pc, lr @ return if level == 0
50 mov r10, #0 @ r10 (starting level) = 0
51 b loop1 @ start flushing cache levels
52ENDPROC(v7_flush_dcache_louis)
53
36/* 54/*
37 * v7_flush_dcache_all() 55 * v7_flush_dcache_all()
38 * 56 *
@@ -120,6 +138,24 @@ ENTRY(v7_flush_kern_cache_all)
120 mov pc, lr 138 mov pc, lr
121ENDPROC(v7_flush_kern_cache_all) 139ENDPROC(v7_flush_kern_cache_all)
122 140
141 /*
142 * v7_flush_kern_cache_louis(void)
143 *
144 * Flush the data cache up to Level of Unification Inner Shareable.
145 * Invalidate the I-cache to the point of unification.
146 */
147ENTRY(v7_flush_kern_cache_louis)
148 ARM( stmfd sp!, {r4-r5, r7, r9-r11, lr} )
149 THUMB( stmfd sp!, {r4-r7, r9-r11, lr} )
150 bl v7_flush_dcache_louis
151 mov r0, #0
152 ALT_SMP(mcr p15, 0, r0, c7, c1, 0) @ invalidate I-cache inner shareable
153 ALT_UP(mcr p15, 0, r0, c7, c5, 0) @ I+BTB cache invalidate
154 ARM( ldmfd sp!, {r4-r5, r7, r9-r11, lr} )
155 THUMB( ldmfd sp!, {r4-r7, r9-r11, lr} )
156 mov pc, lr
157ENDPROC(v7_flush_kern_cache_louis)
158
123/* 159/*
124 * v7_flush_cache_all() 160 * v7_flush_cache_all()
125 * 161 *