aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/mach-common/head.S
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 /arch/blackfin/mach-common/head.S
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>
Diffstat (limited to 'arch/blackfin/mach-common/head.S')
-rw-r--r--arch/blackfin/mach-common/head.S76
1 files changed, 76 insertions, 0 deletions
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