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 <[EMAIL PROTECTED]>
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/
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:
--
coreboot mailing list: [email protected]
http://www.coreboot.org/mailman/listinfo/coreboot