diff options
Diffstat (limited to 'arch/blackfin/mach-common/head.S')
-rw-r--r-- | arch/blackfin/mach-common/head.S | 117 |
1 files changed, 35 insertions, 82 deletions
diff --git a/arch/blackfin/mach-common/head.S b/arch/blackfin/mach-common/head.S index f123a62e2451..e1e42c029e15 100644 --- a/arch/blackfin/mach-common/head.S +++ b/arch/blackfin/mach-common/head.S | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <asm/blackfin.h> | 13 | #include <asm/blackfin.h> |
14 | #include <asm/thread_info.h> | 14 | #include <asm/thread_info.h> |
15 | #include <asm/trace.h> | 15 | #include <asm/trace.h> |
16 | #include <asm/asm-offsets.h> | ||
16 | 17 | ||
17 | __INIT | 18 | __INIT |
18 | 19 | ||
@@ -111,33 +112,26 @@ ENTRY(__start) | |||
111 | * This happens here, since L1 gets clobbered | 112 | * This happens here, since L1 gets clobbered |
112 | * below | 113 | * below |
113 | */ | 114 | */ |
114 | p0.l = _saved_retx; | 115 | GET_PDA(p0, r0); |
115 | p0.h = _saved_retx; | 116 | r7 = [p0 + PDA_RETX]; |
116 | p1.l = _init_saved_retx; | 117 | p1.l = _init_saved_retx; |
117 | p1.h = _init_saved_retx; | 118 | p1.h = _init_saved_retx; |
118 | r0 = [p0]; | 119 | [p1] = r7; |
119 | [p1] = r0; | ||
120 | 120 | ||
121 | p0.l = _saved_dcplb_fault_addr; | 121 | r7 = [p0 + PDA_DCPLB]; |
122 | p0.h = _saved_dcplb_fault_addr; | ||
123 | p1.l = _init_saved_dcplb_fault_addr; | 122 | p1.l = _init_saved_dcplb_fault_addr; |
124 | p1.h = _init_saved_dcplb_fault_addr; | 123 | p1.h = _init_saved_dcplb_fault_addr; |
125 | r0 = [p0]; | 124 | [p1] = r7; |
126 | [p1] = r0; | ||
127 | 125 | ||
128 | p0.l = _saved_icplb_fault_addr; | 126 | r7 = [p0 + PDA_ICPLB]; |
129 | p0.h = _saved_icplb_fault_addr; | ||
130 | p1.l = _init_saved_icplb_fault_addr; | 127 | p1.l = _init_saved_icplb_fault_addr; |
131 | p1.h = _init_saved_icplb_fault_addr; | 128 | p1.h = _init_saved_icplb_fault_addr; |
132 | r0 = [p0]; | 129 | [p1] = r7; |
133 | [p1] = r0; | ||
134 | 130 | ||
135 | p0.l = _saved_seqstat; | 131 | r7 = [p0 + PDA_SEQSTAT]; |
136 | p0.h = _saved_seqstat; | ||
137 | p1.l = _init_saved_seqstat; | 132 | p1.l = _init_saved_seqstat; |
138 | p1.h = _init_saved_seqstat; | 133 | p1.h = _init_saved_seqstat; |
139 | r0 = [p0]; | 134 | [p1] = r7; |
140 | [p1] = r0; | ||
141 | #endif | 135 | #endif |
142 | 136 | ||
143 | /* Initialize stack pointer */ | 137 | /* Initialize stack pointer */ |
@@ -153,7 +147,7 @@ ENTRY(__start) | |||
153 | /* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */ | 147 | /* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */ |
154 | call _bfin_relocate_l1_mem; | 148 | call _bfin_relocate_l1_mem; |
155 | #ifdef CONFIG_BFIN_KERNEL_CLOCK | 149 | #ifdef CONFIG_BFIN_KERNEL_CLOCK |
156 | call _start_dma_code; | 150 | call _init_clocks; |
157 | #endif | 151 | #endif |
158 | 152 | ||
159 | /* This section keeps the processor in supervisor mode | 153 | /* This section keeps the processor in supervisor mode |
@@ -170,12 +164,8 @@ ENTRY(__start) | |||
170 | [p0] = p1; | 164 | [p0] = p1; |
171 | csync; | 165 | csync; |
172 | 166 | ||
173 | p0.l = lo(IMASK); | 167 | r0 = EVT_IVG15 (z); |
174 | p0.h = hi(IMASK); | 168 | sti r0; |
175 | p1.l = IMASK_IVG15; | ||
176 | p1.h = 0x0; | ||
177 | [p0] = p1; | ||
178 | csync; | ||
179 | 169 | ||
180 | raise 15; | 170 | raise 15; |
181 | p0.l = .LWAIT_HERE; | 171 | p0.l = .LWAIT_HERE; |
@@ -195,6 +185,19 @@ ENDPROC(__start) | |||
195 | # define WDOG_CTL WDOGA_CTL | 185 | # define WDOG_CTL WDOGA_CTL |
196 | #endif | 186 | #endif |
197 | 187 | ||
188 | ENTRY(__init_clear_bss) | ||
189 | r2 = r2 - r1; | ||
190 | cc = r2 == 0; | ||
191 | if cc jump .L_bss_done; | ||
192 | r2 >>= 2; | ||
193 | p1 = r1; | ||
194 | p2 = r2; | ||
195 | lsetup (1f, 1f) lc0 = p2; | ||
196 | 1: [p1++] = r0; | ||
197 | .L_bss_done: | ||
198 | rts; | ||
199 | ENDPROC(__init_clear_bss) | ||
200 | |||
198 | ENTRY(_real_start) | 201 | ENTRY(_real_start) |
199 | /* Enable nested interrupts */ | 202 | /* Enable nested interrupts */ |
200 | [--sp] = reti; | 203 | [--sp] = reti; |
@@ -206,87 +209,34 @@ ENTRY(_real_start) | |||
206 | w[p0] = r0; | 209 | w[p0] = r0; |
207 | ssync; | 210 | ssync; |
208 | 211 | ||
212 | r0 = 0 (x); | ||
213 | /* Zero out all of the fun bss regions */ | ||
209 | #if L1_DATA_A_LENGTH > 0 | 214 | #if L1_DATA_A_LENGTH > 0 |
210 | r1.l = __sbss_l1; | 215 | r1.l = __sbss_l1; |
211 | r1.h = __sbss_l1; | 216 | r1.h = __sbss_l1; |
212 | r2.l = __ebss_l1; | 217 | r2.l = __ebss_l1; |
213 | r2.h = __ebss_l1; | 218 | r2.h = __ebss_l1; |
214 | r0 = 0 (z); | 219 | call __init_clear_bss |
215 | r2 = r2 - r1; | ||
216 | cc = r2 == 0; | ||
217 | if cc jump .L_a_l1_done; | ||
218 | r2 >>= 2; | ||
219 | p1 = r1; | ||
220 | p2 = r2; | ||
221 | lsetup (.L_clear_a_l1, .L_clear_a_l1 ) lc0 = p2; | ||
222 | .L_clear_a_l1: | ||
223 | [p1++] = r0; | ||
224 | .L_a_l1_done: | ||
225 | #endif | 220 | #endif |
226 | |||
227 | #if L1_DATA_B_LENGTH > 0 | 221 | #if L1_DATA_B_LENGTH > 0 |
228 | r1.l = __sbss_b_l1; | 222 | r1.l = __sbss_b_l1; |
229 | r1.h = __sbss_b_l1; | 223 | r1.h = __sbss_b_l1; |
230 | r2.l = __ebss_b_l1; | 224 | r2.l = __ebss_b_l1; |
231 | r2.h = __ebss_b_l1; | 225 | r2.h = __ebss_b_l1; |
232 | r0 = 0 (z); | 226 | call __init_clear_bss |
233 | r2 = r2 - r1; | ||
234 | cc = r2 == 0; | ||
235 | if cc jump .L_b_l1_done; | ||
236 | r2 >>= 2; | ||
237 | p1 = r1; | ||
238 | p2 = r2; | ||
239 | lsetup (.L_clear_b_l1, .L_clear_b_l1 ) lc0 = p2; | ||
240 | .L_clear_b_l1: | ||
241 | [p1++] = r0; | ||
242 | .L_b_l1_done: | ||
243 | #endif | 227 | #endif |
244 | |||
245 | #if L2_LENGTH > 0 | 228 | #if L2_LENGTH > 0 |
246 | r1.l = __sbss_l2; | 229 | r1.l = __sbss_l2; |
247 | r1.h = __sbss_l2; | 230 | r1.h = __sbss_l2; |
248 | r2.l = __ebss_l2; | 231 | r2.l = __ebss_l2; |
249 | r2.h = __ebss_l2; | 232 | r2.h = __ebss_l2; |
250 | r0 = 0 (z); | 233 | call __init_clear_bss |
251 | r2 = r2 - r1; | ||
252 | cc = r2 == 0; | ||
253 | if cc jump .L_l2_done; | ||
254 | r2 >>= 2; | ||
255 | p1 = r1; | ||
256 | p2 = r2; | ||
257 | lsetup (.L_clear_l2, .L_clear_l2 ) lc0 = p2; | ||
258 | .L_clear_l2: | ||
259 | [p1++] = r0; | ||
260 | .L_l2_done: | ||
261 | #endif | 234 | #endif |
262 | |||
263 | /* Zero out the bss region | ||
264 | * Note: this will fail if bss is 0 bytes ... | ||
265 | */ | ||
266 | r0 = 0 (z); | ||
267 | r1.l = ___bss_start; | 235 | r1.l = ___bss_start; |
268 | r1.h = ___bss_start; | 236 | r1.h = ___bss_start; |
269 | r2.l = ___bss_stop; | 237 | r2.l = ___bss_stop; |
270 | r2.h = ___bss_stop; | 238 | r2.h = ___bss_stop; |
271 | r2 = r2 - r1; | 239 | call __init_clear_bss |
272 | r2 >>= 2; | ||
273 | p1 = r1; | ||
274 | p2 = r2; | ||
275 | lsetup (.L_clear_bss, .L_clear_bss) lc0 = p2; | ||
276 | .L_clear_bss: | ||
277 | [p1++] = r0; | ||
278 | |||
279 | /* In case there is a NULL pointer reference, | ||
280 | * zero out region before stext | ||
281 | */ | ||
282 | p1 = r0; | ||
283 | r2.l = __stext; | ||
284 | r2.h = __stext; | ||
285 | r2 >>= 2; | ||
286 | p2 = r2; | ||
287 | lsetup (.L_clear_zero, .L_clear_zero) lc0 = p2; | ||
288 | .L_clear_zero: | ||
289 | [p1++] = r0; | ||
290 | 240 | ||
291 | /* Pass the u-boot arguments to the global value command line */ | 241 | /* Pass the u-boot arguments to the global value command line */ |
292 | R0 = R7; | 242 | R0 = R7; |
@@ -299,6 +249,9 @@ ENTRY(_real_start) | |||
299 | sp = sp + p1; | 249 | sp = sp + p1; |
300 | usp = sp; | 250 | usp = sp; |
301 | fp = sp; | 251 | fp = sp; |
252 | sp += -12; | ||
253 | call _init_pda | ||
254 | sp += 12; | ||
302 | jump.l _start_kernel; | 255 | jump.l _start_kernel; |
303 | ENDPROC(_real_start) | 256 | ENDPROC(_real_start) |
304 | 257 | ||