[U-Boot] [PATCH 2/2] common: arm: fix displaying IRQ stack info

Masahiro Yamada yamada.m at jp.panasonic.com
Mon May 27 07:29:22 CEST 2013


With CONFIG_USE_IRQ and DEBUG macro defined,
display_text_info function in board_f.c
printed stack address for IRQ and FIQ.
This code originally came from arch/arm/lib/board.c
and seems specific for ARM for now.

Global variables IRQ_STACK_START and FIQ_STACK_START
are set in interrupt_init function.

The function display_text_info is called from board_init_f,
while interrupt_init is called from board_init_r.

So, display_text_info always resulted in just printing initial
values of IRQ_STACK_START and FIQ_STACK_START as follows:

IRQ Stack: 0badc0de
FIQ Stack: 0badc0de

It is almost meaningless information because 0x0badc0de
is a hard-coded value in arch/arm/cpu/$(CPU)/start.S.

This commit deletes the stack info display code from display_text_info.
And adds new function display_interrupt_info in board_init_r.

Signed-off-by: Masahiro Yamada <yamada.m at jp.panasonic.com>
---
 common/board_f.c |    4 ----
 common/board_r.c |   10 ++++++++++
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/common/board_f.c b/common/board_f.c
index 81edbdf..0911869 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -178,10 +178,6 @@ static int display_text_info(void)
 #ifdef CONFIG_MODEM_SUPPORT
 	debug("Modem Support enabled\n");
 #endif
-#ifdef CONFIG_USE_IRQ
-	debug("IRQ Stack: %08lx\n", IRQ_STACK_START);
-	debug("FIQ Stack: %08lx\n", FIQ_STACK_START);
-#endif
 
 	return 0;
 }
diff --git a/common/board_r.c b/common/board_r.c
index fd1fd31..a359f6a 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -507,6 +507,15 @@ static int show_model_r(void)
 }
 #endif
 
+static int display_interrupt_info(void)
+{
+#ifdef CONFIG_USE_IRQ
+	debug("IRQ Stack: %08lx\n", IRQ_STACK_START);
+	debug("FIQ Stack: %08lx\n", FIQ_STACK_START);
+#endif
+	return 0;
+}
+
 /* enable exceptions */
 #ifdef CONFIG_ARM
 static int initr_enable_interrupts(void)
@@ -841,6 +850,7 @@ init_fnc_t init_sequence_r[] = {
 	board_early_init_r,
 #endif
 	interrupt_init,
+	display_interrupt_info,
 #if defined(CONFIG_ARM) || defined(CONFIG_x86)
 	initr_enable_interrupts,
 #endif
-- 
1.7.9.5



More information about the U-Boot mailing list