[coreboot] [PATCH] v3: Fix BIST failure for Core2Duo, fix calling convention
Carl-Daniel Hailfinger
c-d.hailfinger.devel.2006 at gmx.net
Wed Nov 26 00:19:47 CET 2008
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 <c-d.hailfinger.devel.2006 at gmx.net>
Index: corebootv3-bistfail/arch/x86/stage1.c
===================================================================
--- corebootv3-bistfail/arch/x86/stage1.c (Revision 1055)
+++ corebootv3-bistfail/arch/x86/stage1.c (Arbeitskopie)
@@ -187,7 +187,7 @@
* 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;
Index: corebootv3-bistfail/arch/x86/intel/core2/stage0.S
===================================================================
--- corebootv3-bistfail/arch/x86/intel/core2/stage0.S (Revision 1055)
+++ corebootv3-bistfail/arch/x86/intel/core2/stage0.S (Arbeitskopie)
@@ -156,17 +156,26 @@
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:
--
http://www.hailfinger.org/
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: linuxbios3_stage1_phase1_calling_convention_bist_fail.diff
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20081126/505befd0/attachment.ksh>
More information about the coreboot
mailing list