[U-Boot] [PATCH 0/2] 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(-)

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.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com --- arch/arm/lib/board.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c index 09ab4ad..34a394e 100644 --- a/arch/arm/lib/board.c +++ b/arch/arm/lib/board.c @@ -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();

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@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

On Mon, 27 May 2013 14:29:20 +0900, Masahiro Yamada yamada.m@jp.panasonic.com wrote:
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(-)
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,
participants (2)
-
Albert ARIBAUD
-
Masahiro Yamada