1
2
3
4
5
6
7
8 #include <linux/linkage.h>
9 #include <linux/init.h>
10 #include <asm/asm-offsets.h>
11 #include <asm/mem-layout.h>
12 #include <asm/vm_mmu.h>
13 #include <asm/page.h>
14 #include <asm/hexagon_vm.h>
15
16 #define SEGTABLE_ENTRIES #0x0e0
17
18 __INIT
19 ENTRY(stext)
20
21
22
23
24
25
26
27
28 r24.L = #LO(swapper_pg_dir)
29 r24.H = #HI(swapper_pg_dir)
30
31
32
33
34
35 r25 = pc;
36 r2.h = #0xffc0;
37 r2.l = #0x0000;
38 r25 = and(r2,r25);
39 r1.h = #HI(PAGE_OFFSET);
40 r1.l = #LO(PAGE_OFFSET);
41 r24 = sub(r24,r1);
42 r24 = add(r24,r25);
43
44 r0 = r24;
45
46
47
48
49
50
51 #define PTE_BITS ( __HVM_PTE_R | __HVM_PTE_W | __HVM_PTE_X \
52 | __HEXAGON_C_WB_L2 << 6 \
53 | __HVM_PDE_S_4MB)
54
55
56
57
58
59
60 {
61 r1.l = #LO(_end);
62 r2.l = #LO(stext);
63 r3 = #1;
64 }
65 {
66 r1.h = #HI(_end);
67 r2.h = #HI(stext);
68 r3 = asl(r3, #22);
69 }
70 {
71 r1 = sub(r1, r2);
72 r3 = add(r3, #-1);
73 }
74 r1 = add(r1, r3);
75 r26 = lsr(r1, #22);
76
77 r1 = r25;
78 r2.h = #0xffc0;
79 r2.l = #0x0000;
80 r1 = and(r1,r2);
81 r2 = lsr(r1, #22)
82 r2 = asl(r2, #2)
83 r0 = add(r0,r2)
84 r2 = #PTE_BITS
85 r1 = add(r1,r2)
86 r2.h = #0x0040
87 r2.l = #0x0000
88 loop0(1f,r26);
89 1:
90 memw(r0 ++ #4) = r1
91 { r1 = add(r1, r2); } :endloop0
92
93
94
95 R1.H = #HI(PAGE_OFFSET >> (22 - 2))
96 R1.L = #LO(PAGE_OFFSET >> (22 - 2))
97
98 r0 = add(r1, r24);
99 r1 = r25;
100 r2.h = #0xffc0;
101 r2.l = #0x0000;
102 r1 = and(r1,r2);
103 r2 = #PTE_BITS
104 r1 = add(r1,r2);
105 r2.h = #0x0040
106 r2.l = #0x0000
107
108 loop0(1f,SEGTABLE_ENTRIES);
109 1:
110 memw(r0 ++ #4) = r1;
111 { r1 = add(r1,r2); } :endloop0
112
113 r0 = r24;
114
115
116
117
118
119
120
121 r1 = #VM_TRANS_TYPE_TABLE
122 call __vmnewmap;
123
124
125
126 r31.h = #hi(__head_s_vaddr_target)
127 r31.l = #lo(__head_s_vaddr_target)
128 jumpr r31
129
130
131
132 __head_s_vaddr_target:
133
134
135
136
137 r0 = #__HVM_PDE_S_INVALID
138
139 r1.h = #0xffc0;
140 r1.l = #0x0000;
141 r2 = r25;
142 r2 = and(r1,r2);
143
144 r1.l = #lo(swapper_pg_dir)
145 r1.h = #hi(swapper_pg_dir)
146 r2 = lsr(r2, #22)
147 r2 = asl(r2, #2)
148 r1 = add(r1,r2);
149 loop0(1f,r26)
150
151 1:
152 {
153 memw(R1 ++ #4) = R0
154 }:endloop0
155
156 r0 = r24
157 r1 = #VM_TRANS_TYPE_TABLE
158 call __vmnewmap
159
160
161 r0.h = #hi(_K_provisional_vec)
162 r0.l = #lo(_K_provisional_vec)
163 call __vmsetvec
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186 {r29.H = #HI(init_thread_union); r0.H = #HI(_THREAD_SIZE); }
187 {r29.L = #LO(init_thread_union); r0.L = #LO(_THREAD_SIZE); }
188
189
190
191 {r29 = add(r29,r0); THREADINFO_REG = r29; }
192
193
194 { r0.L = #LO(__bss_start); r1 = #0; r2.l = #LO(__bss_stop); }
195 { r0.H = #HI(__bss_start); r2.h = #HI(__bss_stop); }
196
197 r2 = sub(r2,r0);
198 call memset;
199
200
201 #ifdef CONFIG_HEXAGON_PHYS_OFFSET
202 r0.l = #LO(__phys_offset);
203 r0.h = #HI(__phys_offset);
204 memw(r0) = r25;
205 #endif
206
207
208 call start_kernel
209
210
211
212
213 1:
214 jump 1b
215
216 .p2align PAGE_SHIFT
217 ENTRY(external_cmdline_buffer)
218 .fill _PAGE_SIZE,1,0
219
220 .data
221 .p2align PAGE_SHIFT
222 ENTRY(empty_zero_page)
223 .fill _PAGE_SIZE,1,0