blob: f1aea05c9094677c8e7c6bf8126d8d4ab970ba30 [file] [log] [blame]
Tom Rini41aebf82012-08-08 17:03:10 -07001/*
2 * A lowlevel_init function that sets up the stack to call a C function to
3 * perform further init.
4 *
5 * (C) Copyright 2010
6 * Texas Instruments, <www.ti.com>
7 *
8 * Author :
9 * Aneesh V <aneesh@ti.com>
10 *
Wolfgang Denk1a459662013-07-08 09:37:19 +020011 * SPDX-License-Identifier: GPL-2.0+
Tom Rini41aebf82012-08-08 17:03:10 -070012 */
13
14#include <asm-offsets.h>
15#include <config.h>
16#include <linux/linkage.h>
17
18ENTRY(lowlevel_init)
19 /*
20 * Setup a temporary stack
21 */
22 ldr sp, =CONFIG_SYS_INIT_SP_ADDR
Tom Rini975b71b2012-08-09 08:22:06 -070023 bic sp, sp, #7 /* 8-byte alignment for ABI compliance */
SRICHARAN R4a0eb752013-04-24 00:41:24 +000024#ifdef CONFIG_SPL_BUILD
Jeroen Hofsteefe1378a2013-09-21 14:04:41 +020025 ldr r9, =gdata
SRICHARAN R4a0eb752013-04-24 00:41:24 +000026#else
Andreas Bießmann6ba2bc82013-11-27 16:09:29 +010027 sub sp, sp, #GD_SIZE
SRICHARAN R4a0eb752013-04-24 00:41:24 +000028 bic sp, sp, #7
Jeroen Hofsteefe1378a2013-09-21 14:04:41 +020029 mov r9, sp
SRICHARAN R4a0eb752013-04-24 00:41:24 +000030#endif
Tom Rini41aebf82012-08-08 17:03:10 -070031 /*
32 * Save the old lr(passed in ip) and the current lr to stack
33 */
34 push {ip, lr}
35
36 /*
37 * go setup pll, mux, memory
38 */
39 bl s_init
40 pop {ip, pc}
41ENDPROC(lowlevel_init)