From f67cd51e654ba6498230314b6e82b4dbbd4bfca7 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 6 Nov 2014 13:20:10 -0700 Subject: x86: Save the BIST value on reset The built in self test value is available in register eax on start-up. Save it so that it can be accessed later. Unfortunately we must wait until the global_data is available before we can do this, so there is a little bit of shuffling to keep it around. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- arch/x86/cpu/start.S | 9 ++++++--- arch/x86/cpu/start16.S | 7 ++++++- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'arch/x86/cpu') diff --git a/arch/x86/cpu/start.S b/arch/x86/cpu/start.S index 781d32447b..b18f3201bc 100644 --- a/arch/x86/cpu/start.S +++ b/arch/x86/cpu/start.S @@ -49,6 +49,8 @@ _start: */ movw $GD_FLG_COLD_BOOT, %bx 1: + /* Save BIST */ + movl %eax, %ebp /* Load the segement registes to match the gdt loaded in start16.S */ movl $(X86_GDT_ENTRY_32BIT_DS * X86_GDT_ENTRY_SIZE), %eax @@ -117,9 +119,10 @@ car_init_ret: addl $GD_MALLOC_BASE, %edx movl %esp, (%edx) #endif - - /* Align temporary global descriptor table to 16-byte boundary */ - andl $0xfffffff0, %esp + /* Store BIST */ + movl %eax, %edx + addl $GD_BIST, %edx + movl %ebp, (%edx) /* Set second parameter to setup_gdt */ movl %ecx, %edx diff --git a/arch/x86/cpu/start16.S b/arch/x86/cpu/start16.S index 445d5a1734..9550502e9a 100644 --- a/arch/x86/cpu/start16.S +++ b/arch/x86/cpu/start16.S @@ -21,6 +21,9 @@ .code16 .globl start16 start16: + /* Save BIST */ + movl %eax, %ecx + /* Set the Cold Boot / Hard Reset flag */ movl $GD_FLG_COLD_BOOT, %ebx @@ -45,9 +48,11 @@ o32 cs lgdt gdt_ptr /* Flush the prefetch queue */ jmp ff ff: - /* Finally jump to the 32bit initialization code */ + + /* Finally restore BIST and jump to the 32bit initialization code */ movw $code32start, %ax movw %ax, %bp + movl %ecx, %eax o32 cs ljmp *(%bp) /* 48-bit far pointer */ -- cgit