u-boot/arch/x86/cpu/start64.S
Bin Meng 49d5ff439c x86: Fix the mystery of printch() during 64-bit boot
At present in arch_setup_gd() it calls printch(' ') at the end which
has been a mystery for a long time as without such call the 64-bit
U-Boot just does not boot at all.

In fact this is due to the bug that board_init_f() was called with
boot_flags not being set. Hence whatever value being there in the
rdi register becomes the boot_flags if without such magic call.
With a printch(' ') call the rdi register is initialized as 0x20
and this value seems to be sane enough for the whole boot process.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2018-10-22 17:51:45 +08:00

28 lines
491 B
ArmAsm

/* SPDX-License-Identifier: GPL-2.0+ */
/*
* 64-bit x86 Startup Code
*
* (C) Copyright 216 Google, Inc
* Written by Simon Glass <sjg@chromium.org>
*/
#include <config.h>
.section .text.start
.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
xor %rdi, %rdi
call board_init_f
call board_init_f_r
/* Should not return here */
jmp .