~ubuntu-branches/ubuntu/vivid/u-boot/vivid

« back to all changes in this revision

Viewing changes to arch/arm/cpu/arm926ejs/start.S

  • Committer: Package Import Robot
  • Author(s): Clint Adams
  • Date: 2012-01-02 17:49:39 UTC
  • mfrom: (1.2.7)
  • Revision ID: package-import@ubuntu.com-20120102174939-iddq37p3372x10yp
Tags: 2011.12-1
* New upstream version.
  - Drop build-timestamp_autogenerated.h-without-config.patch (merged).
  - Drop ublimage-NAND-block-size-isn-t-set-at-build-time.patch (merged).
  - Update kerma-sheevaplug-mvsdio.diff
  - Update mipsel-native-endianness.diff
  - Drop dreamplug-v8.patch (merged).

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
 */
52
52
 
53
53
 
54
 
.globl _start
55
 
_start:
56
 
        b       reset
 
54
#ifdef CONFIG_SYS_DV_NOR_BOOT_CFG
 
55
.globl _start
 
56
_start:
 
57
.globl _NOR_BOOT_CFG
 
58
_NOR_BOOT_CFG:
 
59
        .word   CONFIG_SYS_DV_NOR_BOOT_CFG
 
60
        b       reset
 
61
#else
 
62
.globl _start
 
63
_start:
 
64
        b       reset
 
65
#endif
57
66
#ifdef CONFIG_SPL_BUILD
58
67
/* No exception handlers in preloader */
59
68
        ldr     pc, _hang
117
126
 
118
127
.globl _TEXT_BASE
119
128
_TEXT_BASE:
120
 
        .word   CONFIG_SYS_TEXT_BASE
 
129
#ifdef CONFIG_NAND_SPL /* deprecated, use instead CONFIG_SPL_BUILD */
 
130
        .word   CONFIG_SYS_TEXT_BASE
 
131
#else
 
132
#ifdef CONFIG_SPL_BUILD
 
133
        .word   CONFIG_SPL_TEXT_BASE
 
134
#else
 
135
        .word   CONFIG_SYS_TEXT_BASE
 
136
#endif
 
137
#endif
121
138
 
122
139
/*
123
140
 * These are defined in the board-specific linker script.
137
154
_end_ofs:
138
155
        .word _end - _start
139
156
 
 
157
#ifdef CONFIG_NAND_U_BOOT
 
158
.globl _end
 
159
_end:
 
160
        .word __bss_end__
 
161
#endif
 
162
 
140
163
#ifdef CONFIG_USE_IRQ
141
164
/* IRQ stack memory (calculated at run-time) */
142
165
.globl IRQ_STACK_START
171
194
         * we do sys-critical inits only at reboot,
172
195
         * not when booting from ram!
173
196
         */
174
 
#ifndef CONFIG_SKIP_LOWLEVEL_INIT
175
197
        bl      cpu_init_crit
176
 
#endif
177
198
 
178
199
/* Set stackpointer in internal RAM to call board_init_f */
179
200
call_board_init_f:
180
 
        ldr     sp, =(CONFIG_SYS_INIT_SP_ADDR)
 
201
#ifdef CONFIG_NAND_SPL /* deprecated, use instead CONFIG_SPL_BUILD */
 
202
        ldr     sp, =(CONFIG_SYS_INIT_SP_ADDR)
 
203
#else
 
204
#ifdef CONFIG_SPL_BUILD
 
205
        ldr     sp, =(CONFIG_SPL_STACK)
 
206
#else
 
207
        ldr     sp, =(CONFIG_SYS_INIT_SP_ADDR)
 
208
#endif
 
209
#endif
181
210
        bic     sp, sp, #7 /* 8-byte alignment for ABI compliance */
182
211
        ldr     r0,=0x00000000
183
212
        bl      board_init_f
202
231
        mov     sp, r4
203
232
 
204
233
        adr     r0, _start
 
234
        sub     r9, r6, r0              /* r9 <- relocation offset */
205
235
        cmp     r0, r6
206
236
        beq     clear_bss               /* skip relocation */
207
237
        mov     r1, r6                  /* r1 <- scratch for copy loop */
256
286
#endif
257
287
 
258
288
clear_bss:
259
 
#ifndef CONFIG_SPL_BUILD
 
289
#ifdef CONFIG_SPL_BUILD
 
290
        /* No relocation for SPL */
 
291
        ldr     r0, =__bss_start
 
292
        ldr     r1, =__bss_end__
 
293
#else
260
294
        ldr     r0, _bss_start_ofs
261
295
        ldr     r1, _bss_end_ofs
262
296
        mov     r4, r6                  /* reloc addr */
263
297
        add     r0, r0, r4
264
298
        add     r1, r1, r4
 
299
#endif
265
300
        mov     r2, #0x00000000         /* clear                            */
266
301
 
267
 
clbss_l:str     r2, [r0]                /* clear loop...                    */
 
302
clbss_l:cmp     r0, r1                  /* clear loop... */
 
303
        bhs     clbss_e                 /* if reached end of bss, exit */
 
304
        str     r2, [r0]
268
305
        add     r0, r0, #4
269
 
        cmp     r0, r1
270
 
        bne     clbss_l
 
306
        b       clbss_l
 
307
clbss_e:
271
308
 
 
309
#ifndef CONFIG_SPL_BUILD
272
310
        bl coloured_LED_init
273
311
        bl red_led_on
274
312
#endif
315
353
 *
316
354
 *************************************************************************
317
355
 */
318
 
#ifndef CONFIG_SKIP_LOWLEVEL_INIT
319
356
cpu_init_crit:
320
357
        /*
321
358
         * flush v4 I/D caches
334
371
        orr     r0, r0, #0x00001000     /* set bit 12 (I) I-Cache */
335
372
        mcr     p15, 0, r0, c1, c0, 0
336
373
 
 
374
#ifndef CONFIG_SKIP_LOWLEVEL_INIT
337
375
        /*
338
376
         * Go setup Memory and board specific bits prior to relocation.
339
377
         */
340
378
        mov     ip, lr          /* perserve link reg across call */
341
379
        bl      lowlevel_init   /* go setup pll,mux,memory */
342
380
        mov     lr, ip          /* restore link */
 
381
#endif /* CONFIG_SKIP_LOWLEVEL_INIT */
343
382
        mov     pc, lr          /* back to my caller */
344
 
#endif /* CONFIG_SKIP_LOWLEVEL_INIT */
345
383
 
346
384
#ifndef CONFIG_SPL_BUILD
347
385
/*