# BRCM_VERSION=3
[bcm963xx.git] / kernel / linux / arch / arm / mm / cache-v3.S
1 /*
2  *  linux/arch/arm/mm/cache-v3.S
3  *
4  *  Copyright (C) 1997-2002 Russell king
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  */
10 #include <linux/linkage.h>
11 #include <linux/init.h>
12 #include <asm/hardware.h>
13 #include <asm/page.h>
14 #include "proc-macros.S"
15
16 /*
17  *      flush_user_cache_all()
18  *
19  *      Invalidate all cache entries in a particular address
20  *      space.
21  *
22  *      - mm    - mm_struct describing address space
23  */
24 ENTRY(v3_flush_user_cache_all)
25         /* FALLTHROUGH */
26 /*
27  *      flush_kern_cache_all()
28  *
29  *      Clean and invalidate the entire cache.
30  */
31 ENTRY(v3_flush_kern_cache_all)
32         /* FALLTHROUGH */
33
34 /*
35  *      flush_user_cache_range(start, end, flags)
36  *
37  *      Invalidate a range of cache entries in the specified
38  *      address space.
39  *
40  *      - start - start address (may not be aligned)
41  *      - end   - end address (exclusive, may not be aligned)
42  *      - flags - vma_area_struct flags describing address space
43  */
44 ENTRY(v3_flush_user_cache_range)
45         mov     ip, #0
46         mcreq   p15, 0, ip, c7, c0, 0           @ flush ID cache
47         mov     pc, lr
48
49 /*
50  *      coherent_kern_range(start, end)
51  *
52  *      Ensure coherency between the Icache and the Dcache in the
53  *      region described by start.  If you have non-snooping
54  *      Harvard caches, you need to implement this function.
55  *
56  *      - start  - virtual start address
57  *      - end    - virtual end address
58  */
59 ENTRY(v3_coherent_kern_range)
60         mov     pc, lr
61
62 /*
63  *      flush_kern_dcache_page(void *page)
64  *
65  *      Ensure no D cache aliasing occurs, either with itself or
66  *      the I cache
67  *
68  *      - addr  - page aligned address
69  */
70 ENTRY(v3_flush_kern_dcache_page)
71         /* FALLTHROUGH */
72
73 /*
74  *      dma_inv_range(start, end)
75  *
76  *      Invalidate (discard) the specified virtual address range.
77  *      May not write back any entries.  If 'start' or 'end'
78  *      are not cache line aligned, those lines must be written
79  *      back.
80  *
81  *      - start  - virtual start address
82  *      - end    - virtual end address
83  */
84 ENTRY(v3_dma_inv_range)
85         /* FALLTHROUGH */
86
87 /*
88  *      dma_flush_range(start, end)
89  *
90  *      Clean and invalidate the specified virtual address range.
91  *
92  *      - start  - virtual start address
93  *      - end    - virtual end address
94  */
95 ENTRY(v3_dma_flush_range)
96         mov     r0, #0
97         mcr     p15, 0, r0, c7, c0, 0           @ flush ID cache
98         /* FALLTHROUGH */
99
100 /*
101  *      dma_clean_range(start, end)
102  *
103  *      Clean (write back) the specified virtual address range.
104  *
105  *      - start  - virtual start address
106  *      - end    - virtual end address
107  */
108 ENTRY(v3_dma_clean_range)
109         mov     pc, lr
110
111         __INITDATA
112
113         .type   v3_cache_fns, #object
114 ENTRY(v3_cache_fns)
115         .long   v3_flush_kern_cache_all
116         .long   v3_flush_user_cache_all
117         .long   v3_flush_user_cache_range
118         .long   v3_coherent_kern_range
119         .long   v3_flush_kern_dcache_page
120         .long   v3_dma_inv_range
121         .long   v3_dma_clean_range
122         .long   v3_dma_flush_range
123         .size   v3_cache_fns, . - v3_cache_fns