1
2
3
4
5
6
7
8#include <asm-offsets.h>
9#include <config.h>
10#include "version.h"
11#include <asm/cache.h>
12
13#define _START _start
14#define _FAULT _fault
15
16
17#define SAVE_ALL \
18 move.w
19 subl
20 moveml %d0-%d7/%a0-%a6,%sp@; \
21
22#define RESTORE_ALL \
23 moveml %sp@,%d0-%d7/%a0-%a6; \
24 addl
25 rte
26
27
28
29
30
31
32.text
33
34
35
36
37
38_vectors:
39.long 0x00000000
40
41.long _start - CONFIG_SYS_TEXT_BASE
42#else
43.long _START
44#endif
45
46.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
47.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
48.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
49.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
50.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
51.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
52.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
53.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
54
55.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
56.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
57.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
58.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
59.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
60.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
61.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
62.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
63
64.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
65.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
66.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
67.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
68.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
69.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
70.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
71.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
72
73.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
74.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
75.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
76.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
77.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
78.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
79.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
80.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
81
82#endif
83
84.text
85
86
87 (defined(CONFIG_M5282) || defined(CONFIG_M5281))
88
89.long 0x55AA55AA,0xAA55AA55
90.long 0xFFFFFFFF
91.long 0x00000000
92.long 0x00000000
93.long 0x00000000
94#endif
95#endif
96
97.globl _start
98_start:
99 nop
100 nop
101 move.w
102
103
104
105 move.l
106 movec %d0, %RAMBAR1
107#endif
108
109
110
111 move.l
112 move.c %d0, %MBAR
113
114
115#ifdef CONFIG_SYS_MBAR2
116
117 move.l
118
119 movec %d0,
120#endif
121 move.l
122 movec %d0, %RAMBAR0
123#endif
124
125
126
127 move.l
128 move.l %d0, 0x40000000
129
130
131 move.l
132 movec %d0, %RAMBAR1
133
134
135
136
137
138
139
140 move.l
141 move.l
142 move.l
143_copy_flash:
144 move.l (%a0)+, (%a2)+
145 cmp.l %a0, %a1
146 bgt.s _copy_flash
147 jmp CONFIG_SYS_INIT_RAM_ADDR
148
149_flashbar_setup:
150
151 move.l
152 movec %d0, %FLASHBAR
153 jmp _after_flashbar_copy.L
154_flashbar_setup_end:
155 nop
156_after_flashbar_copy:
157#else
158
159 move.l
160 movec %d0, %FLASHBAR
161#endif
162
163#endif
164#endif
165
166
167
168
169
170
171 move.l
172#else
173 move.l
174#endif
175 movec %d0, %VBR
176#endif
177
178#ifdef CONFIG_M5275
179
180 move.l
181 move.l %d0, 0x40000000
182
183
184
185 move.l
186 movec %d0, %RAMBAR1
187#endif
188
189
190 move.l
191 move.l
192 move.l
193 move.l %d0, (%a1)
194 move.l %d0, (%a2)
195
196
197 move.l
198
199
200 move.l
201
202
203
204
205
206 move.l %sp, -(%sp)
207 move.l
208 jsr (%a1)
209
210
211 move.l %d0, %sp
212 move.l %sp, %fp
213
214
215 move.l %d0, -(%sp)
216 move.l
217 jsr (%a1)
218
219
220 move.l
221 jsr (%a1)
222
223
224 clr.l %sp@-
225 move.l
226 jsr (%a1)
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243.globl relocate_code
244relocate_code:
245 link.w %a6,
246 move.l 8(%a6), %sp
247
248 move.l 12(%a6), %d0
249 move.l 16(%a6), %a0
250
251 move.l
252 move.l
253 move.l %a0, %a3
254
2551:
256 move.l (%a1)+, (%a3)+
257 cmp.l %a1,%a2
258 bgt.s 1b
259
260
261
262
263
264 move.l %a0, %a1
265 add.l
266 jmp (%a1)
267
268in_ram:
269
270clear_bss:
271
272
273
274 move.l %a0, %a1
275 add.l
276 move.l %a0, %d1
277 add.l
2786:
279 clr.l (%a1)+
280 cmp.l %a1,%d1
281 bgt.s 6b
282
283
284
285
286 move.l %a0, %a1
287 add.l
288 move.l %a1,%a5
289
290 move.l %a0, %a2
291 add.l
292
2937:
294 move.l (%a1),%d1
295 sub.l
296 add.l %a0,%d1
297 move.l %d1,(%a1)+
298 cmp.l %a2, %a1
299 bne 7b
300
301
302 move.l %a0, %a1
303 add.l
304
305
306 move.l %a0,-(%sp)
307 move.l %d0,-(%sp)
308
309 defined(CONFIG_SYS_HALT_BEFOR_RAM_JUMP)
310 halt
311#endif
312 jsr (%a1)
313
314
315
316
317.globl _fault
318_fault:
319 bra _fault
320
321.globl _exc_handler
322_exc_handler:
323 SAVE_ALL
324 movel %sp,%sp@-
325 bsr exc_handler
326 addql
327 RESTORE_ALL
328
329.globl _int_handler
330_int_handler:
331 SAVE_ALL
332 movel %sp,%sp@-
333 bsr int_handler
334 addql
335 RESTORE_ALL
336
337
338
339.globl version_string
340version_string:
341.ascii U_BOOT_VERSION_STRING, "\0"
342.align 4
343