2 * Early initialization code for ARM architecture.
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.
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
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
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.
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,
32 .section ".start", "a", %progbits
35 .balignl 16,0xdeadbeef
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.
42 .skip 128 @ Assumes 64-byte alignment
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
54 * Initialize the stack to a known value. This is used to check for
55 * stack overflow later in the boot process.
68 /* Set stackpointer in internal RAM to call bootblock main() */
70 ldr sp, .Stack /* Set up stack pointer */
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
79 bic sp, sp, #7 /* 8-byte alignment for ABI compliance */
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.
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
94 .word CONFIG_STACK_TOP
96 /* create this size the same way we do in coreboot_ram.ld: top-bottom */
98 .word CONFIG_STACK_TOP - CONFIG_STACK_BOTTOM