diff options
author | Lennert Buytenhek <buytenh@wantstofly.org> | 2008-04-24 01:31:45 -0400 |
---|---|---|
committer | Nicolas Pitre <nico@cam.org> | 2008-04-28 16:06:51 -0400 |
commit | 0ed1507183adea174bc4b6611b50d90e044730c2 (patch) | |
tree | c6f917503593997467052dcc5963e8387fb67f94 /arch/arm/mm/copypage-feroceon.S | |
parent | 6b29e681aa7e80792e6e6be4ac2577014018c2fd (diff) |
[ARM] Feroceon: Feroceon-specific WA-cache compatible {copy,clear}_user_page()
This patch implements a set of Feroceon-specific
{copy,clear}_user_page() routines that perform more optimally than
the generic implementations. This also deals with write-allocate
caches (Feroceon can run L1 D in WA mode) which otherwise prevents
Linux from booting.
[nico: optimized the code even further]
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Tested-by: Sylver Bruneau <sylver.bruneau@googlemail.com>
Tested-by: Martin Michlmayr <tbm@cyrius.com>
Signed-off-by: Nicolas Pitre <nico@marvell.com>
Diffstat (limited to 'arch/arm/mm/copypage-feroceon.S')
-rw-r--r-- | arch/arm/mm/copypage-feroceon.S | 95 |
1 files changed, 95 insertions, 0 deletions
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 | |||
20 | ENTRY(feroceon_copy_user_page) | ||
21 | stmfd sp!, {r4-r9, lr} | ||
22 | mov ip, #PAGE_SZ | ||
23 | 1: 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 | |||
70 | ENTRY(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 | ||
81 | 1: 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 | ||
92 | ENTRY(feroceon_user_fns) | ||
93 | .long feroceon_clear_user_page | ||
94 | .long feroceon_copy_user_page | ||
95 | .size feroceon_user_fns, . - feroceon_user_fns | ||