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#ifndef CONFIG_IDENT_STRING
14#define CONFIG_IDENT_STRING ""
15#endif
16
17#define _START _start
18#define _FAULT _fault
19
20
21#define SAVE_ALL \
22 move.w
23 subl
24 moveml %d0-%d7/%a0-%a6,%sp@; \
25
26#define RESTORE_ALL \
27 moveml %sp@,%d0-%d7/%a0-%a6; \
28 addl
29 rte
30
31
32
33
34
35
36.text
37
38
39
40
41_vectors:
42
43.long 0x00000000
44
45.long _start - CONFIG_SYS_TEXT_BASE
46#else
47.long _START
48#endif
49
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, _FAULT, _FAULT
54.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
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
58
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.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
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
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.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
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
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.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
82.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
83.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
84.long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
85
86#endif
87
88 .text
89
90
91
92 (defined(CONFIG_M5282) || defined(CONFIG_M5281))
93
94 .long 0x55AA55AA,0xAA55AA55
95 .long 0xFFFFFFFF
96 .long 0x00000000
97 .long 0x00000000
98 .long 0x00000000
99 #endif
100#endif
101 .globl _start
102_start:
103 nop
104 nop
105 move.w
106
107
108
109 move.l
110 movec %d0, %RAMBAR1
111#endif
112
113
114 move.l
115 move.c %d0, %MBAR
116
117
118#ifdef CONFIG_SYS_MBAR2
119 move.l
120 movec %d0,
121#endif
122
123 move.l
124 movec %d0, %RAMBAR0
125#endif
126
127
128
129 move.l
130 move.l %d0, 0x40000000
131
132
133 move.l
134 movec %d0, %RAMBAR1
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 move.l
171#else
172 move.l
173#endif
174 movec %d0, %VBR
175#endif
176
177#ifdef CONFIG_M5275
178
179 move.l
180 move.l %d0, 0x40000000
181
182
183
184 move.l
185 movec %d0, %RAMBAR1
186#endif
187
188
189 move.l
190 move.l
191 move.l
192 move.l %d0, (%a1)
193 move.l %d0, (%a2)
194
195
196 move.l
197 clr.l %sp@-
198
199 move.l
200
201
202 move.l
203 jsr (%a1)
204
205 move.l
206 jsr (%a1)
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223 .globl relocate_code
224relocate_code:
225 link.w %a6,
226 move.l 8(%a6), %sp
227
228 move.l 12(%a6), %d0
229 move.l 16(%a6), %a0
230
231 move.l
232 move.l
233 move.l %a0, %a3
234
2351:
236 move.l (%a1)+, (%a3)+
237 cmp.l %a1,%a2
238 bgt.s 1b
239
240
241
242
243
244 move.l %a0, %a1
245 add.l
246 jmp (%a1)
247
248in_ram:
249
250clear_bss:
251
252
253
254 move.l %a0, %a1
255 add.l
256 move.l %a0, %d1
257 add.l
2586:
259 clr.l (%a1)+
260 cmp.l %a1,%d1
261 bgt.s 6b
262
263
264
265
266 move.l %a0, %a1
267 add.l
268 move.l %a1,%a5
269
270 move.l %a0, %a2
271 add.l
272
2737:
274 move.l (%a1),%d1
275 sub.l
276 add.l %a0,%d1
277 move.l %d1,(%a1)+
278 cmp.l %a2, %a1
279 bne 7b
280
281
282 move.l %a0, %a1
283 add.l
284
285
286 move.l %a0,-(%sp)
287 move.l %d0,-(%sp)
288
289 defined(CONFIG_SYS_HALT_BEFOR_RAM_JUMP)
290 halt
291#endif
292 jsr (%a1)
293
294
295
296 .globl _fault
297_fault:
298 bra _fault
299
300 .globl _exc_handler
301_exc_handler:
302 SAVE_ALL
303 movel %sp,%sp@-
304 bsr exc_handler
305 addql
306 RESTORE_ALL
307
308 .globl _int_handler
309_int_handler:
310 SAVE_ALL
311 movel %sp,%sp@-
312 bsr int_handler
313 addql
314 RESTORE_ALL
315
316
317
318 .globl version_string
319version_string:
320 .ascii U_BOOT_VERSION_STRING, "\0"
321 .align 4
322