aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Frysinger <vapier.adi@gmail.com>2008-08-06 05:15:27 -0400
committerBryan Wu <cooloney@kernel.org>2008-08-06 05:15:27 -0400
commit09e1f70e31ed6ca23dd42feb10aa104fc1b04c40 (patch)
treebe3b8fb1813414395fa4c11ad51698414191e043
parent778307d372555f979cf6cef112a6d7fbff056cd9 (diff)
Blackfin arch: unify the duplicated _real_start functions
Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
-rw-r--r--arch/blackfin/mach-bf527/head.S70
-rw-r--r--arch/blackfin/mach-bf533/head.S70
-rw-r--r--arch/blackfin/mach-bf537/head.S70
-rw-r--r--arch/blackfin/mach-bf548/head.S73
-rw-r--r--arch/blackfin/mach-bf561/head.S70
-rw-r--r--arch/blackfin/mach-common/Makefile2
-rw-r--r--arch/blackfin/mach-common/head.S76
7 files changed, 77 insertions, 354 deletions
diff --git a/arch/blackfin/mach-bf527/head.S b/arch/blackfin/mach-bf527/head.S
index a16a26575280..180d3c85a4c1 100644
--- a/arch/blackfin/mach-bf527/head.S
+++ b/arch/blackfin/mach-bf527/head.S
@@ -226,76 +226,6 @@ ENTRY(__start)
226 jump .LWAIT_HERE; 226 jump .LWAIT_HERE;
227ENDPROC(__start) 227ENDPROC(__start)
228 228
229ENTRY(_real_start)
230 [ -- sp ] = reti;
231 p0.l = lo(WDOG_CTL);
232 p0.h = hi(WDOG_CTL);
233 r0 = 0xAD6(z);
234 w[p0] = r0; /* watchdog off for now */
235 ssync;
236
237 /* Code update for BSS size == 0
238 * Zero out the bss region.
239 */
240
241 p1.l = ___bss_start;
242 p1.h = ___bss_start;
243 p2.l = ___bss_stop;
244 p2.h = ___bss_stop;
245 r0 = 0;
246 p2 -= p1;
247 lsetup (.L_clear_bss, .L_clear_bss) lc0 = p2;
248.L_clear_bss:
249 B[p1++] = r0;
250
251 /* In case there is a NULL pointer reference
252 * Zero out region before stext
253 */
254
255 p1.l = 0x0;
256 p1.h = 0x0;
257 r0.l = __stext;
258 r0.h = __stext;
259 r0 = r0 >> 1;
260 p2 = r0;
261 r0 = 0;
262 lsetup (.L_clear_zero, .L_clear_zero) lc0 = p2;
263.L_clear_zero:
264 W[p1++] = r0;
265
266 /* pass the uboot arguments to the global value command line */
267 R0 = R7;
268 call _cmdline_init;
269
270 p1.l = __rambase;
271 p1.h = __rambase;
272 r0.l = __sdata;
273 r0.h = __sdata;
274 [p1] = r0;
275
276 p1.l = __ramstart;
277 p1.h = __ramstart;
278 p3.l = ___bss_stop;
279 p3.h = ___bss_stop;
280
281 r1 = p3;
282 [p1] = r1;
283
284 /*
285 * load the current thread pointer and stack
286 */
287 r1.l = _init_thread_union;
288 r1.h = _init_thread_union;
289
290 r2.l = 0x2000;
291 r2.h = 0x0000;
292 r1 = r1 + r2;
293 sp = r1;
294 usp = sp;
295 fp = sp;
296 jump.l _start_kernel;
297ENDPROC(_real_start)
298
299__FINIT 229__FINIT
300 230
301.section .l1.text 231.section .l1.text
diff --git a/arch/blackfin/mach-bf533/head.S b/arch/blackfin/mach-bf533/head.S
index fb49169c0e7b..0ffbe7a205ba 100644
--- a/arch/blackfin/mach-bf533/head.S
+++ b/arch/blackfin/mach-bf533/head.S
@@ -228,76 +228,6 @@ ENTRY(__start)
228 jump .LWAIT_HERE; 228 jump .LWAIT_HERE;
229ENDPROC(__start) 229ENDPROC(__start)
230 230
231ENTRY(_real_start)
232 [ -- sp ] = reti;
233 p0.l = lo(WDOG_CTL);
234 p0.h = hi(WDOG_CTL);
235 r0 = 0xAD6(z);
236 w[p0] = r0; /* watchdog off for now */
237 ssync;
238
239 /* Code update for BSS size == 0
240 * Zero out the bss region.
241 */
242
243 p1.l = ___bss_start;
244 p1.h = ___bss_start;
245 p2.l = ___bss_stop;
246 p2.h = ___bss_stop;
247 r0 = 0;
248 p2 -= p1;
249 lsetup (.L_clear_bss, .L_clear_bss) lc0 = p2;
250.L_clear_bss:
251 B[p1++] = r0;
252
253 /* In case there is a NULL pointer reference
254 * Zero out region before stext
255 */
256
257 p1.l = 0x0;
258 p1.h = 0x0;
259 r0.l = __stext;
260 r0.h = __stext;
261 r0 = r0 >> 1;
262 p2 = r0;
263 r0 = 0;
264 lsetup (.L_clear_zero, .L_clear_zero) lc0 = p2;
265.L_clear_zero:
266 W[p1++] = r0;
267
268 /* pass the uboot arguments to the global value command line */
269 R0 = R7;
270 call _cmdline_init;
271
272 p1.l = __rambase;
273 p1.h = __rambase;
274 r0.l = __sdata;
275 r0.h = __sdata;
276 [p1] = r0;
277
278 p1.l = __ramstart;
279 p1.h = __ramstart;
280 p3.l = ___bss_stop;
281 p3.h = ___bss_stop;
282
283 r1 = p3;
284 [p1] = r1;
285
286 /*
287 * load the current thread pointer and stack
288 */
289 r1.l = _init_thread_union;
290 r1.h = _init_thread_union;
291
292 r2.l = 0x2000;
293 r2.h = 0x0000;
294 r1 = r1 + r2;
295 sp = r1;
296 usp = sp;
297 fp = sp;
298 jump.l _start_kernel;
299ENDPROC(_real_start)
300
301__FINIT 231__FINIT
302 232
303.section .l1.text 233.section .l1.text
diff --git a/arch/blackfin/mach-bf537/head.S b/arch/blackfin/mach-bf537/head.S
index 5bc89bbb89d0..c11f0fd82255 100644
--- a/arch/blackfin/mach-bf537/head.S
+++ b/arch/blackfin/mach-bf537/head.S
@@ -240,76 +240,6 @@ ENTRY(__start)
240 jump .LWAIT_HERE; 240 jump .LWAIT_HERE;
241ENDPROC(__start) 241ENDPROC(__start)
242 242
243ENTRY(_real_start)
244 [ -- sp ] = reti;
245 p0.l = lo(WDOG_CTL);
246 p0.h = hi(WDOG_CTL);
247 r0 = 0xAD6(z);
248 w[p0] = r0; /* watchdog off for now */
249 ssync;
250
251 /* Code update for BSS size == 0
252 * Zero out the bss region.
253 */
254
255 p1.l = ___bss_start;
256 p1.h = ___bss_start;
257 p2.l = ___bss_stop;
258 p2.h = ___bss_stop;
259 r0 = 0;
260 p2 -= p1;
261 lsetup (.L_clear_bss, .L_clear_bss) lc0 = p2;
262.L_clear_bss:
263 B[p1++] = r0;
264
265 /* In case there is a NULL pointer reference
266 * Zero out region before stext
267 */
268
269 p1.l = 0x0;
270 p1.h = 0x0;
271 r0.l = __stext;
272 r0.h = __stext;
273 r0 = r0 >> 1;
274 p2 = r0;
275 r0 = 0;
276 lsetup (.L_clear_zero, .L_clear_zero) lc0 = p2;
277.L_clear_zero:
278 W[p1++] = r0;
279
280 /* pass the uboot arguments to the global value command line */
281 R0 = R7;
282 call _cmdline_init;
283
284 p1.l = __rambase;
285 p1.h = __rambase;
286 r0.l = __sdata;
287 r0.h = __sdata;
288 [p1] = r0;
289
290 p1.l = __ramstart;
291 p1.h = __ramstart;
292 p3.l = ___bss_stop;
293 p3.h = ___bss_stop;
294
295 r1 = p3;
296 [p1] = r1;
297
298 /*
299 * load the current thread pointer and stack
300 */
301 r1.l = _init_thread_union;
302 r1.h = _init_thread_union;
303
304 r2.l = 0x2000;
305 r2.h = 0x0000;
306 r1 = r1 + r2;
307 sp = r1;
308 usp = sp;
309 fp = sp;
310 jump.l _start_kernel;
311ENDPROC(_real_start)
312
313__FINIT 243__FINIT
314 244
315.section .l1.text 245.section .l1.text
diff --git a/arch/blackfin/mach-bf548/head.S b/arch/blackfin/mach-bf548/head.S
index 06b9178cfcfe..96fbdb790a98 100644
--- a/arch/blackfin/mach-bf548/head.S
+++ b/arch/blackfin/mach-bf548/head.S
@@ -212,79 +212,6 @@ ENTRY(__start)
212 jump .LWAIT_HERE; 212 jump .LWAIT_HERE;
213ENDPROC(__start) 213ENDPROC(__start)
214 214
215ENTRY(_real_start)
216 [ -- sp ] = reti;
217 p0.l = lo(WDOG_CTL);
218 p0.h = hi(WDOG_CTL);
219 r0 = 0xAD6(z);
220 w[p0] = r0; /* watchdog off for now */
221 ssync;
222
223 /* Code update for BSS size == 0
224 * Zero out the bss region.
225 */
226
227 p1.l = ___bss_start;
228 p1.h = ___bss_start;
229 p2.l = ___bss_stop;
230 p2.h = ___bss_stop;
231 r0 = 0;
232 p2 -= p1;
233 lsetup (.L_clear_bss, .L_clear_bss ) lc0 = p2;
234.L_clear_bss:
235 B[p1++] = r0;
236
237 /* In case there is a NULL pointer reference
238 * Zero out region before stext
239 */
240
241 p1.l = 0x0;
242 p1.h = 0x0;
243 r0.l = __stext;
244 r0.h = __stext;
245 r0 = r0 >> 1;
246 p2 = r0;
247 r0 = 0;
248 lsetup (.L_clear_zero, .L_clear_zero ) lc0 = p2;
249.L_clear_zero:
250 W[p1++] = r0;
251
252 /* pass the uboot arguments to the global value command line */
253 R0 = R7;
254 call _cmdline_init;
255
256 p1.l = __rambase;
257 p1.h = __rambase;
258 r0.l = __sdata;
259 r0.h = __sdata;
260 [p1] = r0;
261
262 p1.l = __ramstart;
263 p1.h = __ramstart;
264 p3.l = ___bss_stop;
265 p3.h = ___bss_stop;
266
267 r1 = p3;
268 [p1] = r1;
269
270
271 /*
272 * load the current thread pointer and stack
273 */
274 r1.l = _init_thread_union;
275 r1.h = _init_thread_union;
276
277 r2.l = 0x2000;
278 r2.h = 0x0000;
279 r1 = r1 + r2;
280 sp = r1;
281 usp = sp;
282 fp = sp;
283 call _start_kernel;
284.L_exit:
285 jump.s .L_exit;
286ENDPROC(_real_start)
287
288__FINIT 215__FINIT
289 216
290.section .l1.text 217.section .l1.text
diff --git a/arch/blackfin/mach-bf561/head.S b/arch/blackfin/mach-bf561/head.S
index 0a1443b6b462..553b2d149d71 100644
--- a/arch/blackfin/mach-bf561/head.S
+++ b/arch/blackfin/mach-bf561/head.S
@@ -217,76 +217,6 @@ ENTRY(__start)
217 jump .LWAIT_HERE; 217 jump .LWAIT_HERE;
218ENDPROC(__start) 218ENDPROC(__start)
219 219
220ENTRY(_real_start)
221 [ -- sp ] = reti;
222 p0.l = lo(WDOGA_CTL);
223 p0.h = hi(WDOGA_CTL);
224 r0 = 0xAD6(z);
225 w[p0] = r0; /* watchdog off for now */
226 ssync;
227
228 /* Code update for BSS size == 0
229 * Zero out the bss region.
230 */
231
232 p1.l = ___bss_start;
233 p1.h = ___bss_start;
234 p2.l = ___bss_stop;
235 p2.h = ___bss_stop;
236 r0 = 0;
237 p2 -= p1;
238 lsetup (.L_clear_bss, .L_clear_bss) lc0 = p2;
239.L_clear_bss:
240 B[p1++] = r0;
241
242 /* In case there is a NULL pointer reference
243 * Zero out region before stext
244 */
245
246 p1.l = 0x0;
247 p1.h = 0x0;
248 r0.l = __stext;
249 r0.h = __stext;
250 r0 = r0 >> 1;
251 p2 = r0;
252 r0 = 0;
253 lsetup (.L_clear_zero, .L_clear_zero) lc0 = p2;
254.L_clear_zero:
255 W[p1++] = r0;
256
257 /* pass the uboot arguments to the global value command line */
258 R0 = R7;
259 call _cmdline_init;
260
261 p1.l = __rambase;
262 p1.h = __rambase;
263 r0.l = __sdata;
264 r0.h = __sdata;
265 [p1] = r0;
266
267 p1.l = __ramstart;
268 p1.h = __ramstart;
269 p3.l = ___bss_stop;
270 p3.h = ___bss_stop;
271
272 r1 = p3;
273 [p1] = r1;
274
275 /*
276 * load the current thread pointer and stack
277 */
278 r1.l = _init_thread_union;
279 r1.h = _init_thread_union;
280
281 r2.l = 0x2000;
282 r2.h = 0x0000;
283 r1 = r1 + r2;
284 sp = r1;
285 usp = sp;
286 fp = sp;
287 jump.l _start_kernel;
288ENDPROC(_real_start)
289
290__FINIT 220__FINIT
291 221
292.section .l1.text 222.section .l1.text
diff --git a/arch/blackfin/mach-common/Makefile b/arch/blackfin/mach-common/Makefile
index 5e6b20e423d6..862cd73c9504 100644
--- a/arch/blackfin/mach-common/Makefile
+++ b/arch/blackfin/mach-common/Makefile
@@ -3,7 +3,7 @@
3# 3#
4 4
5obj-y := \ 5obj-y := \
6 cache.o entry.o \ 6 cache.o entry.o head.o \
7 interrupt.o lock.o irqpanic.o arch_checks.o ints-priority.o 7 interrupt.o lock.o irqpanic.o arch_checks.o ints-priority.o
8 8
9obj-$(CONFIG_PM) += pm.o dpmc_modes.o 9obj-$(CONFIG_PM) += pm.o dpmc_modes.o
diff --git a/arch/blackfin/mach-common/head.S b/arch/blackfin/mach-common/head.S
new file mode 100644
index 000000000000..8514da587557
--- /dev/null
+++ b/arch/blackfin/mach-common/head.S
@@ -0,0 +1,76 @@
1/*
2 * Common Blackfin startup code
3 *
4 * Copyright 2004-2008 Analog Devices Inc.
5 *
6 * Enter bugs at http://blackfin.uclinux.org/
7 *
8 * Licensed under the GPL-2 or later.
9 */
10
11#include <linux/linkage.h>
12#include <linux/init.h>
13#include <asm/blackfin.h>
14#include <asm/trace.h>
15
16/* A little BF561 glue ... */
17#ifndef WDOG_CTL
18# define WDOG_CTL WDOGA_CTL
19#endif
20
21__INIT
22
23ENTRY(_real_start)
24 /* Enable nested interrupts */
25 [--sp] = reti;
26
27 /* watchdog off for now */
28 p0.l = lo(WDOG_CTL);
29 p0.h = hi(WDOG_CTL);
30 r0 = 0xAD6(z);
31 w[p0] = r0;
32 ssync;
33
34 /* Zero out the bss region
35 * Note: this will fail if bss is 0 bytes ...
36 */
37 r0 = 0 (z);
38 r1.l = ___bss_start;
39 r1.h = ___bss_start;
40 r2.l = ___bss_stop;
41 r2.h = ___bss_stop;
42 r2 = r2 - r1;
43 r2 >>= 2;
44 p1 = r1;
45 p2 = r2;
46 lsetup (.L_clear_bss, .L_clear_bss) lc0 = p2;
47.L_clear_bss:
48 [p1++] = r0;
49
50 /* In case there is a NULL pointer reference,
51 * zero out region before stext
52 */
53 p1 = r0;
54 r2.l = __stext;
55 r2.h = __stext;
56 r2 >>= 2;
57 p2 = r2;
58 lsetup (.L_clear_zero, .L_clear_zero) lc0 = p2;
59.L_clear_zero:
60 [p1++] = r0;
61
62 /* Pass the u-boot arguments to the global value command line */
63 R0 = R7;
64 call _cmdline_init;
65
66 /* Load the current thread pointer and stack */
67 sp.l = _init_thread_union;
68 sp.h = _init_thread_union;
69 p1 = THREAD_SIZE (z);
70 sp = sp + p1;
71 usp = sp;
72 fp = sp;
73 jump.l _start_kernel;
74ENDPROC(_real_start)
75
76__FINIT