From 5a6f83c7351e752280f64cfe5b222fee690690eb Mon Sep 17 00:00:00 2001 From: Carl-Daniel Hailfinger Date: Tue, 25 Nov 2008 23:39:31 +0000 Subject: [PATCH] The Core2Duo CAR code did set up the stack incorrectly. In combination with a wrong calling convention of stage1_phase1() this caused stage1 to assume BIST had failed. Signed-off-by: Carl-Daniel Hailfinger Acked-by: Ronald G. Minnich git-svn-id: svn://coreboot.org/repository/coreboot-v3@1057 f3766cd6-281f-0410-b1cd-43a5c92072e9 --- arch/x86/intel/core2/stage0.S | 18 ++++++++++++++---- arch/x86/stage1.c | 2 +- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/arch/x86/intel/core2/stage0.S b/arch/x86/intel/core2/stage0.S index c2ed2e7671..97bdeffd16 100644 --- a/arch/x86/intel/core2/stage0.S +++ b/arch/x86/intel/core2/stage0.S @@ -3,6 +3,7 @@ * * Copyright (C) 2000,2007 Ronald G. Minnich * Copyright (C) 2007-2008 coresystems GmbH + * Copyright (C) 2008 Carl-Daniel Hailfinger * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -159,17 +160,26 @@ clear_mtrrs: movl $(CACHE_AS_RAM_BASE + CACHE_AS_RAM_SIZE - 4), %eax movl %eax, %esp - /* Restore the BIST result */ + /* Store zero for the pointer to the global variables. */ + pushl $0 + + /* Restore the BIST result. */ movl %ebp, %eax + + /* We need to set ebp? No need. */ movl %esp, %ebp + + /* Second parameter: init_detected */ + /* Store zero for the unused init_detected parameter. */ + pushl $0 + + /* First parameter: bist */ pushl %eax -#if 0 - /* this will be interpreted as failed bist */ port80_post(0x23) -#endif call stage1_phase1 + /* We will not go back. */ port80_post(0x2f) error: diff --git a/arch/x86/stage1.c b/arch/x86/stage1.c index 7bd0e52a98..9fc9516e05 100644 --- a/arch/x86/stage1.c +++ b/arch/x86/stage1.c @@ -187,7 +187,7 @@ static int run_address_multiboot(void *f, struct multiboot_info *mbi) * that we are restarting after some sort of reconfiguration. Note that we could use it on geode but * do not at present. */ -void __attribute__((stdcall)) stage1_phase1(u32 bist, u32 init_detected) +void __attribute__((stdcall,regparm(0))) stage1_phase1(u32 bist, u32 init_detected) { struct global_vars globvars; int ret;