aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2008-04-29 16:31:13 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-04-29 16:31:13 -0400
commit9d87dd97ffcd3b5eb2bbaf0d5d93f4bfcaed3f04 (patch)
tree64f5fdfc195e92081426db6185dbebe0f4373a81 /arch/arm
parent92794a5d6359f9e8ed0d43fe0f3c653f748dcc90 (diff)
parent0ed1507183adea174bc4b6611b50d90e044730c2 (diff)
Merge branch 'orion-fixes2'
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mm/Kconfig5
-rw-r--r--arch/arm/mm/Makefile1
-rw-r--r--arch/arm/mm/copypage-feroceon.S95
-rw-r--r--arch/arm/mm/proc-feroceon.S17
4 files changed, 112 insertions, 6 deletions
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index a92a577c1b65..33ed048502a3 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -372,7 +372,7 @@ config CPU_FEROCEON
372 select CPU_PABRT_NOIFAR 372 select CPU_PABRT_NOIFAR
373 select CPU_CACHE_VIVT 373 select CPU_CACHE_VIVT
374 select CPU_CP15_MMU 374 select CPU_CP15_MMU
375 select CPU_COPY_V4WB if MMU 375 select CPU_COPY_FEROCEON if MMU
376 select CPU_TLB_V4WBI if MMU 376 select CPU_TLB_V4WBI if MMU
377 377
378config CPU_FEROCEON_OLD_ID 378config CPU_FEROCEON_OLD_ID
@@ -523,6 +523,9 @@ config CPU_COPY_V4WT
523config CPU_COPY_V4WB 523config CPU_COPY_V4WB
524 bool 524 bool
525 525
526config CPU_COPY_FEROCEON
527 bool
528
526config CPU_COPY_V6 529config CPU_COPY_V6
527 bool 530 bool
528 531
diff --git a/arch/arm/mm/Makefile b/arch/arm/mm/Makefile
index 44536a0b995a..32b2d2d213a6 100644
--- a/arch/arm/mm/Makefile
+++ b/arch/arm/mm/Makefile
@@ -36,6 +36,7 @@ obj-$(CONFIG_CPU_CACHE_V7) += cache-v7.o
36obj-$(CONFIG_CPU_COPY_V3) += copypage-v3.o 36obj-$(CONFIG_CPU_COPY_V3) += copypage-v3.o
37obj-$(CONFIG_CPU_COPY_V4WT) += copypage-v4wt.o 37obj-$(CONFIG_CPU_COPY_V4WT) += copypage-v4wt.o
38obj-$(CONFIG_CPU_COPY_V4WB) += copypage-v4wb.o 38obj-$(CONFIG_CPU_COPY_V4WB) += copypage-v4wb.o
39obj-$(CONFIG_CPU_COPY_FEROCEON) += copypage-feroceon.o
39obj-$(CONFIG_CPU_COPY_V6) += copypage-v6.o context.o 40obj-$(CONFIG_CPU_COPY_V6) += copypage-v6.o context.o
40obj-$(CONFIG_CPU_SA1100) += copypage-v4mc.o 41obj-$(CONFIG_CPU_SA1100) += copypage-v4mc.o
41obj-$(CONFIG_CPU_XSCALE) += copypage-xscale.o 42obj-$(CONFIG_CPU_XSCALE) += copypage-xscale.o
diff --git a/arch/arm/mm/copypage-feroceon.S b/arch/arm/mm/copypage-feroceon.S
new file mode 100644
index 000000000000..7eb0d320d240
--- /dev/null
+++ b/arch/arm/mm/copypage-feroceon.S
@@ -0,0 +1,95 @@
1/*
2 * linux/arch/arm/lib/copypage-feroceon.S
3 *
4 * Copyright (C) 2008 Marvell Semiconductors
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 copy_user_page and clear_user_page on Feroceon
11 * more optimally than the generic implementations.
12 */
13#include <linux/linkage.h>
14#include <linux/init.h>
15#include <asm/asm-offsets.h>
16
17 .text
18 .align 5
19
20ENTRY(feroceon_copy_user_page)
21 stmfd sp!, {r4-r9, lr}
22 mov ip, #PAGE_SZ
231: mov lr, r1
24 ldmia r1!, {r2 - r9}
25 pld [lr, #32]
26 pld [lr, #64]
27 pld [lr, #96]
28 pld [lr, #128]
29 pld [lr, #160]
30 pld [lr, #192]
31 pld [lr, #224]
32 stmia r0, {r2 - r9}
33 ldmia r1!, {r2 - r9}
34 mcr p15, 0, r0, c7, c14, 1 @ clean and invalidate D line
35 add r0, r0, #32
36 stmia r0, {r2 - r9}
37 ldmia r1!, {r2 - r9}
38 mcr p15, 0, r0, c7, c14, 1 @ clean and invalidate D line
39 add r0, r0, #32
40 stmia r0, {r2 - r9}
41 ldmia r1!, {r2 - r9}
42 mcr p15, 0, r0, c7, c14, 1 @ clean and invalidate D line
43 add r0, r0, #32
44 stmia r0, {r2 - r9}
45 ldmia r1!, {r2 - r9}
46 mcr p15, 0, r0, c7, c14, 1 @ clean and invalidate D line
47 add r0, r0, #32
48 stmia r0, {r2 - r9}
49 ldmia r1!, {r2 - r9}
50 mcr p15, 0, r0, c7, c14, 1 @ clean and invalidate D line
51 add r0, r0, #32
52 stmia r0, {r2 - r9}
53 ldmia r1!, {r2 - r9}
54 mcr p15, 0, r0, c7, c14, 1 @ clean and invalidate D line
55 add r0, r0, #32
56 stmia r0, {r2 - r9}
57 ldmia r1!, {r2 - r9}
58 mcr p15, 0, r0, c7, c14, 1 @ clean and invalidate D line
59 add r0, r0, #32
60 stmia r0, {r2 - r9}
61 subs ip, ip, #(32 * 8)
62 mcr p15, 0, r0, c7, c14, 1 @ clean and invalidate D line
63 add r0, r0, #32
64 bne 1b
65 mcr p15, 0, ip, c7, c10, 4 @ drain WB
66 ldmfd sp!, {r4-r9, pc}
67
68 .align 5
69
70ENTRY(feroceon_clear_user_page)
71 stmfd sp!, {r4-r7, lr}
72 mov r1, #PAGE_SZ/32
73 mov r2, #0
74 mov r3, #0
75 mov r4, #0
76 mov r5, #0
77 mov r6, #0
78 mov r7, #0
79 mov ip, #0
80 mov lr, #0
811: stmia r0, {r2-r7, ip, lr}
82 subs r1, r1, #1
83 mcr p15, 0, r0, c7, c14, 1 @ clean and invalidate D line
84 add r0, r0, #32
85 bne 1b
86 mcr p15, 0, r1, c7, c10, 4 @ drain WB
87 ldmfd sp!, {r4-r7, pc}
88
89 __INITDATA
90
91 .type feroceon_user_fns, #object
92ENTRY(feroceon_user_fns)
93 .long feroceon_clear_user_page
94 .long feroceon_copy_user_page
95 .size feroceon_user_fns, . - feroceon_user_fns
diff --git a/arch/arm/mm/proc-feroceon.S b/arch/arm/mm/proc-feroceon.S
index 3ceb6785a345..a02c1712b52d 100644
--- a/arch/arm/mm/proc-feroceon.S
+++ b/arch/arm/mm/proc-feroceon.S
@@ -93,7 +93,7 @@ ENTRY(cpu_feroceon_reset)
93 * 93 *
94 * Called with IRQs disabled 94 * Called with IRQs disabled
95 */ 95 */
96 .align 10 96 .align 5
97ENTRY(cpu_feroceon_do_idle) 97ENTRY(cpu_feroceon_do_idle)
98 mov r0, #0 98 mov r0, #0
99 mcr p15, 0, r0, c7, c10, 4 @ Drain write buffer 99 mcr p15, 0, r0, c7, c10, 4 @ Drain write buffer
@@ -106,6 +106,7 @@ ENTRY(cpu_feroceon_do_idle)
106 * Clean and invalidate all cache entries in a particular 106 * Clean and invalidate all cache entries in a particular
107 * address space. 107 * address space.
108 */ 108 */
109 .align 5
109ENTRY(feroceon_flush_user_cache_all) 110ENTRY(feroceon_flush_user_cache_all)
110 /* FALLTHROUGH */ 111 /* FALLTHROUGH */
111 112
@@ -135,6 +136,7 @@ __flush_whole_cache:
135 * - end - end address (exclusive) 136 * - end - end address (exclusive)
136 * - flags - vm_flags describing address space 137 * - flags - vm_flags describing address space
137 */ 138 */
139 .align 5
138ENTRY(feroceon_flush_user_cache_range) 140ENTRY(feroceon_flush_user_cache_range)
139 mov ip, #0 141 mov ip, #0
140 sub r3, r1, r0 @ calculate total size 142 sub r3, r1, r0 @ calculate total size
@@ -163,6 +165,7 @@ ENTRY(feroceon_flush_user_cache_range)
163 * - start - virtual start address 165 * - start - virtual start address
164 * - end - virtual end address 166 * - end - virtual end address
165 */ 167 */
168 .align 5
166ENTRY(feroceon_coherent_kern_range) 169ENTRY(feroceon_coherent_kern_range)
167 /* FALLTHROUGH */ 170 /* FALLTHROUGH */
168 171
@@ -194,6 +197,7 @@ ENTRY(feroceon_coherent_user_range)
194 * 197 *
195 * - addr - page aligned address 198 * - addr - page aligned address
196 */ 199 */
200 .align 5
197ENTRY(feroceon_flush_kern_dcache_page) 201ENTRY(feroceon_flush_kern_dcache_page)
198 add r1, r0, #PAGE_SZ 202 add r1, r0, #PAGE_SZ
1991: mcr p15, 0, r0, c7, c14, 1 @ clean+invalidate D entry 2031: mcr p15, 0, r0, c7, c14, 1 @ clean+invalidate D entry
@@ -218,6 +222,7 @@ ENTRY(feroceon_flush_kern_dcache_page)
218 * 222 *
219 * (same as v4wb) 223 * (same as v4wb)
220 */ 224 */
225 .align 5
221ENTRY(feroceon_dma_inv_range) 226ENTRY(feroceon_dma_inv_range)
222 tst r0, #CACHE_DLINESIZE - 1 227 tst r0, #CACHE_DLINESIZE - 1
223 mcrne p15, 0, r0, c7, c10, 1 @ clean D entry 228 mcrne p15, 0, r0, c7, c10, 1 @ clean D entry
@@ -241,6 +246,7 @@ ENTRY(feroceon_dma_inv_range)
241 * 246 *
242 * (same as v4wb) 247 * (same as v4wb)
243 */ 248 */
249 .align 5
244ENTRY(feroceon_dma_clean_range) 250ENTRY(feroceon_dma_clean_range)
245 bic r0, r0, #CACHE_DLINESIZE - 1 251 bic r0, r0, #CACHE_DLINESIZE - 1
2461: mcr p15, 0, r0, c7, c10, 1 @ clean D entry 2521: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
@@ -258,10 +264,10 @@ ENTRY(feroceon_dma_clean_range)
258 * - start - virtual start address 264 * - start - virtual start address
259 * - end - virtual end address 265 * - end - virtual end address
260 */ 266 */
267 .align 5
261ENTRY(feroceon_dma_flush_range) 268ENTRY(feroceon_dma_flush_range)
262 bic r0, r0, #CACHE_DLINESIZE - 1 269 bic r0, r0, #CACHE_DLINESIZE - 1
2631: 2701: mcr p15, 0, r0, c7, c14, 1 @ clean+invalidate D entry
264 mcr p15, 0, r0, c7, c14, 1 @ clean+invalidate D entry
265 add r0, r0, #CACHE_DLINESIZE 271 add r0, r0, #CACHE_DLINESIZE
266 cmp r0, r1 272 cmp r0, r1
267 blo 1b 273 blo 1b
@@ -279,6 +285,7 @@ ENTRY(feroceon_cache_fns)
279 .long feroceon_dma_clean_range 285 .long feroceon_dma_clean_range
280 .long feroceon_dma_flush_range 286 .long feroceon_dma_flush_range
281 287
288 .align 5
282ENTRY(cpu_feroceon_dcache_clean_area) 289ENTRY(cpu_feroceon_dcache_clean_area)
2831: mcr p15, 0, r0, c7, c10, 1 @ clean D entry 2901: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
284 add r0, r0, #CACHE_DLINESIZE 291 add r0, r0, #CACHE_DLINESIZE
@@ -433,7 +440,7 @@ __feroceon_old_id_proc_info:
433 .long cpu_feroceon_name 440 .long cpu_feroceon_name
434 .long feroceon_processor_functions 441 .long feroceon_processor_functions
435 .long v4wbi_tlb_fns 442 .long v4wbi_tlb_fns
436 .long v4wb_user_fns 443 .long feroceon_user_fns
437 .long feroceon_cache_fns 444 .long feroceon_cache_fns
438 .size __feroceon_old_id_proc_info, . - __feroceon_old_id_proc_info 445 .size __feroceon_old_id_proc_info, . - __feroceon_old_id_proc_info
439#endif 446#endif
@@ -459,6 +466,6 @@ __feroceon_proc_info:
459 .long cpu_feroceon_name 466 .long cpu_feroceon_name
460 .long feroceon_processor_functions 467 .long feroceon_processor_functions
461 .long v4wbi_tlb_fns 468 .long v4wbi_tlb_fns
462 .long v4wb_user_fns 469 .long feroceon_user_fns
463 .long feroceon_cache_fns 470 .long feroceon_cache_fns
464 .size __feroceon_proc_info, . - __feroceon_proc_info 471 .size __feroceon_proc_info, . - __feroceon_proc_info