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