diff options
author | Sam Ravnborg <sam@ravnborg.org> | 2012-05-19 16:02:49 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-05-20 02:27:38 -0400 |
commit | accf032cfa582ed95da130b06241637659210edb (patch) | |
tree | c00308c452c4d680f15cd922d591b815b24f6fe8 /arch | |
parent | f6678d3b4107c2ea254f4f4c78dfd4e5dfe04d6a (diff) |
sparc32,leon: move leon mmu functions to leon_mm.c
We already have a leaon specific file - so
keep all the laon stuff in one place.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Konrad Eisele <konrad@gaisler.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/sparc/mm/leon_mm.c | 79 | ||||
-rw-r--r-- | arch/sparc/mm/srmmu.c | 83 | ||||
-rw-r--r-- | arch/sparc/mm/srmmu.h | 4 |
3 files changed, 85 insertions, 81 deletions
diff --git a/arch/sparc/mm/leon_mm.c b/arch/sparc/mm/leon_mm.c index 13c2169822a8..7e2bed737ef2 100644 --- a/arch/sparc/mm/leon_mm.c +++ b/arch/sparc/mm/leon_mm.c | |||
@@ -15,6 +15,8 @@ | |||
15 | #include <asm/leon.h> | 15 | #include <asm/leon.h> |
16 | #include <asm/tlbflush.h> | 16 | #include <asm/tlbflush.h> |
17 | 17 | ||
18 | #include "srmmu.h" | ||
19 | |||
18 | int leon_flush_during_switch = 1; | 20 | int leon_flush_during_switch = 1; |
19 | int srmmu_swprobe_trace; | 21 | int srmmu_swprobe_trace; |
20 | 22 | ||
@@ -258,3 +260,80 @@ void leon_switch_mm(void) | |||
258 | if (leon_flush_during_switch) | 260 | if (leon_flush_during_switch) |
259 | leon_flush_cache_all(); | 261 | leon_flush_cache_all(); |
260 | } | 262 | } |
263 | |||
264 | static void leon_flush_cache_mm(struct mm_struct *mm) | ||
265 | { | ||
266 | leon_flush_cache_all(); | ||
267 | } | ||
268 | |||
269 | static void leon_flush_cache_page(struct vm_area_struct *vma, unsigned long page) | ||
270 | { | ||
271 | leon_flush_pcache_all(vma, page); | ||
272 | } | ||
273 | |||
274 | static void leon_flush_cache_range(struct vm_area_struct *vma, | ||
275 | unsigned long start, | ||
276 | unsigned long end) | ||
277 | { | ||
278 | leon_flush_cache_all(); | ||
279 | } | ||
280 | |||
281 | static void leon_flush_tlb_mm(struct mm_struct *mm) | ||
282 | { | ||
283 | leon_flush_tlb_all(); | ||
284 | } | ||
285 | |||
286 | static void leon_flush_tlb_page(struct vm_area_struct *vma, | ||
287 | unsigned long page) | ||
288 | { | ||
289 | leon_flush_tlb_all(); | ||
290 | } | ||
291 | |||
292 | static void leon_flush_tlb_range(struct vm_area_struct *vma, | ||
293 | unsigned long start, | ||
294 | unsigned long end) | ||
295 | { | ||
296 | leon_flush_tlb_all(); | ||
297 | } | ||
298 | |||
299 | static void leon_flush_page_to_ram(unsigned long page) | ||
300 | { | ||
301 | leon_flush_cache_all(); | ||
302 | } | ||
303 | |||
304 | static void leon_flush_sig_insns(struct mm_struct *mm, unsigned long page) | ||
305 | { | ||
306 | leon_flush_cache_all(); | ||
307 | } | ||
308 | |||
309 | static void leon_flush_page_for_dma(unsigned long page) | ||
310 | { | ||
311 | leon_flush_dcache_all(); | ||
312 | } | ||
313 | |||
314 | void __init poke_leonsparc(void) | ||
315 | { | ||
316 | } | ||
317 | |||
318 | static const struct sparc32_cachetlb_ops leon_ops = { | ||
319 | .cache_all = leon_flush_cache_all, | ||
320 | .cache_mm = leon_flush_cache_mm, | ||
321 | .cache_page = leon_flush_cache_page, | ||
322 | .cache_range = leon_flush_cache_range, | ||
323 | .tlb_all = leon_flush_tlb_all, | ||
324 | .tlb_mm = leon_flush_tlb_mm, | ||
325 | .tlb_page = leon_flush_tlb_page, | ||
326 | .tlb_range = leon_flush_tlb_range, | ||
327 | .page_to_ram = leon_flush_page_to_ram, | ||
328 | .sig_insns = leon_flush_sig_insns, | ||
329 | .page_for_dma = leon_flush_page_for_dma, | ||
330 | }; | ||
331 | |||
332 | void __init init_leon(void) | ||
333 | { | ||
334 | srmmu_name = "LEON"; | ||
335 | sparc32_cachetlb_ops = &leon_ops; | ||
336 | poke_srmmu = poke_leonsparc; | ||
337 | |||
338 | leon_flush_during_switch = leon_flush_needed(); | ||
339 | } | ||
diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c index 4875fcd8fd7a..a02c56a4bdfb 100644 --- a/arch/sparc/mm/srmmu.c +++ b/arch/sparc/mm/srmmu.c | |||
@@ -48,6 +48,8 @@ | |||
48 | #include <asm/turbosparc.h> | 48 | #include <asm/turbosparc.h> |
49 | #include <asm/leon.h> | 49 | #include <asm/leon.h> |
50 | 50 | ||
51 | #include "srmmu.h" | ||
52 | |||
51 | enum mbus_module srmmu_modtype; | 53 | enum mbus_module srmmu_modtype; |
52 | static unsigned int hwbug_bitmask; | 54 | static unsigned int hwbug_bitmask; |
53 | int vac_cache_size; | 55 | int vac_cache_size; |
@@ -1479,87 +1481,6 @@ static void __init init_viking(void) | |||
1479 | poke_srmmu = poke_viking; | 1481 | poke_srmmu = poke_viking; |
1480 | } | 1482 | } |
1481 | 1483 | ||
1482 | #ifdef CONFIG_SPARC_LEON | ||
1483 | static void leon_flush_cache_mm(struct mm_struct *mm) | ||
1484 | { | ||
1485 | leon_flush_cache_all(); | ||
1486 | } | ||
1487 | |||
1488 | static void leon_flush_cache_page(struct vm_area_struct *vma, unsigned long page) | ||
1489 | { | ||
1490 | leon_flush_pcache_all(vma, page); | ||
1491 | } | ||
1492 | |||
1493 | static void leon_flush_cache_range(struct vm_area_struct *vma, | ||
1494 | unsigned long start, | ||
1495 | unsigned long end) | ||
1496 | { | ||
1497 | leon_flush_cache_all(); | ||
1498 | } | ||
1499 | |||
1500 | static void leon_flush_tlb_mm(struct mm_struct *mm) | ||
1501 | { | ||
1502 | leon_flush_tlb_all(); | ||
1503 | } | ||
1504 | |||
1505 | static void leon_flush_tlb_page(struct vm_area_struct *vma, | ||
1506 | unsigned long page) | ||
1507 | { | ||
1508 | leon_flush_tlb_all(); | ||
1509 | } | ||
1510 | |||
1511 | static void leon_flush_tlb_range(struct vm_area_struct *vma, | ||
1512 | unsigned long start, | ||
1513 | unsigned long end) | ||
1514 | { | ||
1515 | leon_flush_tlb_all(); | ||
1516 | } | ||
1517 | |||
1518 | static void leon_flush_page_to_ram(unsigned long page) | ||
1519 | { | ||
1520 | leon_flush_cache_all(); | ||
1521 | } | ||
1522 | |||
1523 | static void leon_flush_sig_insns(struct mm_struct *mm, unsigned long page) | ||
1524 | { | ||
1525 | leon_flush_cache_all(); | ||
1526 | } | ||
1527 | |||
1528 | static void leon_flush_page_for_dma(unsigned long page) | ||
1529 | { | ||
1530 | leon_flush_dcache_all(); | ||
1531 | } | ||
1532 | |||
1533 | void __init poke_leonsparc(void) | ||
1534 | { | ||
1535 | } | ||
1536 | |||
1537 | static const struct sparc32_cachetlb_ops leon_ops = { | ||
1538 | .cache_all = leon_flush_cache_all, | ||
1539 | .cache_mm = leon_flush_cache_mm, | ||
1540 | .cache_page = leon_flush_cache_page, | ||
1541 | .cache_range = leon_flush_cache_range, | ||
1542 | .tlb_all = leon_flush_tlb_all, | ||
1543 | .tlb_mm = leon_flush_tlb_mm, | ||
1544 | .tlb_page = leon_flush_tlb_page, | ||
1545 | .tlb_range = leon_flush_tlb_range, | ||
1546 | .page_to_ram = leon_flush_page_to_ram, | ||
1547 | .sig_insns = leon_flush_sig_insns, | ||
1548 | .page_for_dma = leon_flush_page_for_dma, | ||
1549 | }; | ||
1550 | |||
1551 | void __init init_leon(void) | ||
1552 | { | ||
1553 | srmmu_name = "LEON"; | ||
1554 | sparc32_cachetlb_ops = &leon_ops; | ||
1555 | poke_srmmu = poke_leonsparc; | ||
1556 | |||
1557 | srmmu_cache_pagetables = 0; | ||
1558 | |||
1559 | leon_flush_during_switch = leon_flush_needed(); | ||
1560 | } | ||
1561 | #endif | ||
1562 | |||
1563 | /* Probe for the srmmu chip version. */ | 1484 | /* Probe for the srmmu chip version. */ |
1564 | static void __init get_srmmu_type(void) | 1485 | static void __init get_srmmu_type(void) |
1565 | { | 1486 | { |
diff --git a/arch/sparc/mm/srmmu.h b/arch/sparc/mm/srmmu.h new file mode 100644 index 000000000000..5703274ccf89 --- /dev/null +++ b/arch/sparc/mm/srmmu.h | |||
@@ -0,0 +1,4 @@ | |||
1 | /* srmmu.c */ | ||
2 | extern char *srmmu_name; | ||
3 | |||
4 | extern void (*poke_srmmu)(void); | ||