1
2
3
4
5
6
7
8
9 #include <linux/init.h>
10 #include <linux/linkage.h>
11 #include <asm/assembler.h>
12 #include <asm/hwcap.h>
13 #include <asm/pgtable-hwdef.h>
14 #include <asm/pgtable.h>
15
16 #include "proc-macros.S"
17
18 ENTRY(cpu_proc_fin)
19 stm.w (lr), [sp-]
20 mov ip, #PSR_R_BIT | PSR_I_BIT | PRIV_MODE
21 mov.a asr, ip
22 b.l __cpuc_flush_kern_all
23 ldm.w (pc), [sp]+
24
25
26
27
28
29
30
31
32
33
34 .align 5
35 ENTRY(cpu_reset)
36 mov ip, #0
37 movc p0.c5, ip, #28 @ Cache invalidate all
38 nop8
39
40 movc p0.c6, ip, #6 @ TLB invalidate all
41 nop8
42
43 movc ip, p0.c1, #0 @ ctrl register
44 or ip, ip, #0x2000 @ vector base address
45 andn ip, ip, #0x000f @ ............idam
46 movc p0.c1, ip, #0 @ disable caches and mmu
47 nop
48 mov pc, r0 @ jump to loc
49 nop8
50
51
52
53
54
55
56
57
58 ENTRY(cpu_do_idle)
59 mov r0, #0 @ PCI address
60 .rept 8
61 ldw r1, [r0]
62 .endr
63 mov pc, lr
64
65 ENTRY(cpu_dcache_clean_area)
66 #ifndef CONFIG_CPU_DCACHE_LINE_DISABLE
67 csub.a r1, #MAX_AREA_SIZE
68 bsg 101f
69 mov r9, #PAGE_SZ
70 sub r9, r9, #1 @ PAGE_MASK
71 1: va2pa r0, r10, r11, r12, r13 @ r10 is PA
72 b 3f
73 2: cand.a r0, r9
74 beq 1b
75 3: movc p0.c5, r10, #11 @ clean D entry
76 nop8
77 add r0, r0, #CACHE_LINESIZE
78 add r10, r10, #CACHE_LINESIZE
79 sub.a r1, r1, #CACHE_LINESIZE
80 bua 2b
81 mov pc, lr
82 #endif
83 101: mov ip, #0
84 movc p0.c5, ip, #10 @ Dcache clean all
85 nop8
86
87 mov pc, lr
88
89
90
91
92
93
94
95
96
97
98
99 .align 5
100 ENTRY(cpu_do_switch_mm)
101 movc p0.c2, r0, #0 @ update page table ptr
102 nop8
103
104 movc p0.c6, ip, #6 @ TLB invalidate all
105 nop8
106
107 mov pc, lr
108
109
110
111
112
113
114
115
116
117 .align 5
118 ENTRY(cpu_set_pte)
119 stw r1, [r0]
120 #ifndef CONFIG_CPU_DCACHE_LINE_DISABLE
121 sub r2, r0, #PAGE_OFFSET
122 movc p0.c5, r2, #11 @ Dcache clean line
123 nop8
124 #else
125 mov ip, #0
126 movc p0.c5, ip, #10 @ Dcache clean all
127 nop8
128 @dcacheline_flush r0, r2, ip
129 #endif
130 mov pc, lr
131