arm: Update a stale comment in bootblock .S files
[coreboot.git] / src / arch / arm / armv4 / bootblock.S
blob3ba2a88e261d049928ace32815bdeca55f6fd1fc
1 /*
2  * Early initialization code for ARM architecture.
3  *
4  * This file is based off of the OMAP3530/ARM Cortex start.S file from Das
5  * U-Boot, which itself got the file from armboot.
6  *
7  * Copyright (c) 2004   Texas Instruments <r-woodruff2@ti.com>
8  * Copyright (c) 2001   Marius Gröger <mag@sysgo.de>
9  * Copyright (c) 2002   Alex Züpke <azu@sysgo.de>
10  * Copyright (c) 2002   Gary Jennejohn <garyj@denx.de>
11  * Copyright (c) 2003   Richard Woodruff <r-woodruff2@ti.com>
12  * Copyright (c) 2003   Kshitij <kshitij@ti.com>
13  * Copyright (c) 2006-2008 Syed Mohammed Khasim <x0khasim@ti.com>
14  * Copyright (c) 2013   The Chromium OS Authors
15  *
16  * This program is free software; you can redistribute it and/or
17  * modify it under the terms of the GNU General Public License as
18  * published by the Free Software Foundation; version 2 of
19  * the License.
20  *
21  * This program is distributed in the hope that it will be useful,
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24  * GNU General Public License for more details.
25  *
26  * You should have received a copy of the GNU General Public License
27  * along with this program; if not, write to the Free Software
28  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29  * MA 02111-1307 USA
30  */
32 .section ".start", "a", %progbits
33 .globl _start
34 _start: b       reset
35         .balignl 16,0xdeadbeef
37 _cbfs_master_header:
38         /* The CBFS master header is inserted by cbfstool at the first
39          * aligned offset after the above anchor string is found.
40          * Hence, we leave some space for it.
41          */
42         .skip 128                       @ Assumes 64-byte alignment
44 reset:
45         /*
46          * Set the cpu to System mode with IRQ and FIQ disabled. Prefetch/Data
47          * aborts may happen early and crash before the abort handlers are
48          * installed, but at least the problem will show up near the code that
49          * causes it.
50          */
51         msr     cpsr_cxf, #0xdf
53         /*
54          * Initialize the stack to a known value. This is used to check for
55          * stack overflow later in the boot process.
56          */
57         ldr     r0, .Stack
58         ldr     r1, .Stack_size
59         sub     r0, r0, r1
60         ldr     r1, .Stack
61         ldr     r2, =0xdeadbeef
62 init_stack_loop:
63         str     r2, [r0]
64         add     r0, #4
65         cmp     r0, r1
66         bne     init_stack_loop
68 /* Set stackpointer in internal RAM to call bootblock main() */
69 call_bootblock:
70         ldr     sp, .Stack /* Set up stack pointer */
71         ldr     r0,=0x00000000
72          /*
73           * The current design of cpu_info places the
74           * struct at the top of the stack. The number of
75           * words pushed must be at least as large as that
76           * struct.
77           */
78         push    {r0-r2}
79         bic     sp, sp, #7 /* 8-byte alignment for ABI compliance */
80         /*
81          * Use "bl" instead of "b" even though we do not intend to return.
82          * "bl" gets compiled to "blx" if we're transitioning from ARM to
83          * Thumb. However, "b" will not and GCC may attempt to create a
84          * wrapper which is currently broken.
85          */
86         bl      main
88 /* we do it this way because it's a 32-bit constant and
89  * in some cases too far away to be loaded as just an offset
90  * from IP
91  */
92 .align 2
93 .Stack:
94         .word CONFIG_STACK_TOP
95 .align 2
96 /* create this size the same way we do in coreboot_ram.ld: top-bottom */
97 .Stack_size:
98         .word CONFIG_STACK_TOP - CONFIG_STACK_BOTTOM