summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/x86/cpu/start.S9
-rw-r--r--arch/x86/cpu/start16.S7
-rw-r--r--arch/x86/include/asm/global_data.h1
-rw-r--r--lib/asm-offsets.c3
4 files changed, 16 insertions, 4 deletions
diff --git a/arch/x86/cpu/start.S b/arch/x86/cpu/start.S
index 781d324..b18f320 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 445d5a1..9550502 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 */
diff --git a/arch/x86/include/asm/global_data.h b/arch/x86/include/asm/global_data.h
index 3e8e2cd..9eae228 100644
--- a/arch/x86/include/asm/global_data.h
+++ b/arch/x86/include/asm/global_data.h
@@ -17,6 +17,7 @@ struct arch_global_data {
uint32_t tsc_base_kclocks; /* Initial tsc as a kclocks value */
uint32_t tsc_prev; /* For show_boot_progress() */
void *new_fdt; /* Relocated FDT */
+ uint32_t bist; /* Built-in self test value */
};
#endif
diff --git a/lib/asm-offsets.c b/lib/asm-offsets.c
index 129bc3e..580f763 100644
--- a/lib/asm-offsets.c
+++ b/lib/asm-offsets.c
@@ -31,6 +31,9 @@ int main(void)
#ifdef CONFIG_SYS_MALLOC_F_LEN
DEFINE(GD_MALLOC_BASE, offsetof(struct global_data, malloc_base));
#endif
+#ifdef CONFIG_X86
+ DEFINE(GD_BIST, offsetof(struct global_data, arch.bist));
+#endif
#if defined(CONFIG_ARM)