1
2
3
4
5
6
7
8
9
10#include <asm/setup.h>
11#include <asm/thread_info.h>
12#include <asm/sysreg.h>
13
14
15
16
17
18
19
20
21
22 .section .init.text,"ax"
23 .global _start
24_start:
25
26 lddpc r2, bss_start_addr
27 lddpc r3, end_addr
28 mov r0, 0
29 mov r1, 0
301: st.d r2++, r0
31 cp r2, r3
32 brlo 1b
33
34
35 lddpc r0, init_sr
36 mtsr SYSREG_SR, r0
37
38
39 lddpc sp, stack_addr
40 sub sp, -THREAD_SIZE
41
42#ifdef CONFIG_FRAME_POINTER
43
44 mov lr, 0
45 mov r7, 0
46#endif
47
48
49 lddpc r0, magic_number
50 cp.w r12, r0
51 brne no_tag_table
52
53
54
55
56
57 lddpc r0, tag_table_addr
58 st.w r0[0], r11
59
60
61 rjmp kernel_entry
62
63 .align 2
64magic_number:
65 .long ATAG_MAGIC
66tag_table_addr:
67 .long bootloader_tags
68bss_start_addr:
69 .long __bss_start
70end_addr:
71 .long _end
72init_sr:
73 .long 0x007f0000
74stack_addr:
75 .long init_thread_union
76panic_addr:
77 .long panic
78
79no_tag_table:
80 sub r12, pc, (. - 2f)
81
82 lddpc pc, panic_addr
832: .asciz "Boot loader didn't provide correct magic number\n"
84