2018-05-06 21:58:06 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
2017-01-16 14:03:48 +00:00
|
|
|
/*
|
|
|
|
* 64-bit x86 Startup Code
|
|
|
|
*
|
2019-04-26 03:58:40 +00:00
|
|
|
* Copyright 2019 Google, Inc
|
2017-01-16 14:03:48 +00:00
|
|
|
* Written by Simon Glass <sjg@chromium.org>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
2018-06-12 05:48:37 +00:00
|
|
|
.section .text.start
|
2017-01-16 14:03:48 +00:00
|
|
|
.code64
|
|
|
|
.globl _start
|
|
|
|
.type _start, @function
|
|
|
|
_start:
|
|
|
|
/* Set up memory using the existing stack */
|
|
|
|
mov %rsp, %rdi
|
|
|
|
call board_init_f_alloc_reserve
|
|
|
|
mov %rax, %rsp
|
|
|
|
|
|
|
|
call board_init_f_init_reserve
|
|
|
|
|
2018-10-14 03:52:09 +00:00
|
|
|
xor %rdi, %rdi
|
2017-01-16 14:03:48 +00:00
|
|
|
call board_init_f
|
|
|
|
call board_init_f_r
|
|
|
|
|
|
|
|
/* Should not return here */
|
|
|
|
jmp .
|
2023-07-16 03:38:52 +00:00
|
|
|
|
|
|
|
.globl board_init_f_r_trampoline64
|
|
|
|
.type board_init_f_r_trampoline64, @function
|
|
|
|
board_init_f_r_trampoline64:
|
|
|
|
/*
|
|
|
|
* SDRAM has been initialised, U-Boot code has been copied into
|
|
|
|
* RAM, BSS has been cleared and relocation adjustments have been
|
|
|
|
* made. It is now time to jump into the in-RAM copy of U-Boot
|
|
|
|
*
|
|
|
|
* %eax = Address of top of new stack
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Stack grows down from top of SDRAM */
|
|
|
|
movq %rsi, %rsp
|
|
|
|
|
|
|
|
/* New gd is in rdi */
|
|
|
|
|
|
|
|
/* Re-enter U-Boot by calling board_init_f_r() */
|
|
|
|
call board_init_f_r
|