diff options
Diffstat (limited to 'arch/arm/mm/cache-v6.S')
-rw-r--r-- | arch/arm/mm/cache-v6.S | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/arch/arm/mm/cache-v6.S b/arch/arm/mm/cache-v6.S index e46ecd847138..86aa689ef1aa 100644 --- a/arch/arm/mm/cache-v6.S +++ b/arch/arm/mm/cache-v6.S | |||
@@ -211,8 +211,9 @@ v6_dma_inv_range: | |||
211 | mcrne p15, 0, r1, c7, c15, 1 @ clean & invalidate unified line | 211 | mcrne p15, 0, r1, c7, c15, 1 @ clean & invalidate unified line |
212 | #endif | 212 | #endif |
213 | 1: | 213 | 1: |
214 | #ifdef CONFIG_SMP | 214 | #ifdef CONFIG_DMA_CACHE_RWFO |
215 | str r0, [r0] @ write for ownership | 215 | ldr r2, [r0] @ read for ownership |
216 | str r2, [r0] @ write for ownership | ||
216 | #endif | 217 | #endif |
217 | #ifdef HARVARD_CACHE | 218 | #ifdef HARVARD_CACHE |
218 | mcr p15, 0, r0, c7, c6, 1 @ invalidate D line | 219 | mcr p15, 0, r0, c7, c6, 1 @ invalidate D line |
@@ -234,7 +235,7 @@ v6_dma_inv_range: | |||
234 | v6_dma_clean_range: | 235 | v6_dma_clean_range: |
235 | bic r0, r0, #D_CACHE_LINE_SIZE - 1 | 236 | bic r0, r0, #D_CACHE_LINE_SIZE - 1 |
236 | 1: | 237 | 1: |
237 | #ifdef CONFIG_SMP | 238 | #ifdef CONFIG_DMA_CACHE_RWFO |
238 | ldr r2, [r0] @ read for ownership | 239 | ldr r2, [r0] @ read for ownership |
239 | #endif | 240 | #endif |
240 | #ifdef HARVARD_CACHE | 241 | #ifdef HARVARD_CACHE |
@@ -257,7 +258,7 @@ v6_dma_clean_range: | |||
257 | ENTRY(v6_dma_flush_range) | 258 | ENTRY(v6_dma_flush_range) |
258 | bic r0, r0, #D_CACHE_LINE_SIZE - 1 | 259 | bic r0, r0, #D_CACHE_LINE_SIZE - 1 |
259 | 1: | 260 | 1: |
260 | #ifdef CONFIG_SMP | 261 | #ifdef CONFIG_DMA_CACHE_RWFO |
261 | ldr r2, [r0] @ read for ownership | 262 | ldr r2, [r0] @ read for ownership |
262 | str r2, [r0] @ write for ownership | 263 | str r2, [r0] @ write for ownership |
263 | #endif | 264 | #endif |
@@ -283,9 +284,13 @@ ENTRY(v6_dma_map_area) | |||
283 | add r1, r1, r0 | 284 | add r1, r1, r0 |
284 | teq r2, #DMA_FROM_DEVICE | 285 | teq r2, #DMA_FROM_DEVICE |
285 | beq v6_dma_inv_range | 286 | beq v6_dma_inv_range |
287 | #ifndef CONFIG_DMA_CACHE_RWFO | ||
288 | b v6_dma_clean_range | ||
289 | #else | ||
286 | teq r2, #DMA_TO_DEVICE | 290 | teq r2, #DMA_TO_DEVICE |
287 | beq v6_dma_clean_range | 291 | beq v6_dma_clean_range |
288 | b v6_dma_flush_range | 292 | b v6_dma_flush_range |
293 | #endif | ||
289 | ENDPROC(v6_dma_map_area) | 294 | ENDPROC(v6_dma_map_area) |
290 | 295 | ||
291 | /* | 296 | /* |
@@ -295,6 +300,11 @@ ENDPROC(v6_dma_map_area) | |||
295 | * - dir - DMA direction | 300 | * - dir - DMA direction |
296 | */ | 301 | */ |
297 | ENTRY(v6_dma_unmap_area) | 302 | ENTRY(v6_dma_unmap_area) |
303 | #ifndef CONFIG_DMA_CACHE_RWFO | ||
304 | add r1, r1, r0 | ||
305 | teq r2, #DMA_TO_DEVICE | ||
306 | bne v6_dma_inv_range | ||
307 | #endif | ||
298 | mov pc, lr | 308 | mov pc, lr |
299 | ENDPROC(v6_dma_unmap_area) | 309 | ENDPROC(v6_dma_unmap_area) |
300 | 310 | ||