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@intel.com>
Reviewed-on: https://review.coreboot.org/15135
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
Lee Leahy 2016-06-08 13:40:08 -07:00 committed by Leroy P Leahy
parent fdc8c8b5fa
commit d131ea3078
2 changed files with 25 additions and 0 deletions

View File

@ -179,3 +179,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.

View File

@ -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. */