xref: /openbmc/u-boot/arch/arm/cpu/arm720t/start.S (revision 699c4e59)
1/*
2 *  armboot - Startup Code for ARM720 CPU-core
3 *
4 *  Copyright (c) 2001	Marius Gröger <mag@sysgo.de>
5 *  Copyright (c) 2002	Alex Züpke <azu@sysgo.de>
6 *
7 * SPDX-License-Identifier:	GPL-2.0+
8 */
9
10#include <asm-offsets.h>
11#include <config.h>
12
13/*
14 *************************************************************************
15 *
16 * Startup Code (reset vector)
17 *
18 * do important init only if we don't start from RAM!
19 * relocate armboot to ram
20 * setup stack
21 * jump to second stage
22 *
23 *************************************************************************
24 */
25
26	.globl	reset
27
28reset:
29	/*
30	 * set the cpu to SVC32 mode
31	 */
32	mrs	r0,cpsr
33	bic	r0,r0,#0x1f
34	orr	r0,r0,#0xd3
35	msr	cpsr,r0
36
37	/*
38	 * we do sys-critical inits only at reboot,
39	 * not when booting from ram!
40	 */
41#ifndef CONFIG_SKIP_LOWLEVEL_INIT
42	bl	cpu_init_crit
43#endif
44
45	bl	_main
46
47/*------------------------------------------------------------------------------*/
48
49	.globl	c_runtime_cpu_setup
50c_runtime_cpu_setup:
51
52	mov	pc, lr
53
54/*
55 *************************************************************************
56 *
57 * CPU_init_critical registers
58 *
59 * setup important registers
60 * setup memory timing
61 *
62 *************************************************************************
63 */
64
65#ifndef CONFIG_SKIP_LOWLEVEL_INIT
66cpu_init_crit:
67
68	mov	ip, lr
69	/*
70	 * before relocating, we have to setup RAM timing
71	 * because memory timing is board-dependent, you will
72	 * find a lowlevel_init.S in your board directory.
73	 */
74	bl	lowlevel_init
75	mov	lr, ip
76
77	mov	pc, lr
78#endif /* CONFIG_SKIP_LOWLEVEL_INIT */
79