diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-08 10:57:17 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-08 10:57:17 -0400 |
commit | 35d1bc90546d1f0af198886ae8062a550142d926 (patch) | |
tree | 5aa33046f09436fa292cdcdf6e6db138db6cf58a /arch | |
parent | 1d6757fbff5bc86e94e59ab0d7bdd7e71351d839 (diff) | |
parent | f8f98a9335db4a7d6285b785180fad720bf22864 (diff) |
Automatic merge of master.kernel.org:/home/rmk/linux-2.6-arm
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/boot/compressed/head-xscale.S | 7 | ||||
-rw-r--r-- | arch/arm/mach-pxa/mainstone.c | 9 | ||||
-rw-r--r-- | arch/arm/mach-pxa/pm.c | 32 | ||||
-rw-r--r-- | arch/arm/mach-pxa/pxa25x.c | 29 | ||||
-rw-r--r-- | arch/arm/mach-pxa/pxa27x.c | 32 | ||||
-rw-r--r-- | arch/arm/mach-s3c2410/dma.c | 4 | ||||
-rw-r--r-- | arch/arm/mm/Kconfig | 7 | ||||
-rw-r--r-- | arch/arm/mm/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/mm/copypage-xscale.S | 113 | ||||
-rw-r--r-- | arch/arm/mm/copypage-xscale.c | 131 | ||||
-rw-r--r-- | arch/arm/mm/minicache.c | 73 |
11 files changed, 230 insertions, 209 deletions
diff --git a/arch/arm/boot/compressed/head-xscale.S b/arch/arm/boot/compressed/head-xscale.S index 665bd2c2074..d3fe2533907 100644 --- a/arch/arm/boot/compressed/head-xscale.S +++ b/arch/arm/boot/compressed/head-xscale.S | |||
@@ -47,3 +47,10 @@ __XScale_start: | |||
47 | orr r7, r7, #(MACH_TYPE_GTWX5715 & 0xff00) | 47 | orr r7, r7, #(MACH_TYPE_GTWX5715 & 0xff00) |
48 | #endif | 48 | #endif |
49 | 49 | ||
50 | #ifdef CONFIG_ARCH_IXP2000 | ||
51 | mov r1, #-1 | ||
52 | mov r0, #0xd6000000 | ||
53 | str r1, [r0, #0x14] | ||
54 | str r1, [r0, #0x18] | ||
55 | #endif | ||
56 | |||
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c index 3f952237ae3..6823ae28ae6 100644 --- a/arch/arm/mach-pxa/mainstone.c +++ b/arch/arm/mach-pxa/mainstone.c | |||
@@ -304,6 +304,15 @@ static void __init mainstone_map_io(void) | |||
304 | PWER = 0xC0000002; | 304 | PWER = 0xC0000002; |
305 | PRER = 0x00000002; | 305 | PRER = 0x00000002; |
306 | PFER = 0x00000002; | 306 | PFER = 0x00000002; |
307 | /* for use I SRAM as framebuffer. */ | ||
308 | PSLR |= 0xF04; | ||
309 | PCFR = 0x66; | ||
310 | /* For Keypad wakeup. */ | ||
311 | KPC &=~KPC_ASACT; | ||
312 | KPC |=KPC_AS; | ||
313 | PKWR = 0x000FD000; | ||
314 | /* Need read PKWR back after set it. */ | ||
315 | PKWR; | ||
307 | } | 316 | } |
308 | 317 | ||
309 | MACHINE_START(MAINSTONE, "Intel HCDDBBVA0 Development Platform (aka Mainstone)") | 318 | MACHINE_START(MAINSTONE, "Intel HCDDBBVA0 Development Platform (aka Mainstone)") |
diff --git a/arch/arm/mach-pxa/pm.c b/arch/arm/mach-pxa/pm.c index 82a4bf34c25..9799fe80df2 100644 --- a/arch/arm/mach-pxa/pm.c +++ b/arch/arm/mach-pxa/pm.c | |||
@@ -29,9 +29,6 @@ | |||
29 | */ | 29 | */ |
30 | #undef DEBUG | 30 | #undef DEBUG |
31 | 31 | ||
32 | extern void pxa_cpu_suspend(void); | ||
33 | extern void pxa_cpu_resume(void); | ||
34 | |||
35 | #define SAVE(x) sleep_save[SLEEP_SAVE_##x] = x | 32 | #define SAVE(x) sleep_save[SLEEP_SAVE_##x] = x |
36 | #define RESTORE(x) x = sleep_save[SLEEP_SAVE_##x] | 33 | #define RESTORE(x) x = sleep_save[SLEEP_SAVE_##x] |
37 | 34 | ||
@@ -63,6 +60,12 @@ enum { SLEEP_SAVE_START = 0, | |||
63 | SLEEP_SAVE_ICMR, | 60 | SLEEP_SAVE_ICMR, |
64 | SLEEP_SAVE_CKEN, | 61 | SLEEP_SAVE_CKEN, |
65 | 62 | ||
63 | #ifdef CONFIG_PXA27x | ||
64 | SLEEP_SAVE_MDREFR, | ||
65 | SLEEP_SAVE_PWER, SLEEP_SAVE_PCFR, SLEEP_SAVE_PRER, | ||
66 | SLEEP_SAVE_PFER, SLEEP_SAVE_PKWR, | ||
67 | #endif | ||
68 | |||
66 | SLEEP_SAVE_CKSUM, | 69 | SLEEP_SAVE_CKSUM, |
67 | 70 | ||
68 | SLEEP_SAVE_SIZE | 71 | SLEEP_SAVE_SIZE |
@@ -75,9 +78,7 @@ static int pxa_pm_enter(suspend_state_t state) | |||
75 | unsigned long checksum = 0; | 78 | unsigned long checksum = 0; |
76 | struct timespec delta, rtc; | 79 | struct timespec delta, rtc; |
77 | int i; | 80 | int i; |
78 | 81 | extern void pxa_cpu_pm_enter(suspend_state_t state); | |
79 | if (state != PM_SUSPEND_MEM) | ||
80 | return -EINVAL; | ||
81 | 82 | ||
82 | #ifdef CONFIG_IWMMXT | 83 | #ifdef CONFIG_IWMMXT |
83 | /* force any iWMMXt context to ram **/ | 84 | /* force any iWMMXt context to ram **/ |
@@ -100,16 +101,17 @@ static int pxa_pm_enter(suspend_state_t state) | |||
100 | SAVE(GAFR2_L); SAVE(GAFR2_U); | 101 | SAVE(GAFR2_L); SAVE(GAFR2_U); |
101 | 102 | ||
102 | #ifdef CONFIG_PXA27x | 103 | #ifdef CONFIG_PXA27x |
104 | SAVE(MDREFR); | ||
103 | SAVE(GPLR3); SAVE(GPDR3); SAVE(GRER3); SAVE(GFER3); SAVE(PGSR3); | 105 | SAVE(GPLR3); SAVE(GPDR3); SAVE(GRER3); SAVE(GFER3); SAVE(PGSR3); |
104 | SAVE(GAFR3_L); SAVE(GAFR3_U); | 106 | SAVE(GAFR3_L); SAVE(GAFR3_U); |
107 | SAVE(PWER); SAVE(PCFR); SAVE(PRER); | ||
108 | SAVE(PFER); SAVE(PKWR); | ||
105 | #endif | 109 | #endif |
106 | 110 | ||
107 | SAVE(ICMR); | 111 | SAVE(ICMR); |
108 | ICMR = 0; | 112 | ICMR = 0; |
109 | 113 | ||
110 | SAVE(CKEN); | 114 | SAVE(CKEN); |
111 | CKEN = 0; | ||
112 | |||
113 | SAVE(PSTR); | 115 | SAVE(PSTR); |
114 | 116 | ||
115 | /* Note: wake up source are set up in each machine specific files */ | 117 | /* Note: wake up source are set up in each machine specific files */ |
@@ -123,16 +125,13 @@ static int pxa_pm_enter(suspend_state_t state) | |||
123 | /* Clear sleep reset status */ | 125 | /* Clear sleep reset status */ |
124 | RCSR = RCSR_SMR; | 126 | RCSR = RCSR_SMR; |
125 | 127 | ||
126 | /* set resume return address */ | ||
127 | PSPR = virt_to_phys(pxa_cpu_resume); | ||
128 | |||
129 | /* before sleeping, calculate and save a checksum */ | 128 | /* before sleeping, calculate and save a checksum */ |
130 | for (i = 0; i < SLEEP_SAVE_SIZE - 1; i++) | 129 | for (i = 0; i < SLEEP_SAVE_SIZE - 1; i++) |
131 | checksum += sleep_save[i]; | 130 | checksum += sleep_save[i]; |
132 | sleep_save[SLEEP_SAVE_CKSUM] = checksum; | 131 | sleep_save[SLEEP_SAVE_CKSUM] = checksum; |
133 | 132 | ||
134 | /* *** go zzz *** */ | 133 | /* *** go zzz *** */ |
135 | pxa_cpu_suspend(); | 134 | pxa_cpu_pm_enter(state); |
136 | 135 | ||
137 | /* after sleeping, validate the checksum */ | 136 | /* after sleeping, validate the checksum */ |
138 | checksum = 0; | 137 | checksum = 0; |
@@ -145,7 +144,7 @@ static int pxa_pm_enter(suspend_state_t state) | |||
145 | LUB_HEXLED = 0xbadbadc5; | 144 | LUB_HEXLED = 0xbadbadc5; |
146 | #endif | 145 | #endif |
147 | while (1) | 146 | while (1) |
148 | pxa_cpu_suspend(); | 147 | pxa_cpu_pm_enter(state); |
149 | } | 148 | } |
150 | 149 | ||
151 | /* ensure not to come back here if it wasn't intended */ | 150 | /* ensure not to come back here if it wasn't intended */ |
@@ -162,8 +161,11 @@ static int pxa_pm_enter(suspend_state_t state) | |||
162 | RESTORE(PGSR0); RESTORE(PGSR1); RESTORE(PGSR2); | 161 | RESTORE(PGSR0); RESTORE(PGSR1); RESTORE(PGSR2); |
163 | 162 | ||
164 | #ifdef CONFIG_PXA27x | 163 | #ifdef CONFIG_PXA27x |
164 | RESTORE(MDREFR); | ||
165 | RESTORE(GAFR3_L); RESTORE(GAFR3_U); RESTORE_GPLEVEL(3); | 165 | RESTORE(GAFR3_L); RESTORE(GAFR3_U); RESTORE_GPLEVEL(3); |
166 | RESTORE(GPDR3); RESTORE(GRER3); RESTORE(GFER3); RESTORE(PGSR3); | 166 | RESTORE(GPDR3); RESTORE(GRER3); RESTORE(GFER3); RESTORE(PGSR3); |
167 | RESTORE(PWER); RESTORE(PCFR); RESTORE(PRER); | ||
168 | RESTORE(PFER); RESTORE(PKWR); | ||
167 | #endif | 169 | #endif |
168 | 170 | ||
169 | PSSR = PSSR_RDH | PSSR_PH; | 171 | PSSR = PSSR_RDH | PSSR_PH; |
@@ -197,7 +199,9 @@ unsigned long sleep_phys_sp(void *sp) | |||
197 | */ | 199 | */ |
198 | static int pxa_pm_prepare(suspend_state_t state) | 200 | static int pxa_pm_prepare(suspend_state_t state) |
199 | { | 201 | { |
200 | return 0; | 202 | extern int pxa_cpu_pm_prepare(suspend_state_t state); |
203 | |||
204 | return pxa_cpu_pm_prepare(state); | ||
201 | } | 205 | } |
202 | 206 | ||
203 | /* | 207 | /* |
diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c index e887b7175ef..b6d945a6e77 100644 --- a/arch/arm/mach-pxa/pxa25x.c +++ b/arch/arm/mach-pxa/pxa25x.c | |||
@@ -102,3 +102,32 @@ unsigned int get_lcdclk_frequency_10khz(void) | |||
102 | } | 102 | } |
103 | 103 | ||
104 | EXPORT_SYMBOL(get_lcdclk_frequency_10khz); | 104 | EXPORT_SYMBOL(get_lcdclk_frequency_10khz); |
105 | |||
106 | |||
107 | int pxa_cpu_pm_prepare(suspend_state_t state) | ||
108 | { | ||
109 | switch (state) { | ||
110 | case PM_SUSPEND_MEM: | ||
111 | break; | ||
112 | default: | ||
113 | return -EINVAL; | ||
114 | } | ||
115 | |||
116 | return 0; | ||
117 | } | ||
118 | |||
119 | void pxa_cpu_pm_enter(suspend_state_t state) | ||
120 | { | ||
121 | extern void pxa_cpu_suspend(unsigned int); | ||
122 | extern void pxa_cpu_resume(void); | ||
123 | |||
124 | CKEN = 0; | ||
125 | |||
126 | switch (state) { | ||
127 | case PM_SUSPEND_MEM: | ||
128 | /* set resume return address */ | ||
129 | PSPR = virt_to_phys(pxa_cpu_resume); | ||
130 | pxa_cpu_suspend(3); | ||
131 | break; | ||
132 | } | ||
133 | } | ||
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c index 7e863afefb5..aa3c3b2ab75 100644 --- a/arch/arm/mach-pxa/pxa27x.c +++ b/arch/arm/mach-pxa/pxa27x.c | |||
@@ -120,6 +120,38 @@ EXPORT_SYMBOL(get_clk_frequency_khz); | |||
120 | EXPORT_SYMBOL(get_memclk_frequency_10khz); | 120 | EXPORT_SYMBOL(get_memclk_frequency_10khz); |
121 | EXPORT_SYMBOL(get_lcdclk_frequency_10khz); | 121 | EXPORT_SYMBOL(get_lcdclk_frequency_10khz); |
122 | 122 | ||
123 | int pxa_cpu_pm_prepare(suspend_state_t state) | ||
124 | { | ||
125 | switch (state) { | ||
126 | case PM_SUSPEND_MEM: | ||
127 | return 0; | ||
128 | default: | ||
129 | return -EINVAL; | ||
130 | } | ||
131 | } | ||
132 | |||
133 | void pxa_cpu_pm_enter(suspend_state_t state) | ||
134 | { | ||
135 | extern void pxa_cpu_standby(void); | ||
136 | extern void pxa_cpu_suspend(unsigned int); | ||
137 | extern void pxa_cpu_resume(void); | ||
138 | |||
139 | CKEN = CKEN22_MEMC | CKEN9_OSTIMER; | ||
140 | |||
141 | /* ensure voltage-change sequencer not initiated, which hangs */ | ||
142 | PCFR &= ~PCFR_FVC; | ||
143 | |||
144 | /* Clear edge-detect status register. */ | ||
145 | PEDR = 0xDF12FE1B; | ||
146 | |||
147 | switch (state) { | ||
148 | case PM_SUSPEND_MEM: | ||
149 | /* set resume return address */ | ||
150 | PSPR = virt_to_phys(pxa_cpu_resume); | ||
151 | pxa_cpu_suspend(3); | ||
152 | break; | ||
153 | } | ||
154 | } | ||
123 | 155 | ||
124 | /* | 156 | /* |
125 | * device registration specific to PXA27x. | 157 | * device registration specific to PXA27x. |
diff --git a/arch/arm/mach-s3c2410/dma.c b/arch/arm/mach-s3c2410/dma.c index bc229fab86d..c7c28890d40 100644 --- a/arch/arm/mach-s3c2410/dma.c +++ b/arch/arm/mach-s3c2410/dma.c | |||
@@ -785,6 +785,10 @@ int s3c2410_dma_free(dmach_t channel, s3c2410_dma_client_t *client) | |||
785 | chan->client = NULL; | 785 | chan->client = NULL; |
786 | chan->in_use = 0; | 786 | chan->in_use = 0; |
787 | 787 | ||
788 | if (chan->irq_claimed) | ||
789 | free_irq(chan->irq, (void *)chan); | ||
790 | chan->irq_claimed = 0; | ||
791 | |||
788 | local_irq_restore(flags); | 792 | local_irq_restore(flags); |
789 | 793 | ||
790 | return 0; | 794 | return 0; |
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig index 48bac7da8c7..ade0e2222f5 100644 --- a/arch/arm/mm/Kconfig +++ b/arch/arm/mm/Kconfig | |||
@@ -228,7 +228,6 @@ config CPU_SA1100 | |||
228 | select CPU_CACHE_V4WB | 228 | select CPU_CACHE_V4WB |
229 | select CPU_CACHE_VIVT | 229 | select CPU_CACHE_VIVT |
230 | select CPU_TLB_V4WB | 230 | select CPU_TLB_V4WB |
231 | select CPU_MINICACHE | ||
232 | 231 | ||
233 | # XScale | 232 | # XScale |
234 | config CPU_XSCALE | 233 | config CPU_XSCALE |
@@ -239,7 +238,6 @@ config CPU_XSCALE | |||
239 | select CPU_ABRT_EV5T | 238 | select CPU_ABRT_EV5T |
240 | select CPU_CACHE_VIVT | 239 | select CPU_CACHE_VIVT |
241 | select CPU_TLB_V4WBI | 240 | select CPU_TLB_V4WBI |
242 | select CPU_MINICACHE | ||
243 | 241 | ||
244 | # ARMv6 | 242 | # ARMv6 |
245 | config CPU_V6 | 243 | config CPU_V6 |
@@ -345,11 +343,6 @@ config CPU_TLB_V4WBI | |||
345 | config CPU_TLB_V6 | 343 | config CPU_TLB_V6 |
346 | bool | 344 | bool |
347 | 345 | ||
348 | config CPU_MINICACHE | ||
349 | bool | ||
350 | help | ||
351 | Processor has a minicache. | ||
352 | |||
353 | comment "Processor Features" | 346 | comment "Processor Features" |
354 | 347 | ||
355 | config ARM_THUMB | 348 | config ARM_THUMB |
diff --git a/arch/arm/mm/Makefile b/arch/arm/mm/Makefile index ccf316c11e0..59f47d4c2df 100644 --- a/arch/arm/mm/Makefile +++ b/arch/arm/mm/Makefile | |||
@@ -31,8 +31,6 @@ obj-$(CONFIG_CPU_COPY_V6) += copypage-v6.o mmu.o | |||
31 | obj-$(CONFIG_CPU_SA1100) += copypage-v4mc.o | 31 | obj-$(CONFIG_CPU_SA1100) += copypage-v4mc.o |
32 | obj-$(CONFIG_CPU_XSCALE) += copypage-xscale.o | 32 | obj-$(CONFIG_CPU_XSCALE) += copypage-xscale.o |
33 | 33 | ||
34 | obj-$(CONFIG_CPU_MINICACHE) += minicache.o | ||
35 | |||
36 | obj-$(CONFIG_CPU_TLB_V3) += tlb-v3.o | 34 | obj-$(CONFIG_CPU_TLB_V3) += tlb-v3.o |
37 | obj-$(CONFIG_CPU_TLB_V4WT) += tlb-v4.o | 35 | obj-$(CONFIG_CPU_TLB_V4WT) += tlb-v4.o |
38 | obj-$(CONFIG_CPU_TLB_V4WB) += tlb-v4wb.o | 36 | obj-$(CONFIG_CPU_TLB_V4WB) += tlb-v4wb.o |
diff --git a/arch/arm/mm/copypage-xscale.S b/arch/arm/mm/copypage-xscale.S deleted file mode 100644 index bb277316ef5..00000000000 --- a/arch/arm/mm/copypage-xscale.S +++ /dev/null | |||
@@ -1,113 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/lib/copypage-xscale.S | ||
3 | * | ||
4 | * Copyright (C) 2001 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/constants.h> | ||
13 | |||
14 | /* | ||
15 | * General note: | ||
16 | * We don't really want write-allocate cache behaviour for these functions | ||
17 | * since that will just eat through 8K of the cache. | ||
18 | */ | ||
19 | |||
20 | .text | ||
21 | .align 5 | ||
22 | /* | ||
23 | * XScale optimised copy_user_page | ||
24 | * r0 = destination | ||
25 | * r1 = source | ||
26 | * r2 = virtual user address of ultimate destination page | ||
27 | * | ||
28 | * The source page may have some clean entries in the cache already, but we | ||
29 | * can safely ignore them - break_cow() will flush them out of the cache | ||
30 | * if we eventually end up using our copied page. | ||
31 | * | ||
32 | * What we could do is use the mini-cache to buffer reads from the source | ||
33 | * page. We rely on the mini-cache being smaller than one page, so we'll | ||
34 | * cycle through the complete cache anyway. | ||
35 | */ | ||
36 | ENTRY(xscale_mc_copy_user_page) | ||
37 | stmfd sp!, {r4, r5, lr} | ||
38 | mov r5, r0 | ||
39 | mov r0, r1 | ||
40 | bl map_page_minicache | ||
41 | mov r1, r5 | ||
42 | mov lr, #PAGE_SZ/64-1 | ||
43 | |||
44 | /* | ||
45 | * Strangely enough, best performance is achieved | ||
46 | * when prefetching destination as well. (NP) | ||
47 | */ | ||
48 | pld [r0, #0] | ||
49 | pld [r0, #32] | ||
50 | pld [r1, #0] | ||
51 | pld [r1, #32] | ||
52 | |||
53 | 1: pld [r0, #64] | ||
54 | pld [r0, #96] | ||
55 | pld [r1, #64] | ||
56 | pld [r1, #96] | ||
57 | |||
58 | 2: ldrd r2, [r0], #8 | ||
59 | ldrd r4, [r0], #8 | ||
60 | mov ip, r1 | ||
61 | strd r2, [r1], #8 | ||
62 | ldrd r2, [r0], #8 | ||
63 | strd r4, [r1], #8 | ||
64 | ldrd r4, [r0], #8 | ||
65 | strd r2, [r1], #8 | ||
66 | strd r4, [r1], #8 | ||
67 | mcr p15, 0, ip, c7, c10, 1 @ clean D line | ||
68 | ldrd r2, [r0], #8 | ||
69 | mcr p15, 0, ip, c7, c6, 1 @ invalidate D line | ||
70 | ldrd r4, [r0], #8 | ||
71 | mov ip, r1 | ||
72 | strd r2, [r1], #8 | ||
73 | ldrd r2, [r0], #8 | ||
74 | strd r4, [r1], #8 | ||
75 | ldrd r4, [r0], #8 | ||
76 | strd r2, [r1], #8 | ||
77 | strd r4, [r1], #8 | ||
78 | mcr p15, 0, ip, c7, c10, 1 @ clean D line | ||
79 | subs lr, lr, #1 | ||
80 | mcr p15, 0, ip, c7, c6, 1 @ invalidate D line | ||
81 | bgt 1b | ||
82 | beq 2b | ||
83 | |||
84 | ldmfd sp!, {r4, r5, pc} | ||
85 | |||
86 | .align 5 | ||
87 | /* | ||
88 | * XScale optimised clear_user_page | ||
89 | * r0 = destination | ||
90 | * r1 = virtual user address of ultimate destination page | ||
91 | */ | ||
92 | ENTRY(xscale_mc_clear_user_page) | ||
93 | mov r1, #PAGE_SZ/32 | ||
94 | mov r2, #0 | ||
95 | mov r3, #0 | ||
96 | 1: mov ip, r0 | ||
97 | strd r2, [r0], #8 | ||
98 | strd r2, [r0], #8 | ||
99 | strd r2, [r0], #8 | ||
100 | strd r2, [r0], #8 | ||
101 | mcr p15, 0, ip, c7, c10, 1 @ clean D line | ||
102 | subs r1, r1, #1 | ||
103 | mcr p15, 0, ip, c7, c6, 1 @ invalidate D line | ||
104 | bne 1b | ||
105 | mov pc, lr | ||
106 | |||
107 | __INITDATA | ||
108 | |||
109 | .type xscale_mc_user_fns, #object | ||
110 | ENTRY(xscale_mc_user_fns) | ||
111 | .long xscale_mc_clear_user_page | ||
112 | .long xscale_mc_copy_user_page | ||
113 | .size xscale_mc_user_fns, . - xscale_mc_user_fns | ||
diff --git a/arch/arm/mm/copypage-xscale.c b/arch/arm/mm/copypage-xscale.c new file mode 100644 index 00000000000..42a6ee255ce --- /dev/null +++ b/arch/arm/mm/copypage-xscale.c | |||
@@ -0,0 +1,131 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/lib/copypage-xscale.S | ||
3 | * | ||
4 | * Copyright (C) 1995-2005 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 | * This handles the mini data cache, as found on SA11x0 and XScale | ||
11 | * processors. When we copy a user page page, we map it in such a way | ||
12 | * that accesses to this page will not touch the main data cache, but | ||
13 | * will be cached in the mini data cache. This prevents us thrashing | ||
14 | * the main data cache on page faults. | ||
15 | */ | ||
16 | #include <linux/init.h> | ||
17 | #include <linux/mm.h> | ||
18 | |||
19 | #include <asm/page.h> | ||
20 | #include <asm/pgtable.h> | ||
21 | #include <asm/tlbflush.h> | ||
22 | |||
23 | /* | ||
24 | * 0xffff8000 to 0xffffffff is reserved for any ARM architecture | ||
25 | * specific hacks for copying pages efficiently. | ||
26 | */ | ||
27 | #define COPYPAGE_MINICACHE 0xffff8000 | ||
28 | |||
29 | #define minicache_pgprot __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | \ | ||
30 | L_PTE_CACHEABLE) | ||
31 | |||
32 | #define TOP_PTE(x) pte_offset_kernel(top_pmd, x) | ||
33 | |||
34 | static DEFINE_SPINLOCK(minicache_lock); | ||
35 | |||
36 | /* | ||
37 | * XScale mini-dcache optimised copy_user_page | ||
38 | * | ||
39 | * We flush the destination cache lines just before we write the data into the | ||
40 | * corresponding address. Since the Dcache is read-allocate, this removes the | ||
41 | * Dcache aliasing issue. The writes will be forwarded to the write buffer, | ||
42 | * and merged as appropriate. | ||
43 | */ | ||
44 | static void __attribute__((naked)) | ||
45 | mc_copy_user_page(void *from, void *to) | ||
46 | { | ||
47 | /* | ||
48 | * Strangely enough, best performance is achieved | ||
49 | * when prefetching destination as well. (NP) | ||
50 | */ | ||
51 | asm volatile( | ||
52 | "stmfd sp!, {r4, r5, lr} \n\ | ||
53 | mov lr, %2 \n\ | ||
54 | pld [r0, #0] \n\ | ||
55 | pld [r0, #32] \n\ | ||
56 | pld [r1, #0] \n\ | ||
57 | pld [r1, #32] \n\ | ||
58 | 1: pld [r0, #64] \n\ | ||
59 | pld [r0, #96] \n\ | ||
60 | pld [r1, #64] \n\ | ||
61 | pld [r1, #96] \n\ | ||
62 | 2: ldrd r2, [r0], #8 \n\ | ||
63 | ldrd r4, [r0], #8 \n\ | ||
64 | mov ip, r1 \n\ | ||
65 | strd r2, [r1], #8 \n\ | ||
66 | ldrd r2, [r0], #8 \n\ | ||
67 | strd r4, [r1], #8 \n\ | ||
68 | ldrd r4, [r0], #8 \n\ | ||
69 | strd r2, [r1], #8 \n\ | ||
70 | strd r4, [r1], #8 \n\ | ||
71 | mcr p15, 0, ip, c7, c10, 1 @ clean D line\n\ | ||
72 | ldrd r2, [r0], #8 \n\ | ||
73 | mcr p15, 0, ip, c7, c6, 1 @ invalidate D line\n\ | ||
74 | ldrd r4, [r0], #8 \n\ | ||
75 | mov ip, r1 \n\ | ||
76 | strd r2, [r1], #8 \n\ | ||
77 | ldrd r2, [r0], #8 \n\ | ||
78 | strd r4, [r1], #8 \n\ | ||
79 | ldrd r4, [r0], #8 \n\ | ||
80 | strd r2, [r1], #8 \n\ | ||
81 | strd r4, [r1], #8 \n\ | ||
82 | mcr p15, 0, ip, c7, c10, 1 @ clean D line\n\ | ||
83 | subs lr, lr, #1 \n\ | ||
84 | mcr p15, 0, ip, c7, c6, 1 @ invalidate D line\n\ | ||
85 | bgt 1b \n\ | ||
86 | beq 2b \n\ | ||
87 | ldmfd sp!, {r4, r5, pc} " | ||
88 | : | ||
89 | : "r" (from), "r" (to), "I" (PAGE_SIZE / 64 - 1)); | ||
90 | } | ||
91 | |||
92 | void xscale_mc_copy_user_page(void *kto, const void *kfrom, unsigned long vaddr) | ||
93 | { | ||
94 | spin_lock(&minicache_lock); | ||
95 | |||
96 | set_pte(TOP_PTE(COPYPAGE_MINICACHE), pfn_pte(__pa(kfrom) >> PAGE_SHIFT, minicache_pgprot)); | ||
97 | flush_tlb_kernel_page(COPYPAGE_MINICACHE); | ||
98 | |||
99 | mc_copy_user_page((void *)COPYPAGE_MINICACHE, kto); | ||
100 | |||
101 | spin_unlock(&minicache_lock); | ||
102 | } | ||
103 | |||
104 | /* | ||
105 | * XScale optimised clear_user_page | ||
106 | */ | ||
107 | void __attribute__((naked)) | ||
108 | xscale_mc_clear_user_page(void *kaddr, unsigned long vaddr) | ||
109 | { | ||
110 | asm volatile( | ||
111 | "mov r1, %0 \n\ | ||
112 | mov r2, #0 \n\ | ||
113 | mov r3, #0 \n\ | ||
114 | 1: mov ip, r0 \n\ | ||
115 | strd r2, [r0], #8 \n\ | ||
116 | strd r2, [r0], #8 \n\ | ||
117 | strd r2, [r0], #8 \n\ | ||
118 | strd r2, [r0], #8 \n\ | ||
119 | mcr p15, 0, ip, c7, c10, 1 @ clean D line\n\ | ||
120 | subs r1, r1, #1 \n\ | ||
121 | mcr p15, 0, ip, c7, c6, 1 @ invalidate D line\n\ | ||
122 | bne 1b \n\ | ||
123 | mov pc, lr" | ||
124 | : | ||
125 | : "I" (PAGE_SIZE / 32)); | ||
126 | } | ||
127 | |||
128 | struct cpu_user_fns xscale_mc_user_fns __initdata = { | ||
129 | .cpu_clear_user_page = xscale_mc_clear_user_page, | ||
130 | .cpu_copy_user_page = xscale_mc_copy_user_page, | ||
131 | }; | ||
diff --git a/arch/arm/mm/minicache.c b/arch/arm/mm/minicache.c index dedf2ab01b2..e69de29bb2d 100644 --- a/arch/arm/mm/minicache.c +++ b/arch/arm/mm/minicache.c | |||
@@ -1,73 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mm/minicache.c | ||
3 | * | ||
4 | * Copyright (C) 2001 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 | * This handles the mini data cache, as found on SA11x0 and XScale | ||
11 | * processors. When we copy a user page page, we map it in such a way | ||
12 | * that accesses to this page will not touch the main data cache, but | ||
13 | * will be cached in the mini data cache. This prevents us thrashing | ||
14 | * the main data cache on page faults. | ||
15 | */ | ||
16 | #include <linux/init.h> | ||
17 | #include <linux/mm.h> | ||
18 | |||
19 | #include <asm/page.h> | ||
20 | #include <asm/pgtable.h> | ||
21 | #include <asm/tlbflush.h> | ||
22 | |||
23 | /* | ||
24 | * 0xffff8000 to 0xffffffff is reserved for any ARM architecture | ||
25 | * specific hacks for copying pages efficiently. | ||
26 | */ | ||
27 | #define minicache_address (0xffff8000) | ||
28 | #define minicache_pgprot __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | \ | ||
29 | L_PTE_CACHEABLE) | ||
30 | |||
31 | static pte_t *minicache_pte; | ||
32 | |||
33 | /* | ||
34 | * Note that this is intended to be called only from the copy_user_page | ||
35 | * asm code; anything else will require special locking to prevent the | ||
36 | * mini-cache space being re-used. (Note: probably preempt unsafe). | ||
37 | * | ||
38 | * We rely on the fact that the minicache is 2K, and we'll be pushing | ||
39 | * 4K of data through it, so we don't actually have to specifically | ||
40 | * flush the minicache when we change the mapping. | ||
41 | * | ||
42 | * Note also: assert(PAGE_OFFSET <= virt < high_memory). | ||
43 | * Unsafe: preempt, kmap. | ||
44 | */ | ||
45 | unsigned long map_page_minicache(unsigned long virt) | ||
46 | { | ||
47 | set_pte(minicache_pte, pfn_pte(__pa(virt) >> PAGE_SHIFT, minicache_pgprot)); | ||
48 | flush_tlb_kernel_page(minicache_address); | ||
49 | |||
50 | return minicache_address; | ||
51 | } | ||
52 | |||
53 | static int __init minicache_init(void) | ||
54 | { | ||
55 | pgd_t *pgd; | ||
56 | pmd_t *pmd; | ||
57 | |||
58 | spin_lock(&init_mm.page_table_lock); | ||
59 | |||
60 | pgd = pgd_offset_k(minicache_address); | ||
61 | pmd = pmd_alloc(&init_mm, pgd, minicache_address); | ||
62 | if (!pmd) | ||
63 | BUG(); | ||
64 | minicache_pte = pte_alloc_kernel(&init_mm, pmd, minicache_address); | ||
65 | if (!minicache_pte) | ||
66 | BUG(); | ||
67 | |||
68 | spin_unlock(&init_mm.page_table_lock); | ||
69 | |||
70 | return 0; | ||
71 | } | ||
72 | |||
73 | core_initcall(minicache_init); | ||