diff options
author | Leonid Yegoshin <Leonid.Yegoshin@imgtec.com> | 2014-01-15 09:47:28 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2014-03-26 18:09:19 -0400 |
commit | 4caa906ee949b7002cc1558bbe3744fbed188d1c (patch) | |
tree | 919133e88a3736c80b9d0362bc6758a42bf8bbdf /arch/mips/mm | |
parent | 0893d3fb8d27320d4301f14a0b331df291a08044 (diff) |
MIPS: mm: c-r4k: Build EVA {d,i}cache flushing functions
Build EVA specific cache flushing functions (ie cachee).
They will be used by a subsequent patch.
Signed-off-by: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Diffstat (limited to 'arch/mips/mm')
-rw-r--r-- | arch/mips/mm/c-r4k.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c index 6c37d21ef2fb..6332a9e84f01 100644 --- a/arch/mips/mm/c-r4k.c +++ b/arch/mips/mm/c-r4k.c | |||
@@ -123,6 +123,28 @@ static void r4k_blast_dcache_page_setup(void) | |||
123 | r4k_blast_dcache_page = r4k_blast_dcache_page_dc64; | 123 | r4k_blast_dcache_page = r4k_blast_dcache_page_dc64; |
124 | } | 124 | } |
125 | 125 | ||
126 | #ifndef CONFIG_EVA | ||
127 | #define r4k_blast_dcache_user_page r4k_blast_dcache_page | ||
128 | #else | ||
129 | |||
130 | static void (*r4k_blast_dcache_user_page)(unsigned long addr); | ||
131 | |||
132 | static void r4k_blast_dcache_user_page_setup(void) | ||
133 | { | ||
134 | unsigned long dc_lsize = cpu_dcache_line_size(); | ||
135 | |||
136 | if (dc_lsize == 0) | ||
137 | r4k_blast_dcache_user_page = (void *)cache_noop; | ||
138 | else if (dc_lsize == 16) | ||
139 | r4k_blast_dcache_user_page = blast_dcache16_user_page; | ||
140 | else if (dc_lsize == 32) | ||
141 | r4k_blast_dcache_user_page = blast_dcache32_user_page; | ||
142 | else if (dc_lsize == 64) | ||
143 | r4k_blast_dcache_user_page = blast_dcache64_user_page; | ||
144 | } | ||
145 | |||
146 | #endif | ||
147 | |||
126 | static void (* r4k_blast_dcache_page_indexed)(unsigned long addr); | 148 | static void (* r4k_blast_dcache_page_indexed)(unsigned long addr); |
127 | 149 | ||
128 | static void r4k_blast_dcache_page_indexed_setup(void) | 150 | static void r4k_blast_dcache_page_indexed_setup(void) |
@@ -245,6 +267,27 @@ static void r4k_blast_icache_page_setup(void) | |||
245 | r4k_blast_icache_page = blast_icache64_page; | 267 | r4k_blast_icache_page = blast_icache64_page; |
246 | } | 268 | } |
247 | 269 | ||
270 | #ifndef CONFIG_EVA | ||
271 | #define r4k_blast_icache_user_page r4k_blast_icache_page | ||
272 | #else | ||
273 | |||
274 | static void (*r4k_blast_icache_user_page)(unsigned long addr); | ||
275 | |||
276 | static void __cpuinit r4k_blast_icache_user_page_setup(void) | ||
277 | { | ||
278 | unsigned long ic_lsize = cpu_icache_line_size(); | ||
279 | |||
280 | if (ic_lsize == 0) | ||
281 | r4k_blast_icache_user_page = (void *)cache_noop; | ||
282 | else if (ic_lsize == 16) | ||
283 | r4k_blast_icache_user_page = blast_icache16_user_page; | ||
284 | else if (ic_lsize == 32) | ||
285 | r4k_blast_icache_user_page = blast_icache32_user_page; | ||
286 | else if (ic_lsize == 64) | ||
287 | r4k_blast_icache_user_page = blast_icache64_user_page; | ||
288 | } | ||
289 | |||
290 | #endif | ||
248 | 291 | ||
249 | static void (* r4k_blast_icache_page_indexed)(unsigned long addr); | 292 | static void (* r4k_blast_icache_page_indexed)(unsigned long addr); |
250 | 293 | ||
@@ -1468,6 +1511,10 @@ void r4k_cache_init(void) | |||
1468 | r4k_blast_scache_page_setup(); | 1511 | r4k_blast_scache_page_setup(); |
1469 | r4k_blast_scache_page_indexed_setup(); | 1512 | r4k_blast_scache_page_indexed_setup(); |
1470 | r4k_blast_scache_setup(); | 1513 | r4k_blast_scache_setup(); |
1514 | #ifdef CONFIG_EVA | ||
1515 | r4k_blast_dcache_user_page_setup(); | ||
1516 | r4k_blast_icache_user_page_setup(); | ||
1517 | #endif | ||
1471 | 1518 | ||
1472 | /* | 1519 | /* |
1473 | * Some MIPS32 and MIPS64 processors have physically indexed caches. | 1520 | * Some MIPS32 and MIPS64 processors have physically indexed caches. |