diff options
-rw-r--r-- | arch/sh/drivers/dma/Kconfig | 17 | ||||
-rw-r--r-- | arch/sh/mm/Makefile | 4 | ||||
-rw-r--r-- | arch/sh/mm/pg-dma.c | 95 |
3 files changed, 1 insertions, 115 deletions
diff --git a/arch/sh/drivers/dma/Kconfig b/arch/sh/drivers/dma/Kconfig index 99935f9daf4b..333898077c7c 100644 --- a/arch/sh/drivers/dma/Kconfig +++ b/arch/sh/drivers/dma/Kconfig | |||
@@ -36,23 +36,6 @@ config NR_DMA_CHANNELS | |||
36 | support. Setting this to a higher value allows for cascading DMACs | 36 | support. Setting this to a higher value allows for cascading DMACs |
37 | with additional channels. | 37 | with additional channels. |
38 | 38 | ||
39 | config DMA_PAGE_OPS | ||
40 | bool "Use DMAC for page copy/clear" | ||
41 | depends on SH_DMA && BROKEN | ||
42 | help | ||
43 | Selecting this option will use a dual-address mode configured channel | ||
44 | in the SH DMAC for copy_page()/clear_page(). Primarily a performance | ||
45 | hack. | ||
46 | |||
47 | config DMA_PAGE_OPS_CHANNEL | ||
48 | depends on DMA_PAGE_OPS | ||
49 | int "DMA channel for sh memory-manager page copy/clear" | ||
50 | default "3" | ||
51 | help | ||
52 | This allows the specification of the dual address dma channel, | ||
53 | in case channel 3 is unavailable. On the SH4, channels 1,2, and 3 | ||
54 | are dual-address capable. | ||
55 | |||
56 | config SH_DMABRG | 39 | config SH_DMABRG |
57 | bool "SH7760 DMABRG support" | 40 | bool "SH7760 DMABRG support" |
58 | depends on CPU_SUBTYPE_SH7760 | 41 | depends on CPU_SUBTYPE_SH7760 |
diff --git a/arch/sh/mm/Makefile b/arch/sh/mm/Makefile index 47c330c528db..d677d7f3afc1 100644 --- a/arch/sh/mm/Makefile +++ b/arch/sh/mm/Makefile | |||
@@ -8,9 +8,6 @@ obj-$(CONFIG_CPU_SH2) += cache-sh2.o | |||
8 | obj-$(CONFIG_CPU_SH3) += cache-sh3.o | 8 | obj-$(CONFIG_CPU_SH3) += cache-sh3.o |
9 | obj-$(CONFIG_CPU_SH4) += cache-sh4.o | 9 | obj-$(CONFIG_CPU_SH4) += cache-sh4.o |
10 | 10 | ||
11 | obj-$(CONFIG_DMA_PAGE_OPS) += pg-dma.o | ||
12 | obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o | ||
13 | |||
14 | mmu-y := fault-nommu.o tlb-nommu.o pg-nommu.o | 11 | mmu-y := fault-nommu.o tlb-nommu.o pg-nommu.o |
15 | mmu-$(CONFIG_MMU) := fault.o clear_page.o copy_page.o tlb-flush.o \ | 12 | mmu-$(CONFIG_MMU) := fault.o clear_page.o copy_page.o tlb-flush.o \ |
16 | ioremap.o | 13 | ioremap.o |
@@ -27,6 +24,7 @@ obj-$(CONFIG_CPU_SH4) += tlb-sh4.o pg-sh4.o | |||
27 | obj-$(CONFIG_SH7705_CACHE_32KB) += pg-sh7705.o | 24 | obj-$(CONFIG_SH7705_CACHE_32KB) += pg-sh7705.o |
28 | endif | 25 | endif |
29 | 26 | ||
27 | obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o | ||
30 | obj-$(CONFIG_SH7705_CACHE_32KB) += cache-sh7705.o | 28 | obj-$(CONFIG_SH7705_CACHE_32KB) += cache-sh7705.o |
31 | obj-$(CONFIG_32BIT) += pmb.o | 29 | obj-$(CONFIG_32BIT) += pmb.o |
32 | obj-$(CONFIG_NUMA) += numa.o | 30 | obj-$(CONFIG_NUMA) += numa.o |
diff --git a/arch/sh/mm/pg-dma.c b/arch/sh/mm/pg-dma.c deleted file mode 100644 index bb23679369d6..000000000000 --- a/arch/sh/mm/pg-dma.c +++ /dev/null | |||
@@ -1,95 +0,0 @@ | |||
1 | /* | ||
2 | * arch/sh/mm/pg-dma.c | ||
3 | * | ||
4 | * Fast clear_page()/copy_page() implementation using the SH DMAC | ||
5 | * | ||
6 | * Copyright (C) 2003 Paul Mundt | ||
7 | * | ||
8 | * This file is subject to the terms and conditions of the GNU General Public | ||
9 | * License. See the file "COPYING" in the main directory of this archive | ||
10 | * for more details. | ||
11 | */ | ||
12 | #include <linux/init.h> | ||
13 | #include <linux/kernel.h> | ||
14 | #include <linux/module.h> | ||
15 | #include <asm/semaphore.h> | ||
16 | #include <asm/mmu_context.h> | ||
17 | #include <asm/addrspace.h> | ||
18 | #include <asm/atomic.h> | ||
19 | #include <asm/page.h> | ||
20 | #include <asm/dma.h> | ||
21 | #include <asm/io.h> | ||
22 | |||
23 | /* Channel to use for page ops, must be dual-address mode capable. */ | ||
24 | static int dma_channel = CONFIG_DMA_PAGE_OPS_CHANNEL; | ||
25 | |||
26 | static void copy_page_dma(void *to, void *from) | ||
27 | { | ||
28 | /* | ||
29 | * This doesn't seem to get triggered until further along in the | ||
30 | * boot process, at which point the DMAC is already initialized. | ||
31 | * Fix this in the same fashion as clear_page_dma() in the event | ||
32 | * that this crashes due to the DMAC not being initialized. | ||
33 | */ | ||
34 | |||
35 | flush_icache_range((unsigned long)from, PAGE_SIZE); | ||
36 | dma_write_page(dma_channel, (unsigned long)from, (unsigned long)to); | ||
37 | dma_wait_for_completion(dma_channel); | ||
38 | } | ||
39 | |||
40 | static void clear_page_dma(void *to) | ||
41 | { | ||
42 | /* | ||
43 | * We get invoked quite early on, if the DMAC hasn't been initialized | ||
44 | * yet, fall back on the slow manual implementation. | ||
45 | */ | ||
46 | if (dma_info[dma_channel].chan != dma_channel) { | ||
47 | clear_page_slow(to); | ||
48 | return; | ||
49 | } | ||
50 | |||
51 | dma_write_page(dma_channel, (unsigned long)empty_zero_page, | ||
52 | (unsigned long)to); | ||
53 | |||
54 | /* | ||
55 | * FIXME: Something is a bit racy here, if we poll the counter right | ||
56 | * away, we seem to lock. flushing the page from the dcache doesn't | ||
57 | * seem to make a difference one way or the other, though either a full | ||
58 | * icache or dcache flush does. | ||
59 | * | ||
60 | * The location of this is important as well, and must happen prior to | ||
61 | * the completion loop but after the transfer was initiated. | ||
62 | * | ||
63 | * Oddly enough, this doesn't appear to be an issue for copy_page().. | ||
64 | */ | ||
65 | flush_icache_range((unsigned long)to, PAGE_SIZE); | ||
66 | |||
67 | dma_wait_for_completion(dma_channel); | ||
68 | } | ||
69 | |||
70 | static int __init pg_dma_init(void) | ||
71 | { | ||
72 | int ret; | ||
73 | |||
74 | ret = request_dma(dma_channel, "page ops"); | ||
75 | if (ret != 0) | ||
76 | return ret; | ||
77 | |||
78 | copy_page = copy_page_dma; | ||
79 | clear_page = clear_page_dma; | ||
80 | |||
81 | return ret; | ||
82 | } | ||
83 | |||
84 | static void __exit pg_dma_exit(void) | ||
85 | { | ||
86 | free_dma(dma_channel); | ||
87 | } | ||
88 | |||
89 | module_init(pg_dma_init); | ||
90 | module_exit(pg_dma_exit); | ||
91 | |||
92 | MODULE_AUTHOR("Paul Mundt <lethal@linux-sh.org>"); | ||
93 | MODULE_DESCRIPTION("Optimized page copy/clear routines using a dual-address mode capable DMAC channel"); | ||
94 | MODULE_LICENSE("GPL"); | ||
95 | |||