blob: c0c07b6a11a1038f331a68a02f05e60ce07a3362 [file] [log] [blame]
Wolfgang Denkadf20a12005-09-25 01:48:28 +02001/*
2 * armboot - Startup Code for ARM926EJS CPU-core
3 *
4 * Copyright (c) 2003 Texas Instruments
5 *
6 * ----- Adapted for OMAP1610 OMAP730 from ARM925t code ------
7 *
Albert ARIBAUD60fbc8d2011-08-04 18:45:45 +02008 * Copyright (c) 2001 Marius Gröger <mag@sysgo.de>
9 * Copyright (c) 2002 Alex Züpke <azu@sysgo.de>
Detlev Zundelf1b3f2b2009-05-13 10:54:10 +020010 * Copyright (c) 2002 Gary Jennejohn <garyj@denx.de>
Wolfgang Denkadf20a12005-09-25 01:48:28 +020011 * Copyright (c) 2003 Richard Woodruff <r-woodruff2@ti.com>
12 * Copyright (c) 2003 Kshitij <kshitij@ti.com>
13 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +020014 * SPDX-License-Identifier: GPL-2.0+
Wolfgang Denkadf20a12005-09-25 01:48:28 +020015 */
16
Wolfgang Denk0191e472010-10-26 14:34:52 +020017#include <asm-offsets.h>
Wolfgang Denkadf20a12005-09-25 01:48:28 +020018#include <config.h>
19#include <version.h>
20
21/*
22 *************************************************************************
23 *
Wolfgang Denkadf20a12005-09-25 01:48:28 +020024 * Startup Code (reset vector)
25 *
26 * do important init only if we don't start from memory!
27 * setup memory and board specific bits prior to relocation.
28 * relocate armboot to ram
29 * setup stack
30 *
31 *************************************************************************
32 */
33
Albert ARIBAUD9852cc62014-04-15 16:13:51 +020034 .globl reset
Heiko Schocherc620af22010-09-17 13:10:51 +020035
36reset:
37 /*
38 * set the cpu to SVC32 mode
39 */
40 mrs r0,cpsr
41 bic r0,r0,#0x1f
42 orr r0,r0,#0xd3
43 msr cpsr,r0
44
45 /*
46 * we do sys-critical inits only at reboot,
47 * not when booting from ram!
48 */
49#ifndef CONFIG_SKIP_LOWLEVEL_INIT
50 bl cpu_init_crit
51#endif
52
Albert ARIBAUDfacdae52013-01-08 10:18:02 +000053 bl _main
Heiko Schocherc620af22010-09-17 13:10:51 +020054
55/*------------------------------------------------------------------------------*/
56
Albert ARIBAUDfacdae52013-01-08 10:18:02 +000057 .globl c_runtime_cpu_setup
58c_runtime_cpu_setup:
59
60 mov pc, lr
61
Heiko Schocherc620af22010-09-17 13:10:51 +020062/*
Wolfgang Denkadf20a12005-09-25 01:48:28 +020063 *************************************************************************
64 *
65 * CPU_init_critical registers
66 *
67 * setup important registers
68 * setup memory timing
69 *
70 *************************************************************************
71 */
72
Jean-Christophe PLAGNIOL-VILLARD314b7282009-05-15 23:45:20 +020073#ifndef CONFIG_SKIP_LOWLEVEL_INIT
Wolfgang Denkadf20a12005-09-25 01:48:28 +020074cpu_init_crit:
75 /* arm_int_generic assumes the ARM boot monitor, or user software,
76 * has initialized the platform
77 */
78 mov pc, lr /* back to my caller */
Jean-Christophe PLAGNIOL-VILLARD314b7282009-05-15 23:45:20 +020079#endif