]> git.ipfire.org Git - people/ms/u-boot.git/blame - arch/arc/lib/start.S
arc: get rid of CONFIG_SYS_GENERIC_GLOBAL_DATA
[people/ms/u-boot.git] / arch / arc / lib / start.S
CommitLineData
2f16ac9d
AB
1/*
2 * Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#include <asm-offsets.h>
8#include <config.h>
4d93617d 9#include <linux/linkage.h>
2f16ac9d
AB
10#include <asm/arcregs.h>
11
4d93617d 12ENTRY(_start)
20a58ac0
IG
13 /* Setup interrupt vector base that matches "__text_start" */
14 sr __ivt_start, [ARC_AUX_INTR_VEC_BASE]
15
3fb80163 16 /* Setup stack- and frame-pointers */
20a58ac0
IG
17 mov %sp, CONFIG_SYS_INIT_SP_ADDR
18 mov %fp, %sp
19
3fb80163
AB
20 /* Unconditionally disable caches */
21 bl flush_dcache_all
22 bl dcache_disable
23 bl icache_disable
20a58ac0 24
f56d625e
AB
25 /* Allocate and zero GD, update SP */
26 mov %r0, %sp
27 bl board_init_f_mem
28
29 /* Update stack- and frame-pointers */
30 mov %sp, %r0
31 mov %fp, %sp
32
20a58ac0
IG
33 /* Zero the one and only argument of "board_init_f" */
34 mov_s %r0, 0
35 j board_init_f
4d93617d 36ENDPROC(_start)
20a58ac0 37
2f16ac9d 38/*
3fb80163 39 * void board_init_f_r_trampoline(stack-pointer address)
2f16ac9d
AB
40 *
41 * This "function" does not return, instead it continues in RAM
42 * after relocating the monitor code.
43 *
3fb80163 44 * r0 = new stack-pointer
2f16ac9d 45 */
3fb80163
AB
46ENTRY(board_init_f_r_trampoline)
47 /* Set up the stack- and frame-pointers */
48 mov %sp, %r0
2f16ac9d
AB
49 mov %fp, %sp
50
3fb80163
AB
51 /* Update position of intterupt vector table */
52 lr %r0, [ARC_AUX_INTR_VEC_BASE]
53 ld %r1, [%r25, GD_RELOC_OFF]
54 add %r0, %r0, %r1
55 sr %r0, [ARC_AUX_INTR_VEC_BASE]
2f16ac9d 56
3fb80163
AB
57 /* Re-enter U-Boot by calling board_init_f_r */
58 j board_init_f_r
59ENDPROC(board_init_f_r_trampoline)