blob: 9a4974a5f1b7110bb9296c03f805506406526003 [file] [log] [blame]
Simon Glass051c31b2019-04-25 21:58:52 -06001/* SPDX-License-Identifier: GPL-2.0+ */
2/*
Simon Glass08deb6d2019-09-25 08:11:44 -06003 * 32-bit x86 Startup Code when running from TPL. This is the startup code in
4 * SPL, when TPL is used.
Simon Glass051c31b2019-04-25 21:58:52 -06005 *
6 * Copyright 2018 Google, Inc
7 * Written by Simon Glass <sjg@chromium.org>
8 */
9
10#include <config.h>
11
12.section .text.start
13.code32
14.globl _start
15.type _start, @function
16_start:
17 /* Set up memory using the existing stack */
18 mov %esp, %eax
19 call board_init_f_alloc_reserve
20 mov %eax, %esp
21
22 call board_init_f_init_reserve
23
24 xorl %eax, %eax
25 call board_init_f
26 call board_init_f_r
27
28 /* Should not return here */
29 jmp .
30
31.globl board_init_f_r_trampoline
32.type board_init_f_r_trampoline, @function
33board_init_f_r_trampoline:
34 /*
35 * TPL has been executed: SDRAM has been initialised, BSS has been
36 * cleared.
37 *
38 * %eax = Address of top of new stack
39 */
40
41 /* Stack grows down from top of SDRAM */
42 movl %eax, %esp
43
44 /* Re-enter SPL by calling board_init_f_r() */
45 call board_init_f_r
46
47die:
48 hlt
49 jmp die
50 hlt