diff options
Diffstat (limited to 'arch/arm/mm/cache-v6.S')
-rw-r--r-- | arch/arm/mm/cache-v6.S | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/arch/arm/mm/cache-v6.S b/arch/arm/mm/cache-v6.S index 4ba0a24ce6f5..9d89c67a1cc3 100644 --- a/arch/arm/mm/cache-v6.S +++ b/arch/arm/mm/cache-v6.S | |||
@@ -195,7 +195,7 @@ ENTRY(v6_flush_kern_dcache_area) | |||
195 | * - start - virtual start address of region | 195 | * - start - virtual start address of region |
196 | * - end - virtual end address of region | 196 | * - end - virtual end address of region |
197 | */ | 197 | */ |
198 | ENTRY(v6_dma_inv_range) | 198 | v6_dma_inv_range: |
199 | tst r0, #D_CACHE_LINE_SIZE - 1 | 199 | tst r0, #D_CACHE_LINE_SIZE - 1 |
200 | bic r0, r0, #D_CACHE_LINE_SIZE - 1 | 200 | bic r0, r0, #D_CACHE_LINE_SIZE - 1 |
201 | #ifdef HARVARD_CACHE | 201 | #ifdef HARVARD_CACHE |
@@ -228,7 +228,7 @@ ENTRY(v6_dma_inv_range) | |||
228 | * - start - virtual start address of region | 228 | * - start - virtual start address of region |
229 | * - end - virtual end address of region | 229 | * - end - virtual end address of region |
230 | */ | 230 | */ |
231 | ENTRY(v6_dma_clean_range) | 231 | v6_dma_clean_range: |
232 | bic r0, r0, #D_CACHE_LINE_SIZE - 1 | 232 | bic r0, r0, #D_CACHE_LINE_SIZE - 1 |
233 | 1: | 233 | 1: |
234 | #ifdef HARVARD_CACHE | 234 | #ifdef HARVARD_CACHE |
@@ -263,6 +263,32 @@ ENTRY(v6_dma_flush_range) | |||
263 | mcr p15, 0, r0, c7, c10, 4 @ drain write buffer | 263 | mcr p15, 0, r0, c7, c10, 4 @ drain write buffer |
264 | mov pc, lr | 264 | mov pc, lr |
265 | 265 | ||
266 | /* | ||
267 | * dma_map_area(start, size, dir) | ||
268 | * - start - kernel virtual start address | ||
269 | * - size - size of region | ||
270 | * - dir - DMA direction | ||
271 | */ | ||
272 | ENTRY(v6_dma_map_area) | ||
273 | add r1, r1, r0 | ||
274 | teq r2, #DMA_FROM_DEVICE | ||
275 | beq v6_dma_inv_range | ||
276 | b v6_dma_clean_range | ||
277 | ENDPROC(v6_dma_map_area) | ||
278 | |||
279 | /* | ||
280 | * dma_unmap_area(start, size, dir) | ||
281 | * - start - kernel virtual start address | ||
282 | * - size - size of region | ||
283 | * - dir - DMA direction | ||
284 | */ | ||
285 | ENTRY(v6_dma_unmap_area) | ||
286 | add r1, r1, r0 | ||
287 | teq r2, #DMA_TO_DEVICE | ||
288 | bne v6_dma_inv_range | ||
289 | mov pc, lr | ||
290 | ENDPROC(v6_dma_unmap_area) | ||
291 | |||
266 | __INITDATA | 292 | __INITDATA |
267 | 293 | ||
268 | .type v6_cache_fns, #object | 294 | .type v6_cache_fns, #object |
@@ -273,7 +299,7 @@ ENTRY(v6_cache_fns) | |||
273 | .long v6_coherent_kern_range | 299 | .long v6_coherent_kern_range |
274 | .long v6_coherent_user_range | 300 | .long v6_coherent_user_range |
275 | .long v6_flush_kern_dcache_area | 301 | .long v6_flush_kern_dcache_area |
276 | .long v6_dma_inv_range | 302 | .long v6_dma_map_area |
277 | .long v6_dma_clean_range | 303 | .long v6_dma_unmap_area |
278 | .long v6_dma_flush_range | 304 | .long v6_dma_flush_range |
279 | .size v6_cache_fns, . - v6_cache_fns | 305 | .size v6_cache_fns, . - v6_cache_fns |