[coreboot-gerrit] Patch set updated for coreboot: arch/x86: Add debug spinloops in assembly_entry.S

Leroy P Leahy (leroy.p.leahy@intel.com) gerrit at coreboot.org
Thu Jun 9 22:00:52 CEST 2016


Leroy P Leahy (leroy.p.leahy at intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/15135

-gerrit

commit 7970991a58188494c13c52696accb30be388d1b2
Author: Lee Leahy <leroy.p.leahy at intel.com>
Date:   Wed Jun 8 13:40:08 2016 -0700

    arch/x86: Add debug spinloops in assembly_entry.S
    
    Use Kconfig values to enable debug spinloops in assembly_entry.S.  This
    makes it easy to debug the assembly code.
    
    TEST=Build and run on Galileo Gen2
    
    Change-Id: Ic56bf2260b8e3181403623961874c9289f3ca945
    Signed-off-by: Lee Leahy <Leroy.P.Leahy at intel.com>
---
 src/arch/x86/Kconfig          | 14 ++++++++++++++
 src/arch/x86/assembly_entry.S | 11 +++++++++++
 2 files changed, 25 insertions(+)

diff --git a/src/arch/x86/Kconfig b/src/arch/x86/Kconfig
index 70434e9..9db1e61 100644
--- a/src/arch/x86/Kconfig
+++ b/src/arch/x86/Kconfig
@@ -195,3 +195,17 @@ config VERSTAGE_ADDR
 # from a program loaded in ram and subsequently loading ramstage.
 config POSTCAR_STAGE
 	def_bool n
+
+config VERSTAGE_DEBUG_SPINLOOP
+	bool
+	default n
+	help
+	  Add a spin (JMP .) in assembly_entry.S during early verstage to wait
+	  for a JTAG debugger to break into the execution sequence.
+
+config ROMSTAGE_DEBUG_SPINLOOP
+	bool
+	default n
+	help
+	  Add a spin (JMP .) in assembly_entry.S during early romstage to wait
+	  for a JTAG debugger to break into the execution sequence.
diff --git a/src/arch/x86/assembly_entry.S b/src/arch/x86/assembly_entry.S
index 86dbba4..d1f5d61 100644
--- a/src/arch/x86/assembly_entry.S
+++ b/src/arch/x86/assembly_entry.S
@@ -52,6 +52,17 @@ _start:
 	sub	%edi, %ecx
 	rep	stosl
 
+#if ((ENV_VERSTAGE && IS_ENABLED(CONFIG_VERSTAGE_DEBUG_SPINLOOP)) \
+	|| (ENV_ROMSTAGE && IS_ENABLED(CONFIG_ROMSTAGE_DEBUG_SPINLOOP)))
+
+	/* Wait for a JTAG debugger to break in and set EBX non-zero */
+	xor	%ebx, %ebx
+
+debug_spinloop:
+	cmp	$0, %ebx
+	jz	debug_spinloop
+#endif
+
 	jmp	car_stage_entry
 
 /* This is here for linking purposes. */



More information about the coreboot-gerrit mailing list