1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * linux/arch/arm/mm/cache-v4.S
5 * Copyright (C) 1997-2002 Russell king
7 #include <linux/linkage.h>
8 #include <linux/init.h>
9 #include <asm/assembler.h>
11 #include "proc-macros.S"
16 * Unconditionally clean and invalidate the entire icache.
18 ENTRY(v4_flush_icache_all)
20 ENDPROC(v4_flush_icache_all)
23 * flush_user_cache_all()
25 * Invalidate all cache entries in a particular address
28 * - mm - mm_struct describing address space
30 ENTRY(v4_flush_user_cache_all)
33 * flush_kern_cache_all()
35 * Clean and invalidate the entire cache.
37 ENTRY(v4_flush_kern_cache_all)
38 #ifdef CONFIG_CPU_CP15
40 mcr p15, 0, r0, c7, c7, 0 @ flush ID cache
47 * flush_user_cache_range(start, end, flags)
49 * Invalidate a range of cache entries in the specified
52 * - start - start address (may not be aligned)
53 * - end - end address (exclusive, may not be aligned)
54 * - flags - vma_area_struct flags describing address space
56 ENTRY(v4_flush_user_cache_range)
57 #ifdef CONFIG_CPU_CP15
59 mcr p15, 0, ip, c7, c7, 0 @ flush ID cache
66 * coherent_kern_range(start, end)
68 * Ensure coherency between the Icache and the Dcache in the
69 * region described by start. If you have non-snooping
70 * Harvard caches, you need to implement this function.
72 * - start - virtual start address
73 * - end - virtual end address
75 ENTRY(v4_coherent_kern_range)
79 * coherent_user_range(start, end)
81 * Ensure coherency between the Icache and the Dcache in the
82 * region described by start. If you have non-snooping
83 * Harvard caches, you need to implement this function.
85 * - start - virtual start address
86 * - end - virtual end address
88 ENTRY(v4_coherent_user_range)
93 * flush_kern_dcache_area(void *addr, size_t size)
95 * Ensure no D cache aliasing occurs, either with itself or
98 * - addr - kernel address
99 * - size - region size
101 ENTRY(v4_flush_kern_dcache_area)
105 * dma_flush_range(start, end)
107 * Clean and invalidate the specified virtual address range.
109 * - start - virtual start address
110 * - end - virtual end address
112 ENTRY(v4_dma_flush_range)
113 #ifdef CONFIG_CPU_CP15
115 mcr p15, 0, r0, c7, c7, 0 @ flush ID cache
120 * dma_unmap_area(start, size, dir)
121 * - start - kernel virtual start address
122 * - size - size of region
123 * - dir - DMA direction
125 ENTRY(v4_dma_unmap_area)
126 teq r2, #DMA_TO_DEVICE
127 bne v4_dma_flush_range
131 * dma_map_area(start, size, dir)
132 * - start - kernel virtual start address
133 * - size - size of region
134 * - dir - DMA direction
136 ENTRY(v4_dma_map_area)
138 ENDPROC(v4_dma_unmap_area)
139 ENDPROC(v4_dma_map_area)
141 .globl v4_flush_kern_cache_louis
142 .equ v4_flush_kern_cache_louis, v4_flush_kern_cache_all
146 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)
147 define_cache_functions v4