2014-02-04 08:56:14 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <asm-offsets.h>
|
|
|
|
#include <config.h>
|
2015-02-19 15:40:58 +00:00
|
|
|
#include <linux/linkage.h>
|
2014-02-04 08:56:14 +00:00
|
|
|
#include <asm/arcregs.h>
|
|
|
|
|
2015-02-19 15:40:58 +00:00
|
|
|
ENTRY(_start)
|
2014-12-24 14:17:11 +00:00
|
|
|
/* Setup interrupt vector base that matches "__text_start" */
|
|
|
|
sr __ivt_start, [ARC_AUX_INTR_VEC_BASE]
|
|
|
|
|
2015-02-24 16:40:36 +00:00
|
|
|
/* Setup stack- and frame-pointers */
|
2014-12-24 14:17:11 +00:00
|
|
|
mov %sp, CONFIG_SYS_INIT_SP_ADDR
|
|
|
|
mov %fp, %sp
|
|
|
|
|
2015-02-24 16:40:36 +00:00
|
|
|
/* Unconditionally disable caches */
|
|
|
|
bl flush_dcache_all
|
|
|
|
bl dcache_disable
|
|
|
|
bl icache_disable
|
2014-12-24 14:17:11 +00:00
|
|
|
|
|
|
|
/* Zero the one and only argument of "board_init_f" */
|
|
|
|
mov_s %r0, 0
|
|
|
|
j board_init_f
|
2015-02-19 15:40:58 +00:00
|
|
|
ENDPROC(_start)
|
2014-12-24 14:17:11 +00:00
|
|
|
|
2014-02-04 08:56:14 +00:00
|
|
|
/*
|
2015-02-24 16:40:36 +00:00
|
|
|
* void board_init_f_r_trampoline(stack-pointer address)
|
2014-02-04 08:56:14 +00:00
|
|
|
*
|
|
|
|
* This "function" does not return, instead it continues in RAM
|
|
|
|
* after relocating the monitor code.
|
|
|
|
*
|
2015-02-24 16:40:36 +00:00
|
|
|
* r0 = new stack-pointer
|
2014-02-04 08:56:14 +00:00
|
|
|
*/
|
2015-02-24 16:40:36 +00:00
|
|
|
ENTRY(board_init_f_r_trampoline)
|
|
|
|
/* Set up the stack- and frame-pointers */
|
|
|
|
mov %sp, %r0
|
2014-02-04 08:56:14 +00:00
|
|
|
mov %fp, %sp
|
|
|
|
|
2015-02-24 16:40:36 +00:00
|
|
|
/* Update position of intterupt vector table */
|
|
|
|
lr %r0, [ARC_AUX_INTR_VEC_BASE]
|
|
|
|
ld %r1, [%r25, GD_RELOC_OFF]
|
|
|
|
add %r0, %r0, %r1
|
|
|
|
sr %r0, [ARC_AUX_INTR_VEC_BASE]
|
2014-02-04 08:56:14 +00:00
|
|
|
|
2015-02-24 16:40:36 +00:00
|
|
|
/* Re-enter U-Boot by calling board_init_f_r */
|
|
|
|
j board_init_f_r
|
|
|
|
ENDPROC(board_init_f_r_trampoline)
|