diff options
author | Mike Frysinger <vapier.adi@gmail.com> | 2008-08-06 05:15:27 -0400 |
---|---|---|
committer | Bryan Wu <cooloney@kernel.org> | 2008-08-06 05:15:27 -0400 |
commit | 09e1f70e31ed6ca23dd42feb10aa104fc1b04c40 (patch) | |
tree | be3b8fb1813414395fa4c11ad51698414191e043 /arch/blackfin/mach-common | |
parent | 778307d372555f979cf6cef112a6d7fbff056cd9 (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')
-rw-r--r-- | arch/blackfin/mach-common/Makefile | 2 | ||||
-rw-r--r-- | arch/blackfin/mach-common/head.S | 76 |
2 files changed, 77 insertions, 1 deletions
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 | ||
5 | obj-y := \ | 5 | obj-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 | ||
9 | obj-$(CONFIG_PM) += pm.o dpmc_modes.o | 9 | obj-$(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 | |||
23 | ENTRY(_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; | ||
74 | ENDPROC(_real_start) | ||
75 | |||
76 | __FINIT | ||