Lines Matching +full:d +full:- +full:cache +full:- +full:size
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * linux/arch/arm/mm/arm946.S: utility functions for ARM946E-S
5 * Copyright (C) 2004-2006 Hyok S. Choi (hyok.choi@samsung.com)
7 * (Many of cache codes are from proc-arm926.S)
14 #include <asm/pgtable-hwdef.h>
16 #include "proc-macros.S"
19 * ARM946E-S is synthesizable to have 0KB to 1MB sized D-Cache,
44 bic r0, r0, #0x00001000 @ i-cache
45 bic r0, r0, #0x00000004 @ d-cache
57 mcr p15, 0, ip, c7, c5, 0 @ flush I cache
58 mcr p15, 0, ip, c7, c6, 0 @ flush D cache
62 bic ip, ip, #0x00001000 @ i-cache
83 mcr p15, 0, r0, c7, c5, 0 @ invalidate I cache
96 * Clean and invalidate the entire cache.
103 mcr p15, 0, ip, c7, c6, 0 @ flush D cache
105 mov r1, #(CACHE_DSEGMENTS - 1) << 29 @ 4 segments
106 1: orr r3, r1, #(CACHE_DENTRIES - 1) << 4 @ n entries
107 2: mcr p15, 0, r3, c7, c14, 2 @ clean/flush D index
114 mcrne p15, 0, ip, c7, c5, 0 @ flush I cache
121 * Clean and invalidate a range of cache entries in the
124 * - start - start address (inclusive)
125 * - end - end address (exclusive)
126 * - flags - vm_flags describing address space
131 sub r3, r1, r0 @ calculate total size
137 mcr p15, 0, r0, c7, c6, 1 @ invalidate D entry
140 mcr p15, 0, r0, c7, c6, 1 @ invalidate D entry
144 mcr p15, 0, r0, c7, c14, 1 @ clean and invalidate D entry
147 mcr p15, 0, r0, c7, c14, 1 @ clean and invalidate D entry
161 * region described by start, end. If you have non-snooping
164 * - start - virtual start address
165 * - end - virtual end address
174 * region described by start, end. If you have non-snooping
177 * - start - virtual start address
178 * - end - virtual end address
182 bic r0, r0, #CACHE_DLINESIZE - 1
183 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
193 * flush_kern_dcache_area(void *addr, size_t size)
195 * Ensure no D cache aliasing occurs, either with itself or
196 * the I cache
198 * - addr - kernel address
199 * - size - region size
204 1: mcr p15, 0, r0, c7, c14, 1 @ clean+invalidate D entry
209 mcr p15, 0, r0, c7, c5, 0 @ invalidate I cache
218 * are not cache line aligned, those lines must be written
221 * - start - virtual start address
222 * - end - virtual end address
227 tst r0, #CACHE_DLINESIZE - 1
228 mcrne p15, 0, r0, c7, c10, 1 @ clean D entry
229 tst r1, #CACHE_DLINESIZE - 1
230 mcrne p15, 0, r1, c7, c10, 1 @ clean D entry
232 bic r0, r0, #CACHE_DLINESIZE - 1
233 1: mcr p15, 0, r0, c7, c6, 1 @ invalidate D entry
245 * - start - virtual start address
246 * - end - virtual end address
252 bic r0, r0, #CACHE_DLINESIZE - 1
253 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
266 * - start - virtual start address
267 * - end - virtual end address
272 bic r0, r0, #CACHE_DLINESIZE - 1
275 mcr p15, 0, r0, c7, c14, 1 @ clean+invalidate D entry
277 mcr p15, 0, r0, c7, c6, 1 @ invalidate D entry
286 * dma_map_area(start, size, dir)
287 * - start - kernel virtual start address
288 * - size - size of region
289 * - dir - DMA direction
300 * dma_unmap_area(start, size, dir)
301 * - start - kernel virtual start address
302 * - size - size of region
303 * - dir - DMA direction
312 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)
317 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
328 mcr p15, 0, r0, c7, c5, 0 @ invalidate I cache
329 mcr p15, 0, r0, c7, c6, 0 @ invalidate D cache
338 mov r0, #0x0000003F @ base = 0, size = 4GB
342 ldr r7, =CONFIG_DRAM_SIZE @ size of RAM (must be >= 4KB)
347 ldr r7, =CONFIG_FLASH_SIZE @ size of FLASH (must be >= 4KB)
352 mcr p15, 0, r0, c2, c0, 0 @ region 1,2 d-cacheable
353 mcr p15, 0, r0, c2, c0, 1 @ region 1,2 i-cacheable
365 * region 0 (whole) rw -- : b0001
367 * region 2 (FLASH) rw r- : b0010
368 * region 3~7 (none) -- -- : b0000
376 orr r0, r0, #0x00001000 @ I-cache
377 orr r0, r0, #0x00000005 @ MPU/D-cache
383 .size __arm946_setup, . - __arm946_setup
387 @ define struct processor (see <asm/proc-fns.h> and proc-macros.S)
394 string cpu_arm946_name, "ARM946E-S"
414 .size __arm946_proc_info, . - __arm946_proc_info