diff options
author | Mike Frysinger <vapier.adi@gmail.com> | 2008-08-14 02:29:57 -0400 |
---|---|---|
committer | Bryan Wu <cooloney@kernel.org> | 2008-08-14 02:29:57 -0400 |
commit | 0e06b50dda5965e0f8a15b0be14b759ead54fd2a (patch) | |
tree | 3b0bf1ba71ba8799e55a7670d8572615443c0ba5 /arch/blackfin/mach-common/lock.S | |
parent | 55546ac45dfb4087437bedaed43400630c96680e (diff) |
Blackfin arch: cleanup cache lock code
- remove cheesy read_iloc() function
- move invalidate_entire_icache function to lock.S
- export proper prototypes for functions in lock.S
- only build lock.S when BFIN_ICACHE_LOCK is enabled
Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Diffstat (limited to 'arch/blackfin/mach-common/lock.S')
-rw-r--r-- | arch/blackfin/mach-common/lock.S | 45 |
1 files changed, 31 insertions, 14 deletions
diff --git a/arch/blackfin/mach-common/lock.S b/arch/blackfin/mach-common/lock.S index 30b887e67dd6..9daf01201e9f 100644 --- a/arch/blackfin/mach-common/lock.S +++ b/arch/blackfin/mach-common/lock.S | |||
@@ -28,13 +28,10 @@ | |||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #include <linux/linkage.h> | 30 | #include <linux/linkage.h> |
31 | #include <asm/cplb.h> | ||
32 | #include <asm/blackfin.h> | 31 | #include <asm/blackfin.h> |
33 | 32 | ||
34 | .text | 33 | .text |
35 | 34 | ||
36 | #ifdef CONFIG_BFIN_ICACHE_LOCK | ||
37 | |||
38 | /* When you come here, it is assumed that | 35 | /* When you come here, it is assumed that |
39 | * R0 - Which way to be locked | 36 | * R0 - Which way to be locked |
40 | */ | 37 | */ |
@@ -189,18 +186,38 @@ ENTRY(_cache_lock) | |||
189 | RTS; | 186 | RTS; |
190 | ENDPROC(_cache_lock) | 187 | ENDPROC(_cache_lock) |
191 | 188 | ||
192 | #endif /* BFIN_ICACHE_LOCK */ | 189 | /* Invalidate the Entire Instruction cache by |
193 | 190 | * disabling IMC bit | |
194 | /* Return the ILOC bits of IMEM_CONTROL | ||
195 | */ | 191 | */ |
192 | ENTRY(_invalidate_entire_icache) | ||
193 | [--SP] = ( R7:5); | ||
196 | 194 | ||
197 | ENTRY(_read_iloc) | 195 | P0.L = LO(IMEM_CONTROL); |
198 | P1.H = HI(IMEM_CONTROL); | 196 | P0.H = HI(IMEM_CONTROL); |
199 | P1.L = LO(IMEM_CONTROL); | 197 | R7 = [P0]; |
200 | R1 = 0xF; | 198 | |
201 | R0 = [P1]; | 199 | /* Clear the IMC bit , All valid bits in the instruction |
202 | R0 = R0 >> 3; | 200 | * cache are set to the invalid state |
203 | R0 = R0 & R1; | 201 | */ |
202 | BITCLR(R7,IMC_P); | ||
203 | CLI R6; | ||
204 | SSYNC; /* SSYNC required before invalidating cache. */ | ||
205 | .align 8; | ||
206 | [P0] = R7; | ||
207 | SSYNC; | ||
208 | STI R6; | ||
209 | |||
210 | /* Configures the instruction cache agian */ | ||
211 | R6 = (IMC | ENICPLB); | ||
212 | R7 = R7 | R6; | ||
213 | |||
214 | CLI R6; | ||
215 | SSYNC; /* SSYNC required before writing to IMEM_CONTROL. */ | ||
216 | .align 8; | ||
217 | [P0] = R7; | ||
218 | SSYNC; | ||
219 | STI R6; | ||
204 | 220 | ||
221 | ( R7:5) = [SP++]; | ||
205 | RTS; | 222 | RTS; |
206 | ENDPROC(_read_iloc) | 223 | ENDPROC(_invalidate_entire_icache) |