2012-08-09 00:03:10 +00:00
|
|
|
/*
|
|
|
|
* A lowlevel_init function that sets up the stack to call a C function to
|
|
|
|
* perform further init.
|
|
|
|
*
|
|
|
|
* (C) Copyright 2010
|
|
|
|
* Texas Instruments, <www.ti.com>
|
|
|
|
*
|
|
|
|
* Author :
|
|
|
|
* Aneesh V <aneesh@ti.com>
|
|
|
|
*
|
2013-07-08 07:37:19 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
2012-08-09 00:03:10 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <asm-offsets.h>
|
|
|
|
#include <config.h>
|
|
|
|
#include <linux/linkage.h>
|
|
|
|
|
|
|
|
ENTRY(lowlevel_init)
|
|
|
|
/*
|
|
|
|
* Setup a temporary stack
|
|
|
|
*/
|
|
|
|
ldr sp, =CONFIG_SYS_INIT_SP_ADDR
|
2012-08-09 15:22:06 +00:00
|
|
|
bic sp, sp, #7 /* 8-byte alignment for ABI compliance */
|
2013-04-24 00:41:24 +00:00
|
|
|
#ifdef CONFIG_SPL_BUILD
|
2013-09-21 12:04:41 +00:00
|
|
|
ldr r9, =gdata
|
2013-04-24 00:41:24 +00:00
|
|
|
#else
|
|
|
|
sub sp, #GD_SIZE
|
|
|
|
bic sp, sp, #7
|
2013-09-21 12:04:41 +00:00
|
|
|
mov r9, sp
|
2013-04-24 00:41:24 +00:00
|
|
|
#endif
|
2012-08-09 00:03:10 +00:00
|
|
|
/*
|
|
|
|
* Save the old lr(passed in ip) and the current lr to stack
|
|
|
|
*/
|
|
|
|
push {ip, lr}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* go setup pll, mux, memory
|
|
|
|
*/
|
|
|
|
bl s_init
|
|
|
|
pop {ip, pc}
|
|
|
|
ENDPROC(lowlevel_init)
|