Skip to contentSkip to conversation

fix displaying IRQ stack info

PATCH New Masahiro Yamada 2 participants 4 messages May 27, 2013 – Jun 12, 2013 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

cover fix displaying IRQ stack info

These series of patches fix the location of displaying IRQ stack infomation.

Because ARM architecture supports generic_board, I separated my commit into 2 patches.

The first one fix arch/arm/lib/board.c
The second one fix common/board_f.c and common/board_r.c

Masahiro Yamada (2):
arm: fix displaying IRQ stack info
common: arm: fix displaying IRQ stack info

 arch/arm/lib/board.c |   10 ++++++----
 common/board_f.c     |    4 ----
 common/board_r.c     |   10 ++++++++++
 3 files changed, 16 insertions(+), 8 deletions(-)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/2 arm: fix displaying IRQ stack info

With CONFIG_USE_IRQ and DEBUG macro defined, display_banner function printed stack address for IRQ and FIQ.

Global variables IRQ_STACK_START and FIQ_STACK_START are set in interrupt_init function.

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

So, display_banner 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 moves the stack info display code after interrupt_init call.

---
 arch/arm/lib/board.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
arch/arm/lib/board.c +6 -4
index 09ab4ad..34a394e 100644
@@ -126,10 +126,6 @@ static int display_banner(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);
 }
@@ -650,6 +646,12 @@ void board_init_r(gd_t *id, ulong dest_addr)
 
 	 /* set up exceptions */
 	interrupt_init();
+
+#ifdef CONFIG_USE_IRQ
+	debug("IRQ Stack: %08lx\n", IRQ_STACK_START);
+	debug("FIQ Stack: %08lx\n", FIQ_STACK_START);
+#endif
+
 	/* enable exceptions */
 	enable_interrupts();
 
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 2/2 common: arm: fix displaying IRQ stack info

In reply to Masahiro Yamada

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.

---
 common/board_f.c |    4 ----
 common/board_r.c |   10 ++++++++++
 2 files changed, 10 insertions(+), 4 deletions(-)
common/board_f.c +0 -4
index 81edbdf..0911869 100644
@@ -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;
 }
common/board_r.c +10 -0
index fd1fd31..a359f6a 100644
@@ -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
Signature · 1 line
1.7.9.5
#3 lore raw

cover fix displaying IRQ stack info

In reply to Masahiro Yamada
Quoted 9 lines · Masahiro Yamada

These series of patches fix the location of displaying IRQ stack infomation.

Because ARM architecture supports generic_board, I separated my commit into 2 patches.

The first one fix arch/arm/lib/board.c
The second one fix common/board_f.c and common/board_r.c

Quoted 8 lines

Masahiro Yamada (2):
arm: fix displaying IRQ stack info
common: arm: fix displaying IRQ stack info

 arch/arm/lib/board.c |   10 ++++++----
 common/board_f.c     |    4 ----
 common/board_r.c     |   10 ++++++++++
 3 files changed, 16 insertions(+), 8 deletions(-)

After discussing with Masahiro and Wolfgang, this patch will not be applied, as currently no board defines CONFIG_USE_IRQ any more. What becomes of code which depends on CONFIG_USE_IRQ will be sorted out through discussing an RFC on interrupt handling in U-boot which I will post within a couple of days.

Amicalement,

Signature · 1 line
Albert.