1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24#include <config.h>
25#include <timestamp.h>
26#include "version.h"
27#include <asm/cache.h>
28
29#ifndef CONFIG_IDENT_STRING
30#define CONFIG_IDENT_STRING ""
31#endif
32
33#define _START _start
34#define _FAULT _fault
35
36#define SAVE_ALL \
37 move.w
38 subl
39 moveml %d0-%d7/%a0-%a6,%sp@;
40
41#define RESTORE_ALL \
42 moveml %sp@,%d0-%d7/%a0-%a6; \
43 addl
44 rte;
45
46.text
47
48
49
50
51_vectors:
52
53INITSP: .long 0x00000000
54INITPC: .long _START
55vector02: .long _FAULT
56vector03: .long _FAULT
57vector04: .long _FAULT
58vector05: .long _FAULT
59vector06: .long _FAULT
60vector07: .long _FAULT
61vector08: .long _FAULT
62vector09: .long _FAULT
63vector0A: .long _FAULT
64vector0B: .long _FAULT
65vector0C: .long _FAULT
66vector0D: .long _FAULT
67vector0E: .long _FAULT
68vector0F: .long _FAULT
69
70
71vector10_17:
72.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
73
74vector18: .long _FAULT
75vector19: .long _FAULT
76vector1A: .long _FAULT
77vector1B: .long _FAULT
78vector1C: .long _FAULT
79vector1D: .long _FAULT
80vector1E: .long _FAULT
81vector1F: .long _FAULT
82
83
84vector20_2F:
85.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
86.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
87
88
89vector30_3F:
90.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
91.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
92
93vector64_127:
94.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
95.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
96.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
97.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
98.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
99.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
100.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
101.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
102
103vector128_191:
104.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
105.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
106.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
107.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
108.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
109.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
110.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
111.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
112
113vector192_255:
114.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
115.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
116.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
117.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
118.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
119.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
120.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
121.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
122
123 .text
124
125 .globl _start
126_start:
127 nop
128 nop
129 move.w
130
131
132 move.l
133 movec %d0, %VBR
134
135 move.l
136 movec %d0, %RAMBAR0
137
138 move.l
139 movec %d0, %RAMBAR1
140
141 move.l
142 move.c %d0, %MBAR
143
144
145 move.l
146 movec %d0, %CACR
147 move.l
148 movec %d0, %ACR0
149 movec %d0, %ACR1
150 movec %d0, %ACR2
151 movec %d0, %ACR3
152
153
154 move.l
155 move.l
156 move.l
157 move.l %d0, (%a1)
158 move.l %d0, (%a2)
159
160
161
162 move.l
163 clr.l %sp@-
164
165 move.l
166
167 bsr cpu_init_f
168 bsr board_init_f
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185 .globl relocate_code
186relocate_code:
187 link.w %a6,
188 move.l 8(%a6), %sp
189
190 move.l 12(%a6), %d0
191 move.l 16(%a6), %a0
192
193 move.l
194 move.l
195 move.l %a0, %a3
196
197
1981:
199 move.l (%a1)+, (%a3)+
200 cmp.l %a1,%a2
201 bgt.s 1b
202
203
204
205
206
207 move.l %a0, %a1
208 add.l
209 jmp (%a1)
210
211in_ram:
212
213clear_bss:
214
215
216
217 move.l %a0, %a1
218 add.l
219 move.l %a0, %d1
220 add.l
2216:
222 clr.l (%a1)+
223 cmp.l %a1,%d1
224 bgt.s 6b
225
226
227
228
229 move.l %a0, %a1
230 add.l
231 move.l %a1,%a5
232
233 move.l %a0, %a2
234 add.l
235
2367:
237 move.l (%a1),%d1
238 sub.l
239 add.l %a0,%d1
240 move.l %d1,(%a1)+
241 cmp.l %a2, %a1
242 bne 7b
243
244
245 move.l %a0, %a1
246 add.l
247
248
249 move.l %a0,-(%sp)
250 move.l %d0,-(%sp)
251 jsr (%a1)
252
253
254
255 .globl _fault
256_fault:
257 bra _fault
258 .globl _exc_handler
259
260_exc_handler:
261 SAVE_ALL
262 movel %sp,%sp@-
263 bsr exc_handler
264 addql
265 RESTORE_ALL
266
267 .globl _int_handler
268_int_handler:
269 SAVE_ALL
270 movel %sp,%sp@-
271 bsr int_handler
272 addql
273 RESTORE_ALL
274
275
276
277 .globl version_string
278version_string:
279 .ascii U_BOOT_VERSION
280 .ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
281 .ascii CONFIG_IDENT_STRING, "\0"
282 .align 4
283