make hang() a weak function
Subsystems (14)
PATCH 1/1 make hang() a weak function
This patch also does some minor coding style cleanups.
--- arch/arm/lib/board.c | 3 ++- arch/avr32/lib/board.c | 3 ++- arch/blackfin/lib/board.c | 3 ++- arch/m68k/lib/board.c | 3 ++- arch/microblaze/lib/board.c | 5 +++-- arch/mips/lib/board.c | 3 ++- arch/nds32/lib/board.c | 3 ++- arch/nios2/lib/board.c | 5 +++-- arch/openrisc/lib/board.c | 3 ++- arch/powerpc/lib/board.c | 4 ++-- arch/sandbox/lib/board.c | 3 ++- arch/sh/lib/board.c | 3 ++- arch/sparc/lib/board.c | 3 ++- arch/x86/lib/board.c | 3 ++- common/board_f.c | 3 ++- common/spl/spl.c | 3 ++- drivers/mtd/nand/mxc_nand_spl.c | 3 ++- 17 files changed, 36 insertions(+), 20 deletions(-)
arch/arm/lib/board.c +2 -1
@@ -707,8 +707,9 @@ void board_init_r(gd_t *id, ulong dest_addr)/* NOTREACHED - no way out of command loop except booting */ } -void hang (void ) +void __hang (void ) {puts ("### ERROR ### Please RESET the board ###\n" );for (;;); } +void hang (void ) __attribute__((weak,alias ("__hang" )));
arch/avr32/lib/board.c +2 -1
@@ -120,10 +120,11 @@ static int display_banner (void)return 0 ; } -void hang (void ) +void __hang (void ) {for (;;) ; } +void hang (void ) __attribute__((weak,alias ("__hang" )));static int display_dram_config (void ) {
arch/blackfin/lib/board.c +2 -1
@@ -433,7 +433,7 @@ void board_init_r(gd_t * id, ulong dest_addr)main_loop (); } -void hang (void ) +void __hang (void ) {#ifdef CONFIG_STATUS_LED status_led_set (STATUS_LED_BOOT ,STATUS_LED_OFF );
@@ -446,3 +446,4 @@ void hang(void)*/ asm("emuexcpt;" ); } +void hang(void) __attribute__((weak, alias("__hang"));
arch/m68k/lib/board.c +2 -1
@@ -665,8 +665,9 @@ void board_init_r (gd_t *id, ulong dest_addr) } -void hang (void ) +void __hang (void ) {puts ("### ERROR ### Please RESET the board ###\n" );for (;;); } +void hang (void ) __attribute__((weak,alias ("__hang" )));
arch/microblaze/lib/board.c +3 -2
@@ -195,8 +195,9 @@ void board_init_f(ulong not_used) } } -void hang (void ) +void __hang (void ) { -puts ("### ERROR ### Please RESET the board ###\n" ); +puts ("### ERROR ### Please RESET the board ###\n" );for (;;) ; } +void hang (void ) __attribute__((weak,alias ("__hang" )));
arch/mips/lib/board.c +2 -1
@@ -345,9 +345,10 @@ void board_init_r(gd_t *id, ulong dest_addr)/* NOTREACHED - no way out of command loop except booting */ } -void hang (void ) +void __hang (void ) {puts ("### ERROR ### Please RESET the board ###\n" );for (;;) ; } +void hang (void ) __attribute__((weak,alias ("__hang" )));
arch/nds32/lib/board.c +2 -1
@@ -405,9 +405,10 @@ void board_init_r(gd_t *id, ulong dest_addr)/* NOTREACHED - no way out of command loop except booting */ } -void hang (void ) +void __hang (void ) {puts ("### ERROR ### Please RESET the board ###\n" );for (;;) ; } +void hang (void ) __attribute__((weak,alias ("__hang" )));
arch/nios2/lib/board.c +3 -2
@@ -168,9 +168,10 @@ void board_init (void)/***********************************************************************/ -void hang (void ) +void __hang (void ) { -disable_interrupts (); +disable_interrupts ();puts ("### ERROR ### Please reset board ###\n" );for (;;); } +void hang (void ) __attribute__((weak,alias ("__hang" )));
arch/openrisc/lib/board.c +2 -1
@@ -158,7 +158,7 @@ void board_init(void)/***********************************************************************/ -void hang (void ) +void __hang (void ) {disable_interrupts ();puts ("### ERROR ### Please reset board ###\n" );
@@ -166,3 +166,4 @@ void hang(void)for (;;) ; } +void hang (void ) __attribute__((weak,alias ("__hang" )));
arch/powerpc/lib/board.c +2 -2
@@ -1050,14 +1050,14 @@ void board_init_r(gd_t *id, ulong dest_addr)/* NOTREACHED - no way out of command loop except booting */ } -void hang (void ) +void __hang (void ) {puts ("### ERROR ### Please RESET the board ###\n" );bootstage_error (BOOTSTAGE_ID_NEED_RESET );for (;;) ; } - +void hang (void ) __attribute__((weak,alias ("__hang" )));#if 0 /* We could use plain global data, but the resulting code is bigger */ /*
arch/sandbox/lib/board.c +2 -1
@@ -277,9 +277,10 @@ void board_init_r(gd_t *id, ulong dest_addr)/* NOTREACHED - no way out of command loop except booting */ } -void hang (void ) +void __hang (void ) {puts ("### ERROR ### Please RESET the board ###\n" );for (;;) ; } +void hang (void ) __attribute__((weak,alias ("__hang" )));
arch/sh/lib/board.c +2 -1
@@ -203,9 +203,10 @@ void sh_generic_init(void)/***********************************************************************/ -void hang (void ) +void __hang (void ) {puts ("Board ERROR\n" );for (;;) ; } +void hang (void ) __attribute__((weak,alias ("__hang" )));
arch/sparc/lib/board.c +2 -1
@@ -411,7 +411,7 @@ void board_init_f(ulong bootflag) } -void hang (void ) +void __hang (void ) {puts ("### ERROR ### Please RESET the board ###\n" );#ifdef CONFIG_SHOW_BOOT_PROGRESS
@@ -419,5 +419,6 @@ void hang(void)#endif for (;;) ; } +void hang (void ) __attribute__((weak,alias ("__hang" )));/************************************************************************/
arch/x86/lib/board.c +2 -1
@@ -265,9 +265,10 @@ void board_init_r(gd_t *id, ulong dest_addr)/* NOTREACHED - no way out of command loop except booting */ } -void hang (void ) +void __hang (void ) {puts ("### ERROR ### Please RESET the board ###\n" );for (;;) ; } +void hang (void ) __attribute__((weak,alias ("__hang" )));
common/board_f.c +2 -1
@@ -1005,8 +1005,9 @@ void board_init_f_r(void) }#endif /* CONFIG_X86 */ -void hang (void ) +void __hang (void ) {puts ("### ERROR ### Please RESET the board ###\n" );for (;;); } +void hang (void ) __attribute__((weak,alias ("__hang" )));
common/spl/spl.c +2 -1
@@ -48,12 +48,13 @@ struct spl_image_info spl_image;/* Define board data structure */ static bd_t bdata __attribute__ ((section(".data"))); -inline void hang (void ) +inline void __hang (void ) {puts ("### ERROR ### Please RESET the board ###\n" );for (;;) ; } +void hang (void ) __attribute__((weak,alias ("__hang" )));/* * Default function to determine if u-boot or the OS should
drivers/mtd/nand/mxc_nand_spl.c +2 -1
@@ -359,8 +359,9 @@ void nand_boot(void)/* * Called in case of an exception. */ -void hang (void ) +void __hang (void ) {/* Loop forever */ while (1 ) ; } +void hang (void ) __attribute__((weak,alias ("__hang" )));
Signature · 1 line
1.7.10.4
PATCH 1/1 make hang() a weak function
Hi Andreas,
Quoted 29 lines · Andreas Bie?mann
This patch also does some minor coding style cleanups.
Signed-off-by Andreas Bie?mann <[email protected]>--- arch/arm/lib/board.c | 3 ++- arch/avr32/lib/board.c | 3 ++- arch/blackfin/lib/board.c | 3 ++- arch/m68k/lib/board.c | 3 ++- arch/microblaze/lib/board.c | 5 +++-- arch/mips/lib/board.c | 3 ++- arch/nds32/lib/board.c | 3 ++- arch/nios2/lib/board.c | 5 +++-- arch/openrisc/lib/board.c | 3 ++- arch/powerpc/lib/board.c | 4 ++-- arch/sandbox/lib/board.c | 3 ++- arch/sh/lib/board.c | 3 ++- arch/sparc/lib/board.c | 3 ++- arch/x86/lib/board.c | 3 ++- common/board_f.c | 3 ++- common/spl/spl.c | 3 ++- drivers/mtd/nand/mxc_nand_spl.c | 3 ++- 17 files changed, 36 insertions(+), 20 deletions(-)arch/arm/lib/board.c +0
-0
arch/arm/lib/board.c void board_init_r(gd_t *id, ulong dest_addr) · line 715
Quoted 10 lines
arch/arm/lib/board.c +2
-1@@ -707,8 +707,9 @@ void board_init_r(gd_t *id, ulong dest_addr)/* NOTREACHED - no way out of command loop except booting */ } -void hang (void ) +void __hang (void ) {puts ("### ERROR ### Please RESET the board ###\n" );for (;;); } +void hang (void ) __attribute__((weak,alias ("__hang" )));
Please include "linux/compiler.h" and use:
void __weak hang(void)
{
puts("### ERROR ### Please RESET the board ###\n");
for (;;);
}instead. No __attribute__ needed and easier to read.
Thanks,
Stefan
PATCH 1/1 make hang() a weak function
In reply to Andreas BießmannHi Andreas,
Quoted 3 lines · Andreas Bie?mann
This patch also does some minor coding style cleanups.
Coding style cleanups belong in a separate patch - Rules are rules ;)
Regards,
Graeme
PATCH 1/1 make hang() a weak function
In reply to Andreas BießmannHi Andreas,
Quoted 300 lines · Andreas Bie?mann
This patch also does some minor coding style cleanups.
Signed-off-by Andreas Bie?mann <[email protected]>--- arch/arm/lib/board.c | 3 ++- arch/avr32/lib/board.c | 3 ++- arch/blackfin/lib/board.c | 3 ++- arch/m68k/lib/board.c | 3 ++- arch/microblaze/lib/board.c | 5 +++-- arch/mips/lib/board.c | 3 ++- arch/nds32/lib/board.c | 3 ++- arch/nios2/lib/board.c | 5 +++-- arch/openrisc/lib/board.c | 3 ++- arch/powerpc/lib/board.c | 4 ++-- arch/sandbox/lib/board.c | 3 ++- arch/sh/lib/board.c | 3 ++- arch/sparc/lib/board.c | 3 ++- arch/x86/lib/board.c | 3 ++- common/board_f.c | 3 ++- common/spl/spl.c | 3 ++- drivers/mtd/nand/mxc_nand_spl.c | 3 ++- 17 files changed, 36 insertions(+), 20 deletions(-)arch/arm/lib/board.c +2
-1@@ -707,8 +707,9 @@ void board_init_r(gd_t *id, ulong dest_addr)/* NOTREACHED - no way out of command loop except booting */ } -void hang (void ) +void __hang (void ) {puts ("### ERROR ### Please RESET the board ###\n" );for (;;); } +void hang (void ) __attribute__((weak,alias ("__hang" )));arch/avr32/lib/board.c +2
-1@@ -120,10 +120,11 @@ static int display_banner (void)return 0 ; } -void hang (void ) +void __hang (void ) {for (;;) ; } +void hang (void ) __attribute__((weak,alias ("__hang" )));static int display_dram_config (void ) {arch/blackfin/lib/board.c +2
-1@@ -433,7 +433,7 @@ void board_init_r(gd_t * id, ulong dest_addr)main_loop (); } -void hang (void ) +void __hang (void ) {#ifdef CONFIG_STATUS_LED status_led_set (STATUS_LED_BOOT ,STATUS_LED_OFF );@@ -446,3 +446,4 @@ void hang(void)*/ asm("emuexcpt;" ); } +void hang(void) __attribute__((weak, alias("__hang"));arch/m68k/lib/board.c +2
-1@@ -665,8 +665,9 @@ void board_init_r (gd_t *id, ulong dest_addr) } -void hang (void ) +void __hang (void ) {puts ("### ERROR ### Please RESET the board ###\n" );for (;;); } +void hang (void ) __attribute__((weak,alias ("__hang" )));arch/microblaze/lib/board.c +3
-2@@ -195,8 +195,9 @@ void board_init_f(ulong not_used) } } -void hang (void ) +void __hang (void ) { -puts ("### ERROR ### Please RESET the board ###\n" ); +puts ("### ERROR ### Please RESET the board ###\n" );for (;;) ; } +void hang (void ) __attribute__((weak,alias ("__hang" )));arch/mips/lib/board.c +2
-1@@ -345,9 +345,10 @@ void board_init_r(gd_t *id, ulong dest_addr)/* NOTREACHED - no way out of command loop except booting */ } -void hang (void ) +void __hang (void ) {puts ("### ERROR ### Please RESET the board ###\n" );for (;;) ; } +void hang (void ) __attribute__((weak,alias ("__hang" )));arch/nds32/lib/board.c +2
-1@@ -405,9 +405,10 @@ void board_init_r(gd_t *id, ulong dest_addr)/* NOTREACHED - no way out of command loop except booting */ } -void hang (void ) +void __hang (void ) {puts ("### ERROR ### Please RESET the board ###\n" );for (;;) ; } +void hang (void ) __attribute__((weak,alias ("__hang" )));arch/nios2/lib/board.c +3
-2@@ -168,9 +168,10 @@ void board_init (void)/***********************************************************************/ -void hang (void ) +void __hang (void ) { -disable_interrupts (); +disable_interrupts ();puts ("### ERROR ### Please reset board ###\n" );for (;;); } +void hang (void ) __attribute__((weak,alias ("__hang" )));arch/openrisc/lib/board.c +2
-1@@ -158,7 +158,7 @@ void board_init(void)/***********************************************************************/ -void hang (void ) +void __hang (void ) {disable_interrupts ();puts ("### ERROR ### Please reset board ###\n" );@@ -166,3 +166,4 @@ void hang(void)for (;;) ; } +void hang (void ) __attribute__((weak,alias ("__hang" )));arch/powerpc/lib/board.c +2
-2@@ -1050,14 +1050,14 @@ void board_init_r(gd_t *id, ulong dest_addr)/* NOTREACHED - no way out of command loop except booting */ } -void hang (void ) +void __hang (void ) {puts ("### ERROR ### Please RESET the board ###\n" );bootstage_error (BOOTSTAGE_ID_NEED_RESET );for (;;) ; } - +void hang (void ) __attribute__((weak,alias ("__hang" )));#if 0 /* We could use plain global data, but the resulting code is bigger */ /* arch/sandbox/lib/board.c +2
-1@@ -277,9 +277,10 @@ void board_init_r(gd_t *id, ulong dest_addr)/* NOTREACHED - no way out of command loop except booting */ } -void hang (void ) +void __hang (void ) {puts ("### ERROR ### Please RESET the board ###\n" );for (;;) ; } +void hang (void ) __attribute__((weak,alias ("__hang" )));arch/sh/lib/board.c +2
-1@@ -203,9 +203,10 @@ void sh_generic_init(void)/***********************************************************************/ -void hang (void ) +void __hang (void ) {puts ("Board ERROR\n" );for (;;) ; } +void hang (void ) __attribute__((weak,alias ("__hang" )));arch/sparc/lib/board.c +2
-1@@ -411,7 +411,7 @@ void board_init_f(ulong bootflag) } -void hang (void ) +void __hang (void ) {puts ("### ERROR ### Please RESET the board ###\n" );#ifdef CONFIG_SHOW_BOOT_PROGRESS @@ -419,5 +419,6 @@ void hang(void)#endif for (;;) ; } +void hang (void ) __attribute__((weak,alias ("__hang" )));/************************************************************************/ arch/x86/lib/board.c +2
-1@@ -265,9 +265,10 @@ void board_init_r(gd_t *id, ulong dest_addr)/* NOTREACHED - no way out of command loop except booting */ } -void hang (void ) +void __hang (void ) {puts ("### ERROR ### Please RESET the board ###\n" );for (;;) ; } +void hang (void ) __attribute__((weak,alias ("__hang" )));common/board_f.c +2
-1@@ -1005,8 +1005,9 @@ void board_init_f_r(void) }#endif /* CONFIG_X86 */ -void hang (void ) +void __hang (void ) {puts ("### ERROR ### Please RESET the board ###\n" );for (;;); } +void hang (void ) __attribute__((weak,alias ("__hang" )));common/spl/spl.c +2
-1@@ -48,12 +48,13 @@ struct spl_image_info spl_image;/* Define board data structure */ static bd_t bdata __attribute__ ((section(".data"))); -inline void hang (void ) +inline void __hang (void ) {puts ("### ERROR ### Please RESET the board ###\n" );for (;;) ; } +void hang (void ) __attribute__((weak,alias ("__hang" )));/* * Default function to determine if u-boot or the OS should drivers/mtd/nand/mxc_nand_spl.c +0
-0
drivers/mtd/nand/mxc_nand_spl.c void nand_boot(void) · line 367
Quoted 10 lines
drivers/mtd/nand/mxc_nand_spl.c +2
-1@@ -359,8 +359,9 @@ void nand_boot(void)/* * Called in case of an exception. */ -void hang (void ) +void __hang (void ) {/* Loop forever */ while (1 ) ; } +void hang (void ) __attribute__((weak,alias ("__hang" )));
Apart from Stefan's comments: considered standalone, doesn't this patch have zero effect? I suspect you intend to use this in a later patch, and if so, I would suggest grouping these in a series so that the subsequent patch(es) explain this one.
Amicalement,
Signature · 1 line
Albert.
PATCH 1/1 make hang() a weak function
Hi Albert,
Quoted 28 lines · Albert ARIBAUD
Hi Andreas,
Quoted 23 lines · Andreas Bie?mann
This patch also does some minor coding style cleanups.
Signed-off-by Andreas Bie?mann <[email protected]>--- arch/arm/lib/board.c | 3 ++- arch/avr32/lib/board.c | 3 ++- arch/blackfin/lib/board.c | 3 ++- arch/m68k/lib/board.c | 3 ++- arch/microblaze/lib/board.c | 5 +++-- arch/mips/lib/board.c | 3 ++- arch/nds32/lib/board.c | 3 ++- arch/nios2/lib/board.c | 5 +++-- arch/openrisc/lib/board.c | 3 ++- arch/powerpc/lib/board.c | 4 ++-- arch/sandbox/lib/board.c | 3 ++- arch/sh/lib/board.c | 3 ++- arch/sparc/lib/board.c | 3 ++- arch/x86/lib/board.c | 3 ++- common/board_f.c | 3 ++- common/spl/spl.c | 3 ++- drivers/mtd/nand/mxc_nand_spl.c | 3 ++- 17 files changed, 36 insertions(+), 20 deletions(-)
<snip>
Quoted 5 lines
Apart from Stefan's comments: considered standalone, doesn't this patch have zero effect? I suspect you intend to use this in a later patch, and if so, I would suggest grouping these in a series so that the subsequent patch(es) explain this one.
I would like to use a specialized hang() for a not mainlined board, thus there will no more patches using this currently.
Best regards
Andreas Bie?mann
PATCH 1/1 make hang() a weak function
Dear "Andreas Bie?mann",
Quoted 8 lines · In message <[email protected]> you wrote:
Quoted 5 lines
Apart from Stefan's comments: considered standalone, doesn't this patch have zero effect? I suspect you intend to use this in a later patch, and if so, I would suggest grouping these in a series so that the subsequent patch(es) explain this one.
I would like to use a specialized
hang()for a not mainlined board, thus there will no more patches using this currently.
So it is dead code in mainline, and we will not add it.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Keep your eyes wide open before marriage, half shut afterwards.
-- Benjamin FranklinPATCH 1/1 make hang() a weak function
Dear Wolfgang Denk,
Quoted 9 lines · Wolfgang Denk
Dear "Andreas Bie?mann",
Quoted 6 lines · In message <[email protected]> you wrote:
Quoted 5 lines
Apart from Stefan's comments: considered standalone, doesn't this patch have zero effect? I suspect you intend to use this in a later patch, and if so, I would suggest grouping these in a series so that the subsequent patch(es) explain this one.
Quoted 4 lines
Quoted 2 lines
I would like to use a specialized
hang()for a not mainlined board, thus there will no more patches using this currently.So it is dead code in mainline, and we will not add it.
Well, I don't think it is dead code cause the hang() is called in some ways. This patch opens just the possibility to specialize the hang() by for example a specific board. Maybe this could also be used for specific hang() for different arches when we get closer to the common board files. It is correct that we do not need this patch now and I can handle it here in my own tree.
Best regards
Andreas Bie?mann
PATCH 1/1 make hang() a weak function
Dear Andreas,
Quoted 7 lines · In message <[email protected]> you wrote:
Quoted 2 lines
So it is dead code in mainline, and we will not add it.
Well, I don't think it is dead code cause the
hang()is called in some ways. This patch opens just the possibility to specialize thehang()by for example a specific board. Maybe this could also be used for specifichang()for different arches when we get closer to the common board files.
I think it is dead code, and not needed nor useful in mainline. I cannot even see how it would be useful for you. hang() is defined to "hang" the CPU, i. e. to make sure the system will remain in the current state. To me this naturally translates into an infinite loop, the implementation of which is completely hardware and architecture independent.
Note that hang() is not supposed to do anything else, it just hangs the system. If you have a debugger attached, you will be able to do a simple stack backtrace and see exactly where you are hanging, and why.
If you think you need to have specialized code, you are doing something wrong.
Quoted 2 lines
It is correct that we do not need this patch now and I can handle it here in my own tree.
Good.
Best regards,
Wolfgang Denk
Signature · 4 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de God made machine language; all the rest is the work of man.
PATCH 1/1 make hang() a weak function
Dear Wolfgang,
Quoted 11 lines · Wolfgang Denk
Dear Andreas,
Quoted 7 lines · In message <[email protected]> you wrote:
Quoted 2 lines
So it is dead code in mainline, and we will not add it.
Well, I don't think it is dead code cause the
hang()is called in some ways. This patch opens just the possibility to specialize thehang()by for example a specific board. Maybe this could also be used for specifichang()for different arches when we get closer to the common board files.
Quoted 6 lines
I think it is dead code, and not needed nor useful in mainline. I cannot even see how it would be useful for you.
hang()is defined to "hang" the CPU, i. e. to make sure the system will remain in the current state. To me this naturally translates into an infinite loop, the implementation of which is completely hardware and architecture independent.
Yes it is independent (or should at least). But there are still slightly different versions:
---8<---
arch/blackfin/lib/board.c:void hang(void) arch/blackfin/lib/board.c-{ arch/blackfin/lib/board.c-#ifdef CONFIG_STATUS_LEDarch/blackfin/lib/board.c- status_led_set(STATUS_LED_BOOT,STATUS_LED_OFF);arch/blackfin/lib/board.c- status_led_set(STATUS_LED_CRASH,STATUS_LED_BLINKING);
--->8---
---8<---
arch/arm/lib/board.c:void __hang(void)arch/arm/lib/board.c-{arch/arm/lib/board.c- puts("### ERROR ### Please RESET the board ###\n");arch/arm/lib/board.c- for (;;);arch/arm/lib/board.c-}
--->8---
---8<---
arch/powerpc/lib/board.c:void __hang(void)arch/powerpc/lib/board.c-{arch/powerpc/lib/board.c- puts("### ERROR ### Please RESET the
board ###\n");arch/powerpc/lib/board.c- bootstage_error(BOOTSTAGE_ID_NEED_RESET);arch/powerpc/lib/board.c- for (;;)
--->8---
Quoted 3 lines
Note that
hang()is not supposed to do anything else, it just hangs the system. If you have a debugger attached, you will be able to do a simple stack backtrace and see exactly where you are hanging, and why.
Well, for this specific board I plan to panic() on wrong hardware detection (which will in turn call hang()). My requirements say that I have to visualize this state then, I thought it would be a good idea to blink some lights in the endless loop in hang() for this specific board.
Quoted 2 lines
If you think you need to have specialized code, you are doing something wrong.
Really? How would you solve this requirement?
Best regards
Andreas Bie?mann
PATCH 1/1 make hang() a weak function
Hi Andreas,
Quoted 11 lines · Andreas Bie?mann
Dear Wolfgang,
Quoted 7 lines · Wolfgang Denk
Dear Andreas,
Quoted 4 lines · In message <[email protected]> you wrote:
Quoted 2 lines
So it is dead code in mainline, and we will not add it.
Well, I don't think it is dead code cause the
hang()is called in some
ways.
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
This patch opens just the possibility to specialize the
hang()by for example a specific board. Maybe this could also be used for specifichang()for different arches when we get closer to the common board
files.
Quoted 21 lines
Quoted 7 lines
I think it is dead code, and not needed nor useful in mainline. I cannot even see how it would be useful for you.
hang()is defined to "hang" the CPU, i. e. to make sure the system will remain in the current state. To me this naturally translates into an infinite loop, the implementation of which is completely hardware and architecture independent.Yes it is independent (or should at least). But there are still slightly different versions:
---8<---
arch/blackfin/lib/board.c:void hang(void)arch/blackfin/lib/board.c-{arch/blackfin/lib/board.c-#ifdefCONFIG_STATUS_LEDarch/blackfin/lib/board.c-status_led_set(STATUS_LED_BOOT,STATUS_LED_OFF);arch/blackfin/lib/board.c-status_led_set(STATUS_LED_CRASH,STATUS_LED_BLINKING);
--->8---
Quoted 4 lines
---8<---
arch/arm/lib/board.c:void__hang(void)arch/arm/lib/board.c-{arch/arm/lib/board.c-puts("### ERROR ### Please RESET the board
###\n");
Quoted 4 lines
arch/arm/lib/board.c-for (;;);arch/arm/lib/board.c-}
--->8---
Quoted 8 lines
---8<---
arch/powerpc/lib/board.c:void__hang(void)arch/powerpc/lib/board.c-{arch/powerpc/lib/board.c-puts("### ERROR ### Please RESET the
board ###\n");arch/powerpc/lib/board.c-bootstage_error(BOOTSTAGE_ID_NEED_RESET);arch/powerpc/lib/board.c-for (;;)
--->8---
I think that ultimately there should only be a single hang() function
Quoted 9 lines
Quoted 3 lines
Note that
hang()is not supposed to do anything else, it just hangs the system. If you have a debugger attached, you will be able to do a simple stack backtrace and see exactly where you are hanging, and why.Well, for this specific board I plan to
panic()on wrong hardware detection (which will in turn callhang()). My requirements say that I have to visualize this state then, I thought it would be a good idea to blink some lights in the endless loop inhang()for this specific board.
Quoted 4 lines
Quoted 2 lines
If you think you need to have specialized code, you are doing something wrong.
Really? How would you solve this requirement?
Doesn't it make sense to use panic()?
Regards,
Graeme
PATCH 1/1 make hang() a weak function
Hi Graeme,
Quoted 12 lines · Graeme Russ
Hi Andreas,
Quoted 7 lines · On Tue, Apr 16, 2013 at 11:32 PM, Andreas Bie?mann <andreas.devel at…
Dear Wolfgang,
Quoted 3 lines · Wolfgang Denk
Dear Andreas,
In message <[email protected]
<mailto:[email protected]>> you wrote:
<snip>
Quoted 1 line
I think that ultimately there should only be a single
hang()function
Ok.
Quoted 9 lines
Quoted 9 lines
Quoted 3 lines
Note that
hang()is not supposed to do anything else, it just hangs the system. If you have a debugger attached, you will be able to do a simple stack backtrace and see exactly where you are hanging, and why.Well, for this specific board I plan to
panic()on wrong hardware detection (which will in turn callhang()). My requirements say that I have to visualize this state then, I thought it would be a good idea to blink some lights in the endless loop inhang()for this specific board.
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
If you think you need to have specialized code, you are doing something wrong.
Really? How would you solve this requirement?
Doesn't it make sense to use
panic()?
In my opinion it makes sense to panic(). In my special case I also need to hang() when panic(). The next question is then how to visualize the (end-)user of that device that we hang().
Best regards
Andreas Bie?mann
PATCH 1/1 make hang() a weak function
Hi Andreas,
Quoted 8 lines · Andreas Bie?mann
Hi Graeme,
Quoted 4 lines · Graeme Russ
Hi Andreas,
On Tue, Apr 16, 2013 at 11:32 PM, Andreas Bie?mann <andreas.devel at googlemail.com <mailto:[email protected]>>
Quoted 6 lines · wrote:
Quoted 6 lines
Quoted 6 lines
Dear Wolfgang,
Quoted 2 lines · Wolfgang Denk
Dear Andreas,
Quoted 11 lines
Quoted 2 lines
Quoted 1 line
Quoted 1 line
In message <[email protected]
<mailto:[email protected]>> you wrote:
<snip>
Quoted 1 line
I think that ultimately there should only be a single
hang()functionOk.
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Note that
hang()is not supposed to do anything else, it just hangs the system. If you have a debugger attached, you will be able to do
a
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
simple stack backtrace and see exactly where you are hanging, and
why.
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Well, for this specific board I plan to
panic()on wrong hardware detection (which will in turn callhang()). My requirements say that I have to visualize this state then, I thought it would be a good idea to blink some lights in the endless loop inhang()for this specific
board.
Quoted 11 lines
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
If you think you need to have specialized code, you are doing something wrong.
Really? How would you solve this requirement?
Doesn't it make sense to use
panic()?In my opinion it makes sense to
panic(). In my special case I also need tohang()whenpanic(). The next question is then how to visualize the (end-)user of that device that wehang().
In panic()?
My thought would be along the lines of:
- Detect something fatal
- Call panic()
- Do something to alert the user - puts(), start a LED blinking, etc.
- Stay in panic() if you need CPU cycles to keep alerting the user (LED
blinking for example)
- Call hang() if you've done everything you can
Regards,
Graeme
PATCH 1/1 make hang() a weak function
In reply to Andreas BießmannDear Andreas,
Quoted 4 lines · In message <[email protected]> you wrote:
In my opinion it makes sense to
panic(). In my special case I also need tohang()whenpanic(). The next question is then how to visualize the (end-)user of that device that wehang().
The intention behind hang() is to stop doing anything, i. e. to idle the board. Nothing else.
We can argue if this is always a good thing to do. For example, in some situations it may be possible to switch off the board instead. Or, as in your case, to run some code to visualize the state.
I fully agree that these are perfectly reasonable use cases for fatal error handling in U-Boot. But then, these are not functions to be implemented in the context of hang(). Hang is a synonym for "place the CPU into an infinite loop and stop doing anything else".
If you call hang() you agree to hang the system.
If you want to do something else, then please do not call hang(), but some other function.
Best regards,
Wolfgang Denk
Signature · 4 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Overdrawn? But I still have checks left!
PATCH 1/1 make hang() a weak function
Dear Wolfgang,
Quoted 15 lines · Wolfgang Denk
Dear Andreas,
Quoted 4 lines · In message <[email protected]> you wrote:
In my opinion it makes sense to
panic(). In my special case I also need tohang()whenpanic(). The next question is then how to visualize the (end-)user of that device that wehang().The intention behind
hang()is to stop doing anything, i. e. to idle the board. Nothing else.We can argue if this is always a good thing to do. For example, in some situations it may be possible to switch off the board instead. Or, as in your case, to run some code to visualize the state.
Quoted 6 lines
I fully agree that these are perfectly reasonable use cases for fatal error handling in U-Boot. But then, these are not functions to be implemented in the context of
hang(). Hang is a synonym for "place the CPU into an infinite loop and stop doing anything else".If you call
hang()you agree to hang the system.
I got your point.
Quoted 2 lines
If you want to do something else, then please do not call
hang(), but some other function.
I will find a solution for my very specific state of the device.
But how about other places in u-boot hang()ing the device? How can we tell the user that state without a terminal? If one plugs a uart cable he might see some cause of the hang() but this is not acceptable for some groups of users.
Is it wise to completely stop a device without showing the state to the user?
This question is a bit hypothetical cause we should eliminate the root causes for hang()s before going to market. However I would like to hear your thoughts about that.
Best regards
Andreas Bie?mann
PATCH 1/1 make hang() a weak function
Dear Andreas,
Quoted 7 lines · In message <[email protected]> you wrote:
But how about other places in u-boot hang()ing the device? How can we tell the user that state without a terminal? If one plugs a uart cable he might see some cause of the
hang()but this is not acceptable for some groups of users.
Is it wise to completely stop a device without showing the state to the user?
If you want to tell the user, this should be done _before_ calling hang() - if you decide to hang() your board. Keep in mind that you don't have to define CONFIG_PANIC_HANG.
Also, as done in arch/powerpc/lib/board.c we usually print an error message on the console device, and we can call bootstage_error(), which could initialte such actions.
Quoted 3 lines
This question is a bit hypothetical cause we should eliminate the root causes for hang()s before going to market. However I would like to hear your thoughts about that.
You cannot eliminate all causes that will lead a board to run into hang(). There may be simply broken hardware, for example...
Best regards,
Wolfgang Denk
Signature · 4 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de F u cn rd ths u cnt spl wrth a dm!
PATCH 1/1 make hang() a weak function
Dear Wolfgang,
Quoted 11 lines · Wolfgang Denk
Dear Andreas,
Quoted 7 lines · In message <[email protected]> you wrote:
But how about other places in u-boot hang()ing the device? How can we tell the user that state without a terminal? If one plugs a uart cable he might see some cause of the
hang()but this is not acceptable for some groups of users.
Is it wise to completely stop a device without showing the state to the user?
Quoted 2 lines
If you want to tell the user, this should be done _before_ calling
hang()- if you decide tohang()your board.
Well, that is my point. We have about 40 places where we may hang() a arm device:
---8<---
abiessmann@punisher % git grep "hang(" drivers/ arch/arm/ | wc -l 40
--->8---
You say (or at least I understand you so), that I have to hack all these places with some application specific stuff to inform the user of the device that we will stop processing now. Why don't we add an interface to easily change the behavior of hang application specific.
Quoted 2 lines
Keep in mind that you
don't have to defineCONFIG_PANIC_HANG.
Thats true, but in some cases we just want to hang on panic.
Quoted 3 lines
Also, as done in
arch/powerpc/lib/board.cwe usually print an error message on the console device, and we can callbootstage_error(), which could initialte such actions.
Ahhh ... I got it. So this is the interface I want! All we need is bootstage_error() in all hang() variants and thats it.
Quoted 6 lines
Quoted 3 lines
This question is a bit hypothetical cause we should eliminate the root causes for hang()s before going to market. However I would like to hear your thoughts about that.
You cannot eliminate all causes that will lead a board to run into
hang(). There may be simply broken hardware, for example...
Thats true.
Best regards
Andreas Bie?mann
PATCH 1/1 make hang() a weak function
Dear Andreas,
Quoted 5 lines · In message <[email protected]> you wrote:
You say (or at least I understand you so), that I have to hack all these places with some application specific stuff to inform the user of the device that we will stop processing now. Why don't we add an interface to easily change the behavior of hang application specific.
Because hang() is a trivial function that does just what the name says. If you don't want this, then don't use this. If you need additional functionality, then use a function that provides such.
Quoted 4 lines
Quoted 2 lines
Keep in mind that you
don't have to defineCONFIG_PANIC_HANG.Thats true, but in some cases we just want to hang on panic.
Indeed. Normally this is the most useful thing to do.
Quoted 6 lines
Quoted 3 lines
Also, as done in
arch/powerpc/lib/board.cwe usually print an error message on the console device, and we can callbootstage_error(), which could initialte such actions.Ahhh ... I got it. So this is the interface I want! All we need is
bootstage_error()in allhang()variants and thats it.
As you have to touch all these places anyway, please rather move hang() out of all architecture specific code and place it in the global lib/.
Best regards,
Wolfgang Denk
Signature · 7 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Misquotation is, in fact, the pride and privilege of the learned. A
widely-read man never quotes accurately, for the rather obvious
reason that he has read too widely.
- Hesketh Pearson _Common Misquotations_ introductionPATCH 1/1 make hang() a weak function
Dear Wolfgang,
Quoted 8 lines · Wolfgang Denk
Dear Andreas,
Quoted 4 lines · In message <[email protected]> you wrote:
Quoted 3 lines
Also, as done in
arch/powerpc/lib/board.cwe usually print an error message on the console device, and we can callbootstage_error(), which could initialte such actions.
Quoted 6 lines
Quoted 2 lines
Ahhh ... I got it. So this is the interface I want! All we need is
bootstage_error()in allhang()variants and thats it.As you have to touch all these places anyway, please rather move
hang()out of all architecture specific code and place it in the globallib/.
will do.
Best regards
Andreas Bie?mann
PATCH 1/1 make hang() a weak function
In reply to Andreas BießmannDear Andreas,
Quoted 3 lines · In message <[email protected]> you wrote:
Yes it is independent (or should at least). But there are still slightly different versions:
Yes, I know :-(
Quoted 8 lines
---8<---
arch/powerpc/lib/board.c:void__hang(void)arch/powerpc/lib/board.c-{arch/powerpc/lib/board.c-puts("### ERROR ### Please RESET the
board ###\n");arch/powerpc/lib/board.c-bootstage_error(BOOTSTAGE_ID_NEED_RESET);arch/powerpc/lib/board.c-for (;;)
--->8---
This is probably what the generic code should look like.
Quoted 9 lines
Quoted 3 lines
Note that
hang()is not supposed to do anything else, it just hangs the system. If you have a debugger attached, you will be able to do a simple stack backtrace and see exactly where you are hanging, and why.Well, for this specific board I plan to
panic()on wrong hardware detection (which will in turn callhang()). My requirements say that I have to visualize this state then, I thought it would be a good idea to blink some lights in the endless loop inhang()for this specific board.
Quoted 4 lines
Quoted 2 lines
If you think you need to have specialized code, you are doing something wrong.
Really? How would you solve this requirement?
Turn on the blinking in panic(), before calling hang(). This requires that you have some way to blink a LED when the CPU is hanging in an endlss loop, though.
In general, panic() and hang() are for fatal errors where no way of recovery is possible and where you cannot make any assumptions about remaining (or even allowed) functionality. The puts() and bootstage_*() calls above are already stretching the design pretty far. We should not add more functionality here.
Best regards,
Wolfgang Denk
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
That said, there may be good reasons for what you did beyond obsequi-
ous sycophantic parody. Perhaps you might be so kind as to elucidate.
-- Tom Christiansen in <[email protected]>v2 cover consolidate hang()
In reply to Andreas BießmannThis series started with intention to make a hung board visualize the (end-)user that it does hang(). The first approach was to make all the different hang() functions weak and provide board specific versions to implement the 'visualization' there.
After some discussion it turned out, that there is still an interface to visualize such states to the user: the 'bootstage' stuff.
BTW:
This is my first try sending a series with patman. All I can say is:
patman is really cool ;)
The 'microblaze: fix style in board.c' is an leftover from the first approach.
The 'nios2: fix style in board.c' is an leftover from the first approach.
The 'lib: consolidate hang()' is build tested on arm and avr32. It may produces errors on other arches like ppc cause the previous SPL inlined hang() function was also removed. We need to discuss if we always pull in the libgeneric unconditional into SPL or provide a second hang() for those boards which do not link against libgeneric in SPL.
Changes in v2:
* delete all hang() and provide generic lib/hang.c
Andreas Bie?mann (5):
microblaze: fix style in board.c
nios2: fix style in board.c.
mx31pdk: add CONFIG_SPL_LIBGENERIC_SUPPORT
tx25: add CONFIG_SPL_LIBGENERIC_SUPPORT
lib: consolidate hang()
arch/arm/cpu/arm926ejs/mxs/spl_boot.c | 8 +---- arch/arm/cpu/arm926ejs/spear/spl.c | 7 ---- arch/arm/lib/board.c | 7 +--- arch/avr32/lib/board.c | 6 +--- arch/blackfin/lib/board.c | 15 +------- arch/m68k/lib/board.c | 7 ---- arch/microblaze/lib/board.c | 63 +++++++++++++++------------------ arch/mips/lib/board.c | 8 +---- arch/nds32/lib/board.c | 8 +---- arch/nios2/lib/board.c | 47 ++++++++++-------------- arch/openrisc/lib/board.c | 13 +------ arch/powerpc/lib/board.c | 10 +----- arch/sandbox/lib/board.c | 8 +---- arch/sh/lib/board.c | 10 +----- arch/sparc/lib/board.c | 10 +----- arch/x86/lib/board.c | 8 +---- common/board_f.c | 6 ---- common/spl/spl.c | 7 ---- drivers/mtd/nand/mxc_nand_spl.c | 10 +----- include/configs/mx31pdk.h | 1 + include/configs/tx25.h | 1 + lib/Makefile | 1 + lib/hang.c | 47 ++++++++++++++++++++++++ 23 files changed, 109 insertions(+), 199 deletions(-) create mode 100644 lib/hang.c
Signature · 1 line
1.7.10.4
PATCH v2 1/5 microblaze: fix style in board.c
Make microblaze's board.c checkpatch clean.
---
Changes in v2: None
arch/microblaze/lib/board.c | 64 +++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 32 deletions(-)
arch/microblaze/lib/board.c +32 -32
@@ -71,15 +71,15 @@ void board_init_f(ulong not_used) {bd_t *bd;init_fnc_t **init_fnc_ptr; - gd = (gd_t *) (CONFIG_SYS_SDRAM_BASE +CONFIG_SYS_GBL_DATA_OFFSET ); - bd = (bd_t *) (CONFIG_SYS_SDRAM_BASE +CONFIG_SYS_GBL_DATA_OFFSET \ + gd = (gd_t *)(CONFIG_SYS_SDRAM_BASE +CONFIG_SYS_GBL_DATA_OFFSET ); + bd = (bd_t *)(CONFIG_SYS_SDRAM_BASE +CONFIG_SYS_GBL_DATA_OFFSET -GENERATED_BD_INFO_SIZE );#if defined(CONFIG_CMD_FLASH )ulong flash_size =0 ;#endif asm ("nop" );/* FIXME gd is not initialize - wait */ -memset ((void *)gd,0 ,GENERATED_GBL_DATA_SIZE ); -memset ((void *)bd,0 ,GENERATED_BD_INFO_SIZE ); +memset ((void *)gd,0 ,GENERATED_GBL_DATA_SIZE ); +memset ((void *)bd,0 ,GENERATED_BD_INFO_SIZE ); gd->bd = bd; gd->baudrate =CONFIG_BAUDRATE ; bd->bi_baudrate =CONFIG_BAUDRATE ;
@@ -105,57 +105,56 @@ void board_init_f(ulong not_used)* aka CONFIG_SYS_MONITOR_BASE - Note there is no need for reloc_off * as our monitory code is run from SDRAM */ -mem_malloc_init (CONFIG_SYS_MALLOC_BASE ,CONFIG_SYS_MALLOC_LEN ); +mem_malloc_init (CONFIG_SYS_MALLOC_BASE ,CONFIG_SYS_MALLOC_LEN );serial_initialize ();for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) { -WATCHDOG_RESET (); -if ((*init_fnc_ptr) () !=0 ) { -hang (); - } +WATCHDOG_RESET (); +if ((*init_fnc_ptr) () !=0 ) +hang (); }#ifdef CONFIG_OF_CONTROL /* For now, put this check after the console is ready */ -if (fdtdec_prepare_fdt ()) { -panic ("** CONFIG_OF_CONTROL defined but no FDT - please see " -"doc/README.fdt-control" ); - }else +if (fdtdec_prepare_fdt ()) +panic ( +"** CONFIG_OF_CONTROL defined but no FDT - please see doc/README.fdt-control" ); +else printf ("DTB: 0x%x\n" , (u32 )gd->fdt_blob);#endif -puts ("SDRAM :\n" ); -printf ("\t\tIcache:%s\n" ,icache_status () ?"ON" :"OFF" ); -printf ("\t\tDcache:%s\n" ,dcache_status () ?"ON" :"OFF" ); -printf ("\tU-Boot Start:0x%08x\n" ,CONFIG_SYS_TEXT_BASE ); +puts ("SDRAM :\n" ); +printf ("\t\tIcache:%s\n" ,icache_status () ?"ON" :"OFF" ); +printf ("\t\tDcache:%s\n" ,dcache_status () ?"ON" :"OFF" ); +printf ("\tU-Boot Start:0x%08x\n" ,CONFIG_SYS_TEXT_BASE );#if defined(CONFIG_CMD_FLASH ) -puts ("Flash: " ); +puts ("Flash: " ); bd->bi_flashstart =CONFIG_SYS_FLASH_BASE ; flash_size =flash_init ();if (bd->bi_flashstart && flash_size >0 ) {# ifdef CONFIG_SYS_FLASH_CHECKSUM -print_size (flash_size,"" ); +print_size (flash_size,"" );/* * Compute and print flash CRC if flashchecksum is set to 'y' * * NOTE: Maybe we should add some WATCHDOG_RESET()? XXX */ if (getenv_yesno ("flashchecksum" ) ==1 ) { -printf (" CRC: %08X" , -crc32 (0 , (const u8 *)bd->bi_flashstart, - flash_size) +printf (" CRC: %08X" , +crc32 (0 , (const u8 *)bd->bi_flashstart, + flash_size) ); } -putc ('\n' ); +putc ('\n' );# else /* !CONFIG_SYS_FLASH_CHECKSUM */ -print_size (flash_size,"\n" ); +print_size (flash_size,"\n" );# endif /* CONFIG_SYS_FLASH_CHECKSUM */ bd->bi_flashsize = flash_size; bd->bi_flashoffset = bd->bi_flashstart + flash_size; }else { -puts ("Flash init FAILED" ); +puts ("Flash init FAILED" ); bd->bi_flashstart =0 ; bd->bi_flashsize =0 ; bd->bi_flashoffset =0 ;
@@ -163,10 +162,10 @@ void board_init_f(ulong not_used)#endif /* relocate environment function pointers etc. */ -env_relocate (); +env_relocate ();/* Initialize stdio devices */ -stdio_init (); +stdio_init ();/* Initialize the jump table for applications */ jumptable_init ();
@@ -190,13 +189,14 @@ void board_init_f(ulong not_used)/* main_loop */ for (;;) { -WATCHDOG_RESET (); -main_loop (); +WATCHDOG_RESET (); +main_loop (); } } -void hang (void ) +void hang (void ) { -puts ("### ERROR ### Please RESET the board ###\n" ); -for (;;) ; +puts ("### ERROR ### Please RESET the board ###\n" ); +for (;;) + ; }
Signature · 1 line
1.7.10.4
Michal Simek
maintainerPATCH v2 1/5 microblaze: fix style in board.c
Quoted 52 lines · Andreas Bie?mann
Make microblaze's
board.ccheckpatch clean.Signed-off-by Andreas Bie?mann <[email protected]>---
Changes in v2: Nonearch/microblaze/lib/board.c | 64 +++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 32 deletions(-)arch/microblaze/lib/board.c +8
-9@@ -71,15 +71,15 @@ void board_init_f(ulong not_used) {bd_t *bd;init_fnc_t **init_fnc_ptr; - gd = (gd_t *) (CONFIG_SYS_SDRAM_BASE +CONFIG_SYS_GBL_DATA_OFFSET ); - bd = (bd_t *) (CONFIG_SYS_SDRAM_BASE +CONFIG_SYS_GBL_DATA_OFFSET \ + gd = (gd_t *)(CONFIG_SYS_SDRAM_BASE +CONFIG_SYS_GBL_DATA_OFFSET ); + bd = (bd_t *)(CONFIG_SYS_SDRAM_BASE +CONFIG_SYS_GBL_DATA_OFFSET -GENERATED_BD_INFO_SIZE );#if defined(CONFIG_CMD_FLASH )ulong flash_size =0 ;#endif asm ("nop" );/* FIXME gd is not initialize - wait */ -memset ((void *)gd,0 ,GENERATED_GBL_DATA_SIZE ); -memset ((void *)bd,0 ,GENERATED_BD_INFO_SIZE ); +memset ((void *)gd,0 ,GENERATED_GBL_DATA_SIZE ); +memset ((void *)bd,0 ,GENERATED_BD_INFO_SIZE ); gd->bd = bd; gd->baudrate =CONFIG_BAUDRATE ; bd->bi_baudrate =CONFIG_BAUDRATE ;@@ -105,57 +105,56 @@ void board_init_f(ulong not_used)* aka CONFIG_SYS_MONITOR_BASE - Note there is no need for reloc_off * as our monitory code is run from SDRAM */ -mem_malloc_init (CONFIG_SYS_MALLOC_BASE ,CONFIG_SYS_MALLOC_LEN ); +mem_malloc_init (CONFIG_SYS_MALLOC_BASE ,CONFIG_SYS_MALLOC_LEN );serial_initialize ();for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) { -WATCHDOG_RESET (); -if ((*init_fnc_ptr) () !=0 ) { -hang (); - } +WATCHDOG_RESET (); +if ((*init_fnc_ptr) () !=0 ) +hang (); }
arch/microblaze/lib/board.c void board_init_f(ulong not_used) · line 122
Quoted 10 lines
arch/microblaze/lib/board.c +3
-4#ifdef CONFIG_OF_CONTROL /* For now, put this check after the console is ready */ -if (fdtdec_prepare_fdt ()) { -panic ("** CONFIG_OF_CONTROL defined but no FDT - please see " -"doc/README.fdt-control" ); - }else +if (fdtdec_prepare_fdt ()) +panic ( +"** CONFIG_OF_CONTROL defined but no FDT - please see doc/README.fdt-control" );
This is quite weird coding style.
I know that the previous one doesn't pass but this is also weird.
Thanks,
Michal
Signature · 5 lines
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/ Maintainer of Linux kernel - Xilinx Zynq ARM architecture Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform
PATCH v2 1/5 microblaze: fix style in board.c
Dear Michal Simek,
Quoted 18 lines · Michal Simek
Quoted 15 lines · Andreas Bie?mann
Make microblaze's
board.ccheckpatch clean.Signed-off-by Andreas Bie?mann <[email protected]>---
Changes in v2: Nonearch/microblaze/lib/board.c | 64 +++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 32 deletions(-)arch/microblaze/lib/board.c +0
-0@@ -71,15 +71,15 @@ void board_init_f(ulong not_used)
Quoted 12 lines
arch/microblaze/lib/board.c void board_init_f(ulong not_used) · line 122
Quoted 9 lines
arch/microblaze/lib/board.c +3
-4#ifdef CONFIG_OF_CONTROL /* For now, put this check after the console is ready */ -if (fdtdec_prepare_fdt ()) { -panic ("** CONFIG_OF_CONTROL defined but no FDT - please see " -"doc/README.fdt-control" ); - }else +if (fdtdec_prepare_fdt ()) +panic ( +"** CONFIG_OF_CONTROL defined but no FDT - please see doc/README.fdt-control" );This is quite weird coding style.
I know that the previous one doesn't pass but this is also weird.
I tried to not change the content. How about:
| + if (fdtdec_prepare_fdt())
| + panic("** No FDT - please see doc/README.fdt-control");
Best regards
Andreas Bie?mann
Michal Simek
maintainerPATCH v2 1/5 microblaze: fix style in board.c
Quoted 34 lines · Andreas Bie?mann
Dear Michal Simek,
Quoted 18 lines · Michal Simek
Quoted 15 lines · Andreas Bie?mann
Make microblaze's
board.ccheckpatch clean.Signed-off-by Andreas Bie?mann <[email protected]>---
Changes in v2: Nonearch/microblaze/lib/board.c | 64 +++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 32 deletions(-)arch/microblaze/lib/board.c +0
-0@@ -71,15 +71,15 @@ void board_init_f(ulong not_used)Quoted 12 lines
arch/microblaze/lib/board.c void board_init_f(ulong not_used) · line 122
Quoted 9 lines
arch/microblaze/lib/board.c +3
-4#ifdef CONFIG_OF_CONTROL /* For now, put this check after the console is ready */ -if (fdtdec_prepare_fdt ()) { -panic ("** CONFIG_OF_CONTROL defined but no FDT - please see " -"doc/README.fdt-control" ); - }else +if (fdtdec_prepare_fdt ()) +panic ( +"** CONFIG_OF_CONTROL defined but no FDT - please see doc/README.fdt-control" );This is quite weird coding style.
I know that the previous one doesn't pass but this is also weird.
Quoted 3 lines
I tried to not change the content. How about:
| + if (fdtdec_prepare_fdt())
| +panic("** No FDT - please see doc/README.fdt-control");
yep. Much better.
Not sure how you want to handle this patch. If in the series with hang() then write there my
If you want to add to my microblaze custodian tree, please let me know.
I think I had done this some time ago but never push this to mainline.
Thanks,
Michal
Signature · 5 lines
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/ Maintainer of Linux kernel - Xilinx Zynq ARM architecture Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform
PATCH v2 2/5 nios2: fix style in board.c.
In reply to Andreas BießmannMake nios2's board.c checkpatch clean.
---
Changes in v2: None
arch/nios2/lib/board.c | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-)
arch/nios2/lib/board.c +21 -22
@@ -64,7 +64,6 @@ typedef int (init_fnc_t) (void);***********************************************************************/ init_fnc_t *init_sequence[] = { -#if defined(CONFIG_BOARD_EARLY_INIT_F ) board_early_init_f, /* Call board-specific init code early.*/#endif
@@ -83,7 +82,7 @@ init_fnc_t *init_sequence[] = {/***********************************************************************/ -void board_init (void ) +void board_init (void ) {bd_t *bd;init_fnc_t **init_fnc_ptr;
@@ -93,7 +92,7 @@ void board_init (void)/* Pointer is writable since we allocated a register for it. */ gd = &gd_data;/* compiler optimization barrier needed for GCC >= 3.4 */ - __asm__ __volatile__("" : : :"memory" ); + __asm__ __volatile__("" : : :"memory" ); gd->bd = &bd_data; gd->baudrate =CONFIG_BAUDRATE ;
@@ -106,25 +105,24 @@ void board_init (void) bd->bi_flashstart =CONFIG_SYS_FLASH_BASE ;#endif #if defined(CONFIG_SYS_SRAM_BASE ) && defined(CONFIG_SYS_SRAM_SIZE ) - bd->bi_sramstart=CONFIG_SYS_SRAM_BASE ; + bd->bi_sramstart =CONFIG_SYS_SRAM_BASE ; bd->bi_sramsize =CONFIG_SYS_SRAM_SIZE ;#endif bd->bi_baudrate =CONFIG_BAUDRATE ;for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) { -WATCHDOG_RESET (); -if ((*init_fnc_ptr) () !=0 ) { -hang (); - } +WATCHDOG_RESET (); +if ((*init_fnc_ptr) () !=0 ) +hang (); } -WATCHDOG_RESET (); +WATCHDOG_RESET ();/* The Malloc area is immediately below the monitor copy in RAM */ mem_malloc_init (CONFIG_SYS_MALLOC_BASE ,CONFIG_SYS_MALLOC_LEN );#ifndef CONFIG_SYS_NO_FLASH -WATCHDOG_RESET (); +WATCHDOG_RESET (); bd->bi_flashsize =flash_init ();#endif
@@ -138,39 +136,40 @@ void board_init (void)mmc_initialize (bd);#endif -WATCHDOG_RESET (); +WATCHDOG_RESET ();env_relocate (); -WATCHDOG_RESET (); +WATCHDOG_RESET ();stdio_init ();jumptable_init ();console_init_r (); -WATCHDOG_RESET (); -interrupt_init (); +WATCHDOG_RESET (); +interrupt_init ();#if defined(CONFIG_BOARD_LATE_INIT ) -board_late_init (); +board_late_init ();#endif #if defined(CONFIG_CMD_NET ) -puts ("Net: " ); -eth_initialize (bd); +puts ("Net: " ); +eth_initialize (bd);#endif /* main_loop */ for (;;) { -WATCHDOG_RESET (); -main_loop (); +WATCHDOG_RESET (); +main_loop (); } }/***********************************************************************/ -void hang (void ) +void hang (void ) { -disable_interrupts (); +disable_interrupts ();puts ("### ERROR ### Please reset board ###\n" ); -for (;;); +for (;;) + ; }
Signature · 1 line
1.7.10.4
PATCH v2 3/5 mx31pdk: add CONFIG_SPL_LIBGENERIC_SUPPORT
In reply to Andreas BießmannIn order to use the generic hang() later on pull libgeneric in SPL. This has no impact on the SPL size.
---
Changes in v2: None
include/configs/mx31pdk.h | 1 + 1 file changed, 1 insertion(+)
include/configs/mx31pdk.h +1 -0
@@ -50,6 +50,7 @@#define CONFIG_SPL_LDSCRIPT "arch/$(ARCH)/cpu/u-boot-spl.lds"#define CONFIG_SPL_MAX_SIZE 2048#define CONFIG_SPL_NAND_SUPPORT +#define CONFIG_SPL_LIBGENERIC_SUPPORT #define CONFIG_SPL_TEXT_BASE 0x87dc0000#define CONFIG_SYS_TEXT_BASE 0x87e00000
Signature · 1 line
1.7.10.4
PATCH v2 4/5 tx25: add CONFIG_SPL_LIBGENERIC_SUPPORT
In reply to Andreas BießmannIn order to use the generic hang() later on pull libgeneric in SPL. This has no impact on the SPL size.
---
Changes in v2: None
include/configs/tx25.h | 1 + 1 file changed, 1 insertion(+)
include/configs/tx25.h +1 -0
@@ -37,6 +37,7 @@#define CONFIG_SPL_LDSCRIPT "arch/$(ARCH)/cpu/u-boot-spl.lds"#define CONFIG_SPL_MAX_SIZE 2048#define CONFIG_SPL_NAND_SUPPORT +#define CONFIG_SPL_LIBGENERIC_SUPPORT #define CONFIG_SPL_TEXT_BASE 0x810c0000#define CONFIG_SYS_TEXT_BASE 0x81200000
Signature · 1 line
1.7.10.4
PATCH v2 5/5 lib: consolidate hang()
In reply to Andreas BießmannDelete all occurrences of hang() and provide a generic function.
---
Changes in v2:
* delete all hang() and provide generic lib/hang.c
arch/arm/cpu/arm926ejs/mxs/spl_boot.c | 8 +----- arch/arm/cpu/arm926ejs/spear/spl.c | 7 ----- arch/arm/lib/board.c | 7 +---- arch/avr32/lib/board.c | 6 +---- arch/blackfin/lib/board.c | 15 +---------- arch/m68k/lib/board.c | 7 ----- arch/microblaze/lib/board.c | 7 ----- arch/mips/lib/board.c | 8 +----- arch/nds32/lib/board.c | 8 +----- arch/nios2/lib/board.c | 12 +-------- arch/openrisc/lib/board.c | 13 +-------- arch/powerpc/lib/board.c | 10 +------ arch/sandbox/lib/board.c | 8 +----- arch/sh/lib/board.c | 10 +------ arch/sparc/lib/board.c | 10 +------ arch/x86/lib/board.c | 8 +----- common/board_f.c | 6 ----- common/spl/spl.c | 7 ----- drivers/mtd/nand/mxc_nand_spl.c | 10 +------ lib/Makefile | 1 + lib/hang.c | 47 +++++++++++++++++++++++++++++++++ 21 files changed, 62 insertions(+), 153 deletions(-) create mode 100644 lib/hang.c
arch/arm/cpu/arm926ejs/mxs/spl_boot.c +1 -7
@@ -25,6 +25,7 @@#include <common.h> #include <config.h> +#include <linux/compiler.h> #include <asm/io.h> #include <asm/arch/imx-regs.h> #include <asm/arch/sys_proto.h>
@@ -148,10 +149,3 @@ inline void board_init_r(gd_t *id, ulong dest_addr)for (;;) ; } - -void hang (void ) __attribute__ ((noreturn)); -void hang (void ) -{ -for (;;) - ; -}
arch/arm/cpu/arm926ejs/spear/spl.c +0 -7
@@ -31,13 +31,6 @@#include <asm/arch/spr_misc.h> #include <asm/arch/spr_syscntl.h> -inline void hang (void ) -{ -serial_puts ("### ERROR ### Please RESET the board ###\n" ); -for (;;) - ; -} -static void ddr_clock_init (void ) {struct misc_regs *misc_p = (struct misc_regs *)CONFIG_SPEAR_MISCBASE ;
arch/arm/lib/board.c +1 -6
@@ -53,6 +53,7 @@#include <fdtdec.h> #include <post.h> #include <logbuff.h> +#include <linux/compiler.h> #include <asm/sections.h> #ifdef CONFIG_BITBANGMII
@@ -706,9 +707,3 @@ void board_init_r(gd_t *id, ulong dest_addr)/* NOTREACHED - no way out of command loop except booting */ } - -void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -for (;;); -}
arch/avr32/lib/board.c +1 -5
@@ -26,6 +26,7 @@#include <version.h> #include <net.h> #include <atmel_mci.h> +#include <linux/compiler.h> #ifdef CONFIG_BITBANGMII #include <miiphy.h>
@@ -120,11 +121,6 @@ static int display_banner (void)return 0 ; } -void hang (void ) -{ -for (;;) ; -} -static int display_dram_config (void ) {int i;
arch/blackfin/lib/board.c +1 -14
@@ -19,6 +19,7 @@#include <net.h> #include <status_led.h> #include <version.h> +#include <linux/compiler.h> #include <asm/cplb.h> #include <asm/mach-common/bits/mpu.h>
@@ -432,17 +433,3 @@ void board_init_r(gd_t * id, ulong dest_addr)for (;;)main_loop (); } - -void hang (void ) -{ -#ifdef CONFIG_STATUS_LED -status_led_set (STATUS_LED_BOOT ,STATUS_LED_OFF ); -status_led_set (STATUS_LED_CRASH ,STATUS_LED_BLINKING ); -#endif -puts ("### ERROR ### Please RESET the board ###\n" ); -while (1 ) -/* If a JTAG emulator is hooked up, we'll automatically trigger -* a breakpoint in it. If one isn't, this is just a NOP. -*/ - asm("emuexcpt;" ); -}
arch/m68k/lib/board.c +0 -7
@@ -663,10 +663,3 @@ void board_init_r (gd_t *id, ulong dest_addr)/* NOTREACHED - no way out of command loop except booting */ } - - -void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -for (;;); -}
arch/microblaze/lib/board.c +0 -7
@@ -193,10 +193,3 @@ void board_init_f(ulong not_used)main_loop (); } } - -void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -for (;;) - ; -}
arch/mips/lib/board.c +1 -7
@@ -32,6 +32,7 @@#include <nand.h> #include <onenand_uboot.h> #include <spi.h> +#include <linux/_compiler.h> #ifdef CONFIG_BITBANGMII #include <miiphy.h>
@@ -344,10 +345,3 @@ void board_init_r(gd_t *id, ulong dest_addr)/* NOTREACHED - no way out of command loop except booting */ } - -void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -for (;;) - ; -}
arch/nds32/lib/board.c +1 -7
@@ -36,6 +36,7 @@#include <nand.h> #include <onenand_uboot.h> #include <mmc.h> +#include <linux/compiler.h> DECLARE_GLOBAL_DATA_PTR ;
@@ -404,10 +405,3 @@ void board_init_r(gd_t *id, ulong dest_addr)/* NOTREACHED - no way out of command loop except booting */ } - -void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -for (;;) - ; -}
arch/nios2/lib/board.c +1 -11
@@ -30,6 +30,7 @@#include <malloc.h> #include <mmc.h> #include <net.h> +#include <linux/compiler.h> #ifdef CONFIG_STATUS_LED #include <status_led.h> #endif
@@ -162,14 +163,3 @@ void board_init(void)main_loop (); } } - - -/***********************************************************************/ - -void hang (void ) -{ -disable_interrupts (); -puts ("### ERROR ### Please reset board ###\n" ); -for (;;) - ; -}
arch/openrisc/lib/board.c +1 -12
@@ -34,6 +34,7 @@#include <malloc.h> #include <mmc.h> #include <net.h> +#include <linux/compiler.h> #ifdef CONFIG_STATUS_LED #include <status_led.h> #endif
@@ -154,15 +155,3 @@ void board_init(void)main_loop (); } } - - -/***********************************************************************/ - -void hang (void ) -{ -disable_interrupts (); -puts ("### ERROR ### Please reset board ###\n" ); - -for (;;) - ; -}
arch/powerpc/lib/board.c +1 -9
@@ -26,6 +26,7 @@#include <command.h> #include <malloc.h> #include <stdio_dev.h> +#include <linux/compiler.h> #ifdef CONFIG_8xx#include <mpc8xx.h> #endif
@@ -1050,15 +1051,6 @@ void board_init_r(gd_t *id, ulong dest_addr)/* NOTREACHED - no way out of command loop except booting */ } -void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -bootstage_error (BOOTSTAGE_ID_NEED_RESET ); -for (;;) - ; -} - -#if 0 /* We could use plain global data, but the resulting code is bigger */ /* * Pointer to initial global data area
arch/sandbox/lib/board.c +1 -7
@@ -44,6 +44,7 @@#include <timestamp.h> #include <version.h> #include <serial.h> +#include <linux/compiler.h> #include <os.h>
@@ -276,10 +277,3 @@ void board_init_r(gd_t *id, ulong dest_addr)/* NOTREACHED - no way out of command loop except booting */ } - -void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -for (;;) - ; -}
arch/sh/lib/board.c +1 -9
@@ -27,6 +27,7 @@#include <net.h> #include <mmc.h> #include <environment.h> +#include <linux/compiler.h> #ifdef CONFIG_BITBANGMII #include <miiphy.h>
@@ -200,12 +201,3 @@ void sh_generic_init(void)main_loop (); } } - -/***********************************************************************/ - -void hang (void ) -{ -puts ("Board ERROR\n" ); -for (;;) - ; -}
arch/sparc/lib/board.c +1 -9
@@ -30,6 +30,7 @@#include <malloc.h> #include <stdio_dev.h> #include <config.h> +#include <linux/compiler.h> #if defined(CONFIG_CMD_IDE )#include <ide.h> #endif
@@ -411,13 +412,4 @@ void board_init_f(ulong bootflag) } -void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -#ifdef CONFIG_SHOW_BOOT_PROGRESS -bootstage_error (BOOTSTAGE_ID_NEED_RESET ); -#endif -for (;;) ; -} -/************************************************************************/
arch/x86/lib/board.c +1 -7
@@ -35,6 +35,7 @@#include <fdtdec.h> #include <watchdog.h> #include <stdio_dev.h> +#include <linux/compiler.h> #include <asm/u-boot-x86.h> #include <asm/relocate.h> #include <asm/processor.h>
@@ -264,10 +265,3 @@ void board_init_r(gd_t *id, ulong dest_addr)/* NOTREACHED - no way out of command loop except booting */ } - -void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -for (;;) - ; -}
common/board_f.c +0 -6
@@ -1003,9 +1003,3 @@ void board_init_f_r(void) hang(); }#endif /* CONFIG_X86 */ - -void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -for (;;); -}
common/spl/spl.c +0 -7
@@ -48,13 +48,6 @@ struct spl_image_info spl_image;/* Define board data structure */ static bd_t bdata __attribute__ ((section(".data"))); -inline void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -for (;;) - ; -} -/* * Default function to determine if u-boot or the OS should * be started. This implementation always returns 1.
drivers/mtd/nand/mxc_nand_spl.c +1 -9
@@ -26,6 +26,7 @@#include <common.h> #include <nand.h> +#include <linux/compiler.h> #include <asm/arch/imx-regs.h> #include <asm/io.h> #include "mxc_nand.h"
@@ -355,12 +356,3 @@ void nand_boot(void)hang (); } } - -/* -* Called in case of an exception. -*/ -void hang (void ) -{ -/* Loop forever */ -while (1 ) ; -}
lib/Makefile +1 -0
@@ -71,6 +71,7 @@ COBJS-$(CONFIG_BCH) += bch.o COBJS-y += crc32.o COBJS-y += ctype.o COBJS-y += div64.o +COBJS-y += hang.o COBJS-y += linux_string.o COBJS-y += string.o COBJS-y += time.o
lib/hang.c new file +47 -0
47 lines not on this page · raw message
Signature · 1 line
1.7.10.4
PATCH v2 5/5 lib: consolidate hang()
Hi Andreas,
Quoted 515 lines · Andreas Bie?mann
Delete all occurrences of
hang()and provide a generic function.Signed-off-by Andreas Bie?mann <[email protected]>---
Changes in v2:
* delete allhang()and provide genericlib/hang.carch/arm/cpu/arm926ejs/mxs/spl_boot.c | 8 +----- arch/arm/cpu/arm926ejs/spear/spl.c | 7 ----- arch/arm/lib/board.c | 7 +---- arch/avr32/lib/board.c | 6 +---- arch/blackfin/lib/board.c | 15 +---------- arch/m68k/lib/board.c | 7 ----- arch/microblaze/lib/board.c | 7 ----- arch/mips/lib/board.c | 8 +----- arch/nds32/lib/board.c | 8 +----- arch/nios2/lib/board.c | 12 +-------- arch/openrisc/lib/board.c | 13 +-------- arch/powerpc/lib/board.c | 10 +------ arch/sandbox/lib/board.c | 8 +----- arch/sh/lib/board.c | 10 +------ arch/sparc/lib/board.c | 10 +------ arch/x86/lib/board.c | 8 +----- common/board_f.c | 6 ----- common/spl/spl.c | 7 ----- drivers/mtd/nand/mxc_nand_spl.c | 10 +------ lib/Makefile | 1 + lib/hang.c | 47 +++++++++++++++++++++++++++++++++ 21 files changed, 62 insertions(+), 153 deletions(-) create mode 100644 lib/hang.carch/arm/cpu/arm926ejs/mxs/spl_boot.c +1
-7@@ -25,6 +25,7 @@#include <common.h> #include <config.h> +#include <linux/compiler.h> #include <asm/io.h> #include <asm/arch/imx-regs.h> #include <asm/arch/sys_proto.h> @@ -148,10 +149,3 @@ inline void board_init_r(gd_t *id, ulong dest_addr)for (;;) ; } - -void hang (void ) __attribute__ ((noreturn)); -void hang (void ) -{ -for (;;) - ; -}arch/arm/cpu/arm926ejs/spear/spl.c +0
-7@@ -31,13 +31,6 @@#include <asm/arch/spr_misc.h> #include <asm/arch/spr_syscntl.h> -inline void hang (void ) -{ -serial_puts ("### ERROR ### Please RESET the board ###\n" ); -for (;;) - ; -} -static void ddr_clock_init (void ) {struct misc_regs *misc_p = (struct misc_regs *)CONFIG_SPEAR_MISCBASE ;arch/arm/lib/board.c +1
-6@@ -53,6 +53,7 @@#include <fdtdec.h> #include <post.h> #include <logbuff.h> +#include <linux/compiler.h> #include <asm/sections.h> #ifdef CONFIG_BITBANGMII @@ -706,9 +707,3 @@ void board_init_r(gd_t *id, ulong dest_addr)/* NOTREACHED - no way out of command loop except booting */ } - -void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -for (;;); -}arch/avr32/lib/board.c +1
-5@@ -26,6 +26,7 @@#include <version.h> #include <net.h> #include <atmel_mci.h> +#include <linux/compiler.h> #ifdef CONFIG_BITBANGMII #include <miiphy.h> @@ -120,11 +121,6 @@ static int display_banner (void)return 0 ; } -void hang (void ) -{ -for (;;) ; -} -static int display_dram_config (void ) {int i;arch/blackfin/lib/board.c +1
-14@@ -19,6 +19,7 @@#include <net.h> #include <status_led.h> #include <version.h> +#include <linux/compiler.h> #include <asm/cplb.h> #include <asm/mach-common/bits/mpu.h> @@ -432,17 +433,3 @@ void board_init_r(gd_t * id, ulong dest_addr)for (;;)main_loop (); } - -void hang (void ) -{ -#ifdef CONFIG_STATUS_LED -status_led_set (STATUS_LED_BOOT ,STATUS_LED_OFF ); -status_led_set (STATUS_LED_CRASH ,STATUS_LED_BLINKING ); -#endif -puts ("### ERROR ### Please RESET the board ###\n" ); -while (1 ) -/* If a JTAG emulator is hooked up, we'll automatically trigger -* a breakpoint in it. If one isn't, this is just a NOP. -*/ - asm("emuexcpt;" ); -}arch/m68k/lib/board.c +0
-7@@ -663,10 +663,3 @@ void board_init_r (gd_t *id, ulong dest_addr)/* NOTREACHED - no way out of command loop except booting */ } - - -void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -for (;;); -}arch/microblaze/lib/board.c +0
-7@@ -193,10 +193,3 @@ void board_init_f(ulong not_used)main_loop (); } } - -void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -for (;;) - ; -}arch/mips/lib/board.c +1
-7@@ -32,6 +32,7 @@#include <nand.h> #include <onenand_uboot.h> #include <spi.h> +#include <linux/_compiler.h> #ifdef CONFIG_BITBANGMII #include <miiphy.h> @@ -344,10 +345,3 @@ void board_init_r(gd_t *id, ulong dest_addr)/* NOTREACHED - no way out of command loop except booting */ } - -void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -for (;;) - ; -}arch/nds32/lib/board.c +1
-7@@ -36,6 +36,7 @@#include <nand.h> #include <onenand_uboot.h> #include <mmc.h> +#include <linux/compiler.h> DECLARE_GLOBAL_DATA_PTR ;@@ -404,10 +405,3 @@ void board_init_r(gd_t *id, ulong dest_addr)/* NOTREACHED - no way out of command loop except booting */ } - -void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -for (;;) - ; -}arch/nios2/lib/board.c +1
-11@@ -30,6 +30,7 @@#include <malloc.h> #include <mmc.h> #include <net.h> +#include <linux/compiler.h> #ifdef CONFIG_STATUS_LED #include <status_led.h> #endif @@ -162,14 +163,3 @@ void board_init(void)main_loop (); } } - - -/***********************************************************************/ - -void hang (void ) -{ -disable_interrupts (); -puts ("### ERROR ### Please reset board ###\n" ); -for (;;) - ; -}arch/openrisc/lib/board.c +1
-12@@ -34,6 +34,7 @@#include <malloc.h> #include <mmc.h> #include <net.h> +#include <linux/compiler.h> #ifdef CONFIG_STATUS_LED #include <status_led.h> #endif @@ -154,15 +155,3 @@ void board_init(void)main_loop (); } } - - -/***********************************************************************/ - -void hang (void ) -{ -disable_interrupts (); -puts ("### ERROR ### Please reset board ###\n" ); - -for (;;) - ; -}arch/powerpc/lib/board.c +1
-9@@ -26,6 +26,7 @@#include <command.h> #include <malloc.h> #include <stdio_dev.h> +#include <linux/compiler.h> #ifdef CONFIG_8xx#include <mpc8xx.h> #endif @@ -1050,15 +1051,6 @@ void board_init_r(gd_t *id, ulong dest_addr)/* NOTREACHED - no way out of command loop except booting */ } -void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -bootstage_error (BOOTSTAGE_ID_NEED_RESET ); -for (;;) - ; -} - -#if 0 /* We could use plain global data, but the resulting code is bigger */ /* * Pointer to initial global data area arch/sandbox/lib/board.c +1
-7@@ -44,6 +44,7 @@#include <timestamp.h> #include <version.h> #include <serial.h> +#include <linux/compiler.h> #include <os.h> @@ -276,10 +277,3 @@ void board_init_r(gd_t *id, ulong dest_addr)/* NOTREACHED - no way out of command loop except booting */ } - -void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -for (;;) - ; -}arch/sh/lib/board.c +1
-9@@ -27,6 +27,7 @@#include <net.h> #include <mmc.h> #include <environment.h> +#include <linux/compiler.h> #ifdef CONFIG_BITBANGMII #include <miiphy.h> @@ -200,12 +201,3 @@ void sh_generic_init(void)main_loop (); } } - -/***********************************************************************/ - -void hang (void ) -{ -puts ("Board ERROR\n" ); -for (;;) - ; -}arch/sparc/lib/board.c +1
-9@@ -30,6 +30,7 @@#include <malloc.h> #include <stdio_dev.h> #include <config.h> +#include <linux/compiler.h> #if defined(CONFIG_CMD_IDE )#include <ide.h> #endif @@ -411,13 +412,4 @@ void board_init_f(ulong bootflag) } -void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -#ifdef CONFIG_SHOW_BOOT_PROGRESS -bootstage_error (BOOTSTAGE_ID_NEED_RESET ); -#endif -for (;;) ; -} -/************************************************************************/ arch/x86/lib/board.c +1
-7@@ -35,6 +35,7 @@#include <fdtdec.h> #include <watchdog.h> #include <stdio_dev.h> +#include <linux/compiler.h> #include <asm/u-boot-x86.h> #include <asm/relocate.h> #include <asm/processor.h> @@ -264,10 +265,3 @@ void board_init_r(gd_t *id, ulong dest_addr)/* NOTREACHED - no way out of command loop except booting */ } - -void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -for (;;) - ; -}common/board_f.c +0
-6@@ -1003,9 +1003,3 @@ void board_init_f_r(void) hang(); }#endif /* CONFIG_X86 */ - -void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -for (;;); -}common/spl/spl.c +0
-7@@ -48,13 +48,6 @@ struct spl_image_info spl_image;/* Define board data structure */ static bd_t bdata __attribute__ ((section(".data"))); -inline void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -for (;;) - ; -} -/* * Default function to determine if u-boot or the OS should * be started. This implementation always returns 1. drivers/mtd/nand/mxc_nand_spl.c +1
-9@@ -26,6 +26,7 @@#include <common.h> #include <nand.h> +#include <linux/compiler.h> #include <asm/arch/imx-regs.h> #include <asm/io.h> #include "mxc_nand.h" @@ -355,12 +356,3 @@ void nand_boot(void)hang (); } } - -/* -* Called in case of an exception. -*/ -void hang (void ) -{ -/* Loop forever */ -while (1 ) ; -}lib/Makefile +1
-0@@ -71,6 +71,7 @@ COBJS-$(CONFIG_BCH) += bch.o COBJS-y += crc32.o COBJS-y += ctype.o COBJS-y += div64.o +COBJS-y += hang.o COBJS-y += linux_string.o COBJS-y += string.o COBJS-y += time.olib/hang.c new file +31
-0@@ -0,0 +1,47 @@ +/* +* (C) Copyright 2013 +* Andreas Bie?mann <[email protected]> +* +* This file consolidates all the different hang() functions implemented in +* u-boot. +* +* See file CREDITS for list of people who contributed to this +* project. +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, +* MA 02111-1307 USA +*/ + +#include <common.h> +#include <bootstage.h> + +/** +* hang - stop processing by staying in an endless loop
lib/hang.c line 41
Quoted 10 lines
lib/hang.c new file +10
-0+* +* The purpose of this function is to stop further execution of code cause +* something went completely wrong. To catch this and give some feedback to +* the user the one needs to catch the bootstage_error (see +* show_boot_progress()) in the board code. +*/ +void hang (void ) +{ +#if !defined(CONFIG_SPL_BUILD ) || \ + (defined(CONFIG_SPL_BUID ) && defined(CONFIG_SPL_LIBCOMMON_SUPPORT ))
This can be simplified as:
+#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
Quoted 8 lines
lib/hang.c new file +6
-1+puts ("### ERROR ### Please RESET the board ###\n" ); +#endif +bootstage_error (BOOTSTAGE_ID_NEED_RESET ); +for (;;) + ; +} --1.7.10.4
Apart from that, this series looks good.
Best regards,
Beno?t
v2 cover consolidate hang()
In reply to Andreas BießmannDear Andreas,
Quoted 7 lines · In message <[email protected]>…
Andreas Bie?mann (5):
microblaze: fix style inboard.c
nios2: fix style inboard.c.
mx31pdk: addCONFIG_SPL_LIBGENERIC_SUPPORT
tx25: addCONFIG_SPL_LIBGENERIC_SUPPORT
lib: consolidatehang()
Compile-tested for Power architecture. No new warnings / errors found.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I have the simplest tastes. I am always satisfied with the best.
-- Oscar Wildev3 cover consolidate hang()
In reply to Andreas BießmannThis series started with intention to make a hung board visualize the (end-)user that it does hang(). The first approach was to make all the different hang() functions weak and provide board specific versions to implement the 'visualization' there.
After some discussion it turned out, that there is still an interface to visualize such states to the user: the 'bootstage' stuff.
BTW:
This is my first try sending a series with patman. All I can say is:
patman is really cool ;)
The 'microblaze: fix style in board.c' is an leftover from the first approach.
The 'nios2: fix style in board.c' is an leftover from the first approach.
The 'lib: consolidate hang()' is build tested on arm and avr32. It may produces errors on other arches like ppc cause the previous SPL inlined hang() function was also removed. We need to discuss if we always pull in the libgeneric unconditional into SPL or provide a second hang() for those boards which do not link against libgeneric in SPL.
Since v2 got a complete (compile-)test on powerpc by Wolfgang I think we can stick with the current solution. v3 includes some minor changes mentioned in the changelog of respective patches.
Changes in v3:
* shorten error string for 'no FDT'
* remove unnecessarily added linux/compiler.h
* fix typo in new hang() docu
* use simplified macro for SPL_LIBCOMMON_SUPPORT as suggested by Beno?t
Changes in v2:
* delete all hang() and provide generic lib/hang.c
Andreas Bie?mann (5):
microblaze: fix style in board.c
nios2: fix style in board.c.
mx31pdk: add CONFIG_SPL_LIBGENERIC_SUPPORT
tx25: add CONFIG_SPL_LIBGENERIC_SUPPORT
lib: consolidate hang()
arch/arm/cpu/arm926ejs/mxs/spl_boot.c | 7 ---- arch/arm/cpu/arm926ejs/spear/spl.c | 7 ---- arch/arm/lib/board.c | 6 ---- arch/avr32/lib/board.c | 5 --- arch/blackfin/lib/board.c | 14 -------- arch/m68k/lib/board.c | 7 ---- arch/microblaze/lib/board.c | 62 ++++++++++++++------------------- arch/mips/lib/board.c | 7 ---- arch/nds32/lib/board.c | 7 ---- arch/nios2/lib/board.c | 46 +++++++++--------------- arch/openrisc/lib/board.c | 12 ------- arch/powerpc/lib/board.c | 9 ----- arch/sandbox/lib/board.c | 7 ---- arch/sh/lib/board.c | 9 ----- arch/sparc/lib/board.c | 9 ----- arch/x86/lib/board.c | 7 ---- common/board_f.c | 6 ---- common/spl/spl.c | 7 ---- drivers/mtd/nand/mxc_nand_spl.c | 9 ----- include/configs/mx31pdk.h | 1 + include/configs/tx25.h | 1 + lib/Makefile | 1 + lib/hang.c | 46 ++++++++++++++++++++++++ 23 files changed, 93 insertions(+), 199 deletions(-) create mode 100644 lib/hang.c
Signature · 1 line
1.7.10.4
PATCH v3 1/5 microblaze: fix style in board.c
Make microblaze's board.c checkpatch clean.
---
Changes in v3:
* shorten error string for 'no FDT'
Changes in v2: None
arch/microblaze/lib/board.c | 63 +++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 32 deletions(-)
arch/microblaze/lib/board.c +31 -32
@@ -71,15 +71,15 @@ void board_init_f(ulong not_used) {bd_t *bd;init_fnc_t **init_fnc_ptr; - gd = (gd_t *) (CONFIG_SYS_SDRAM_BASE +CONFIG_SYS_GBL_DATA_OFFSET ); - bd = (bd_t *) (CONFIG_SYS_SDRAM_BASE +CONFIG_SYS_GBL_DATA_OFFSET \ + gd = (gd_t *)(CONFIG_SYS_SDRAM_BASE +CONFIG_SYS_GBL_DATA_OFFSET ); + bd = (bd_t *)(CONFIG_SYS_SDRAM_BASE +CONFIG_SYS_GBL_DATA_OFFSET -GENERATED_BD_INFO_SIZE );#if defined(CONFIG_CMD_FLASH )ulong flash_size =0 ;#endif asm ("nop" );/* FIXME gd is not initialize - wait */ -memset ((void *)gd,0 ,GENERATED_GBL_DATA_SIZE ); -memset ((void *)bd,0 ,GENERATED_BD_INFO_SIZE ); +memset ((void *)gd,0 ,GENERATED_GBL_DATA_SIZE ); +memset ((void *)bd,0 ,GENERATED_BD_INFO_SIZE ); gd->bd = bd; gd->baudrate =CONFIG_BAUDRATE ; bd->bi_baudrate =CONFIG_BAUDRATE ;
@@ -105,57 +105,55 @@ void board_init_f(ulong not_used)* aka CONFIG_SYS_MONITOR_BASE - Note there is no need for reloc_off * as our monitory code is run from SDRAM */ -mem_malloc_init (CONFIG_SYS_MALLOC_BASE ,CONFIG_SYS_MALLOC_LEN ); +mem_malloc_init (CONFIG_SYS_MALLOC_BASE ,CONFIG_SYS_MALLOC_LEN );serial_initialize ();for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) { -WATCHDOG_RESET (); -if ((*init_fnc_ptr) () !=0 ) { -hang (); - } +WATCHDOG_RESET (); +if ((*init_fnc_ptr) () !=0 ) +hang (); }#ifdef CONFIG_OF_CONTROL /* For now, put this check after the console is ready */ -if (fdtdec_prepare_fdt ()) { -panic ("** CONFIG_OF_CONTROL defined but no FDT - please see " -"doc/README.fdt-control" ); - }else +if (fdtdec_prepare_fdt ()) +panic ("** No FDT - please see doc/README.fdt-control" ); +else printf ("DTB: 0x%x\n" , (u32 )gd->fdt_blob);#endif -puts ("SDRAM :\n" ); -printf ("\t\tIcache:%s\n" ,icache_status () ?"ON" :"OFF" ); -printf ("\t\tDcache:%s\n" ,dcache_status () ?"ON" :"OFF" ); -printf ("\tU-Boot Start:0x%08x\n" ,CONFIG_SYS_TEXT_BASE ); +puts ("SDRAM :\n" ); +printf ("\t\tIcache:%s\n" ,icache_status () ?"ON" :"OFF" ); +printf ("\t\tDcache:%s\n" ,dcache_status () ?"ON" :"OFF" ); +printf ("\tU-Boot Start:0x%08x\n" ,CONFIG_SYS_TEXT_BASE );#if defined(CONFIG_CMD_FLASH ) -puts ("Flash: " ); +puts ("Flash: " ); bd->bi_flashstart =CONFIG_SYS_FLASH_BASE ; flash_size =flash_init ();if (bd->bi_flashstart && flash_size >0 ) {# ifdef CONFIG_SYS_FLASH_CHECKSUM -print_size (flash_size,"" ); +print_size (flash_size,"" );/* * Compute and print flash CRC if flashchecksum is set to 'y' * * NOTE: Maybe we should add some WATCHDOG_RESET()? XXX */ if (getenv_yesno ("flashchecksum" ) ==1 ) { -printf (" CRC: %08X" , -crc32 (0 , (const u8 *)bd->bi_flashstart, - flash_size) +printf (" CRC: %08X" , +crc32 (0 , (const u8 *)bd->bi_flashstart, + flash_size) ); } -putc ('\n' ); +putc ('\n' );# else /* !CONFIG_SYS_FLASH_CHECKSUM */ -print_size (flash_size,"\n" ); +print_size (flash_size,"\n" );# endif /* CONFIG_SYS_FLASH_CHECKSUM */ bd->bi_flashsize = flash_size; bd->bi_flashoffset = bd->bi_flashstart + flash_size; }else { -puts ("Flash init FAILED" ); +puts ("Flash init FAILED" ); bd->bi_flashstart =0 ; bd->bi_flashsize =0 ; bd->bi_flashoffset =0 ;
@@ -163,10 +161,10 @@ void board_init_f(ulong not_used)#endif /* relocate environment function pointers etc. */ -env_relocate (); +env_relocate ();/* Initialize stdio devices */ -stdio_init (); +stdio_init ();/* Initialize the jump table for applications */ jumptable_init ();
@@ -190,13 +188,14 @@ void board_init_f(ulong not_used)/* main_loop */ for (;;) { -WATCHDOG_RESET (); -main_loop (); +WATCHDOG_RESET (); +main_loop (); } } -void hang (void ) +void hang (void ) { -puts ("### ERROR ### Please RESET the board ###\n" ); -for (;;) ; +puts ("### ERROR ### Please RESET the board ###\n" ); +for (;;) + ; }
Signature · 1 line
1.7.10.4
PATCH v3 2/5 nios2: fix style in board.c.
In reply to Andreas BießmannMake nios2's board.c checkpatch clean.
---
Changes in v3: None
Changes in v2: None
arch/nios2/lib/board.c | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-)
arch/nios2/lib/board.c +21 -22
@@ -64,7 +64,6 @@ typedef int (init_fnc_t) (void);***********************************************************************/ init_fnc_t *init_sequence[] = { -#if defined(CONFIG_BOARD_EARLY_INIT_F ) board_early_init_f, /* Call board-specific init code early.*/#endif
@@ -83,7 +82,7 @@ init_fnc_t *init_sequence[] = {/***********************************************************************/ -void board_init (void ) +void board_init (void ) {bd_t *bd;init_fnc_t **init_fnc_ptr;
@@ -93,7 +92,7 @@ void board_init (void)/* Pointer is writable since we allocated a register for it. */ gd = &gd_data;/* compiler optimization barrier needed for GCC >= 3.4 */ - __asm__ __volatile__("" : : :"memory" ); + __asm__ __volatile__("" : : :"memory" ); gd->bd = &bd_data; gd->baudrate =CONFIG_BAUDRATE ;
@@ -106,25 +105,24 @@ void board_init (void) bd->bi_flashstart =CONFIG_SYS_FLASH_BASE ;#endif #if defined(CONFIG_SYS_SRAM_BASE ) && defined(CONFIG_SYS_SRAM_SIZE ) - bd->bi_sramstart=CONFIG_SYS_SRAM_BASE ; + bd->bi_sramstart =CONFIG_SYS_SRAM_BASE ; bd->bi_sramsize =CONFIG_SYS_SRAM_SIZE ;#endif bd->bi_baudrate =CONFIG_BAUDRATE ;for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) { -WATCHDOG_RESET (); -if ((*init_fnc_ptr) () !=0 ) { -hang (); - } +WATCHDOG_RESET (); +if ((*init_fnc_ptr) () !=0 ) +hang (); } -WATCHDOG_RESET (); +WATCHDOG_RESET ();/* The Malloc area is immediately below the monitor copy in RAM */ mem_malloc_init (CONFIG_SYS_MALLOC_BASE ,CONFIG_SYS_MALLOC_LEN );#ifndef CONFIG_SYS_NO_FLASH -WATCHDOG_RESET (); +WATCHDOG_RESET (); bd->bi_flashsize =flash_init ();#endif
@@ -138,39 +136,40 @@ void board_init (void)mmc_initialize (bd);#endif -WATCHDOG_RESET (); +WATCHDOG_RESET ();env_relocate (); -WATCHDOG_RESET (); +WATCHDOG_RESET ();stdio_init ();jumptable_init ();console_init_r (); -WATCHDOG_RESET (); -interrupt_init (); +WATCHDOG_RESET (); +interrupt_init ();#if defined(CONFIG_BOARD_LATE_INIT ) -board_late_init (); +board_late_init ();#endif #if defined(CONFIG_CMD_NET ) -puts ("Net: " ); -eth_initialize (bd); +puts ("Net: " ); +eth_initialize (bd);#endif /* main_loop */ for (;;) { -WATCHDOG_RESET (); -main_loop (); +WATCHDOG_RESET (); +main_loop (); } }/***********************************************************************/ -void hang (void ) +void hang (void ) { -disable_interrupts (); +disable_interrupts ();puts ("### ERROR ### Please reset board ###\n" ); -for (;;); +for (;;) + ; }
Signature · 1 line
1.7.10.4
PATCH v3 3/5 mx31pdk: add CONFIG_SPL_LIBGENERIC_SUPPORT
In reply to Andreas BießmannIn order to use the generic hang() later on pull libgeneric in SPL. This has no impact on the SPL size.
---
Changes in v3: None
Changes in v2: None
include/configs/mx31pdk.h | 1 + 1 file changed, 1 insertion(+)
include/configs/mx31pdk.h +1 -0
@@ -50,6 +50,7 @@#define CONFIG_SPL_LDSCRIPT "arch/$(ARCH)/cpu/u-boot-spl.lds"#define CONFIG_SPL_MAX_SIZE 2048#define CONFIG_SPL_NAND_SUPPORT +#define CONFIG_SPL_LIBGENERIC_SUPPORT #define CONFIG_SPL_TEXT_BASE 0x87dc0000#define CONFIG_SYS_TEXT_BASE 0x87e00000
Signature · 1 line
1.7.10.4
PATCH v3 4/5 tx25: add CONFIG_SPL_LIBGENERIC_SUPPORT
In reply to Andreas BießmannIn order to use the generic hang() later on pull libgeneric in SPL. This has no impact on the SPL size.
---
Changes in v3: None
Changes in v2: None
include/configs/tx25.h | 1 + 1 file changed, 1 insertion(+)
include/configs/tx25.h +1 -0
@@ -37,6 +37,7 @@#define CONFIG_SPL_LDSCRIPT "arch/$(ARCH)/cpu/u-boot-spl.lds"#define CONFIG_SPL_MAX_SIZE 2048#define CONFIG_SPL_NAND_SUPPORT +#define CONFIG_SPL_LIBGENERIC_SUPPORT #define CONFIG_SPL_TEXT_BASE 0x810c0000#define CONFIG_SYS_TEXT_BASE 0x81200000
Signature · 1 line
1.7.10.4
PATCH v3 4/5 tx25: add CONFIG_SPL_LIBGENERIC_SUPPORT
Dear Andreas Bie?mann,
Quoted 26 lines · Andreas Bie?mann
In order to use the generic
hang()later on pull libgeneric in SPL. This has no impact on the SPL size.Signed-off-by Andreas Bie?mann <[email protected]>---
Changes in v3: None
Changes in v2: Noneinclude/configs/tx25.h | 1 + 1 file changed, 1 insertion(+)include/configs/tx25.h +1
-1@@ -37,6 +37,7 @@#define CONFIG_SPL_LDSCRIPT "arch/$(ARCH)/cpu/u-boot-spl.lds"#define CONFIG_SPL_MAX_SIZE 2048#define CONFIG_SPL_NAND_SUPPORT +#define CONFIG_SPL_LIBGENERIC_SUPPORT #define CONFIG_SPL_TEXT_BASE 0x810c0000#define CONFIG_SYS_TEXT_BASE 0x81200000 --1.7.10.4
Quoted 4 lines
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
v3 5/5 seems to be missing?
Best regards,
Beno?t
PATCH v3 4/5 tx25: add CONFIG_SPL_LIBGENERIC_SUPPORT
Dear Beno?t Th?baudeau,
Quoted 6 lines · Beno?t Th?baudeau
Dear Andreas Bie?mann,
Quoted 3 lines · Andreas Bie?mann
In order to use the generic
hang()later on pull libgeneric in SPL. This has no impact on the SPL size.
Quoted 7 lines
Quoted 5 lines
Signed-off-by Andreas Bie?mann <[email protected]>---
Changes in v3: None
Changes in v2: Nonev3 5/5 seems to be missing?
moderator approval due to long cc list, should hit the ml soon.
Best regards
Andreas Bie?mann
PATCH v3 5/5 lib: consolidate hang()
In reply to Andreas BießmannDelete all occurrences of hang() and provide a generic function.
---
Changes in v3:
* remove unnecessarily added linux/compiler.h
* fix typo in new hang() docu
* use simplified macro for SPL_LIBCOMMON_SUPPORT as suggested by Beno?t
Changes in v2:
* delete all hang() and provide generic lib/hang.c
arch/arm/cpu/arm926ejs/mxs/spl_boot.c | 7 ----- arch/arm/cpu/arm926ejs/spear/spl.c | 7 ----- arch/arm/lib/board.c | 6 ----- arch/avr32/lib/board.c | 5 ---- arch/blackfin/lib/board.c | 14 ---------- arch/m68k/lib/board.c | 7 ----- arch/microblaze/lib/board.c | 7 ----- arch/mips/lib/board.c | 7 ----- arch/nds32/lib/board.c | 7 ----- arch/nios2/lib/board.c | 11 -------- arch/openrisc/lib/board.c | 12 --------- arch/powerpc/lib/board.c | 9 ------- arch/sandbox/lib/board.c | 7 ----- arch/sh/lib/board.c | 9 ------- arch/sparc/lib/board.c | 9 ------- arch/x86/lib/board.c | 7 ----- common/board_f.c | 6 ----- common/spl/spl.c | 7 ----- drivers/mtd/nand/mxc_nand_spl.c | 9 ------- lib/Makefile | 1 + lib/hang.c | 46 +++++++++++++++++++++++++++++++++ 21 files changed, 47 insertions(+), 153 deletions(-) create mode 100644 lib/hang.c
arch/arm/cpu/arm926ejs/mxs/spl_boot.c +0 -7
@@ -148,10 +148,3 @@ inline void board_init_r(gd_t *id, ulong dest_addr)for (;;) ; } - -void hang (void ) __attribute__ ((noreturn)); -void hang (void ) -{ -for (;;) - ; -}
arch/arm/cpu/arm926ejs/spear/spl.c +0 -7
@@ -31,13 +31,6 @@#include <asm/arch/spr_misc.h> #include <asm/arch/spr_syscntl.h> -inline void hang (void ) -{ -serial_puts ("### ERROR ### Please RESET the board ###\n" ); -for (;;) - ; -} -static void ddr_clock_init (void ) {struct misc_regs *misc_p = (struct misc_regs *)CONFIG_SPEAR_MISCBASE ;
arch/arm/lib/board.c +0 -6
@@ -706,9 +706,3 @@ void board_init_r(gd_t *id, ulong dest_addr)/* NOTREACHED - no way out of command loop except booting */ } - -void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -for (;;); -}
arch/avr32/lib/board.c +0 -5
@@ -120,11 +120,6 @@ static int display_banner (void)return 0 ; } -void hang (void ) -{ -for (;;) ; -} -static int display_dram_config (void ) {int i;
arch/blackfin/lib/board.c +0 -14
@@ -432,17 +432,3 @@ void board_init_r(gd_t * id, ulong dest_addr)for (;;)main_loop (); } - -void hang (void ) -{ -#ifdef CONFIG_STATUS_LED -status_led_set (STATUS_LED_BOOT ,STATUS_LED_OFF ); -status_led_set (STATUS_LED_CRASH ,STATUS_LED_BLINKING ); -#endif -puts ("### ERROR ### Please RESET the board ###\n" ); -while (1 ) -/* If a JTAG emulator is hooked up, we'll automatically trigger -* a breakpoint in it. If one isn't, this is just a NOP. -*/ - asm("emuexcpt;" ); -}
arch/m68k/lib/board.c +0 -7
@@ -663,10 +663,3 @@ void board_init_r (gd_t *id, ulong dest_addr)/* NOTREACHED - no way out of command loop except booting */ } - - -void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -for (;;); -}
arch/microblaze/lib/board.c +0 -7
@@ -192,10 +192,3 @@ void board_init_f(ulong not_used)main_loop (); } } - -void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -for (;;) - ; -}
arch/mips/lib/board.c +0 -7
@@ -344,10 +344,3 @@ void board_init_r(gd_t *id, ulong dest_addr)/* NOTREACHED - no way out of command loop except booting */ } - -void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -for (;;) - ; -}
arch/nds32/lib/board.c +0 -7
@@ -404,10 +404,3 @@ void board_init_r(gd_t *id, ulong dest_addr)/* NOTREACHED - no way out of command loop except booting */ } - -void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -for (;;) - ; -}
arch/nios2/lib/board.c +0 -11
@@ -162,14 +162,3 @@ void board_init(void)main_loop (); } } - - -/***********************************************************************/ - -void hang (void ) -{ -disable_interrupts (); -puts ("### ERROR ### Please reset board ###\n" ); -for (;;) - ; -}
arch/openrisc/lib/board.c +0 -12
@@ -154,15 +154,3 @@ void board_init(void)main_loop (); } } - - -/***********************************************************************/ - -void hang (void ) -{ -disable_interrupts (); -puts ("### ERROR ### Please reset board ###\n" ); - -for (;;) - ; -}
arch/powerpc/lib/board.c +0 -9
@@ -1050,15 +1050,6 @@ void board_init_r(gd_t *id, ulong dest_addr)/* NOTREACHED - no way out of command loop except booting */ } -void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -bootstage_error (BOOTSTAGE_ID_NEED_RESET ); -for (;;) - ; -} - -#if 0 /* We could use plain global data, but the resulting code is bigger */ /* * Pointer to initial global data area
arch/sandbox/lib/board.c +0 -7
@@ -276,10 +276,3 @@ void board_init_r(gd_t *id, ulong dest_addr)/* NOTREACHED - no way out of command loop except booting */ } - -void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -for (;;) - ; -}
arch/sh/lib/board.c +0 -9
@@ -200,12 +200,3 @@ void sh_generic_init(void)main_loop (); } } - -/***********************************************************************/ - -void hang (void ) -{ -puts ("Board ERROR\n" ); -for (;;) - ; -}
arch/sparc/lib/board.c +0 -9
@@ -411,13 +411,4 @@ void board_init_f(ulong bootflag) } -void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -#ifdef CONFIG_SHOW_BOOT_PROGRESS -bootstage_error (BOOTSTAGE_ID_NEED_RESET ); -#endif -for (;;) ; -} -/************************************************************************/
arch/x86/lib/board.c +0 -7
@@ -264,10 +264,3 @@ void board_init_r(gd_t *id, ulong dest_addr)/* NOTREACHED - no way out of command loop except booting */ } - -void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -for (;;) - ; -}
common/board_f.c +0 -6
@@ -1003,9 +1003,3 @@ void board_init_f_r(void) hang(); }#endif /* CONFIG_X86 */ - -void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -for (;;); -}
common/spl/spl.c +0 -7
@@ -48,13 +48,6 @@ struct spl_image_info spl_image;/* Define board data structure */ static bd_t bdata __attribute__ ((section(".data"))); -inline void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -for (;;) - ; -} -/* * Default function to determine if u-boot or the OS should * be started. This implementation always returns 1.
drivers/mtd/nand/mxc_nand_spl.c +0 -9
@@ -355,12 +355,3 @@ void nand_boot(void)hang (); } } - -/* -* Called in case of an exception. -*/ -void hang (void ) -{ -/* Loop forever */ -while (1 ) ; -}
lib/Makefile +1 -0
@@ -71,6 +71,7 @@ COBJS-$(CONFIG_BCH) += bch.o COBJS-y += crc32.o COBJS-y += ctype.o COBJS-y += div64.o +COBJS-y += hang.o COBJS-y += linux_string.o COBJS-y += string.o COBJS-y += time.o
lib/hang.c new file +46 -0
46 lines not on this page · raw message
Signature · 1 line
1.7.10.4
PATCH v3 5/5 lib: consolidate hang()
Hi Andreas,
Quoted 409 lines · Andreas Bie?mann
Delete all occurrences of
hang()and provide a generic function.Signed-off-by Andreas Bie?mann <[email protected]>---
Changes in v3:
* remove unnecessarily addedlinux/compiler.h
* fix typo in newhang()docu
* use simplified macro forSPL_LIBCOMMON_SUPPORTas suggested by Beno?tChanges in v2:
* delete allhang()and provide genericlib/hang.carch/arm/cpu/arm926ejs/mxs/spl_boot.c | 7 ----- arch/arm/cpu/arm926ejs/spear/spl.c | 7 ----- arch/arm/lib/board.c | 6 ----- arch/avr32/lib/board.c | 5 ---- arch/blackfin/lib/board.c | 14 ---------- arch/m68k/lib/board.c | 7 ----- arch/microblaze/lib/board.c | 7 ----- arch/mips/lib/board.c | 7 ----- arch/nds32/lib/board.c | 7 ----- arch/nios2/lib/board.c | 11 -------- arch/openrisc/lib/board.c | 12 --------- arch/powerpc/lib/board.c | 9 ------- arch/sandbox/lib/board.c | 7 ----- arch/sh/lib/board.c | 9 ------- arch/sparc/lib/board.c | 9 ------- arch/x86/lib/board.c | 7 ----- common/board_f.c | 6 ----- common/spl/spl.c | 7 ----- drivers/mtd/nand/mxc_nand_spl.c | 9 ------- lib/Makefile | 1 + lib/hang.c | 46 +++++++++++++++++++++++++++++++++ 21 files changed, 47 insertions(+), 153 deletions(-) create mode 100644 lib/hang.carch/arm/cpu/arm926ejs/mxs/spl_boot.c +0
-7@@ -148,10 +148,3 @@ inline void board_init_r(gd_t *id, ulong dest_addr)for (;;) ; } - -void hang (void ) __attribute__ ((noreturn)); -void hang (void ) -{ -for (;;) - ; -}arch/arm/cpu/arm926ejs/spear/spl.c +0
-7@@ -31,13 +31,6 @@#include <asm/arch/spr_misc.h> #include <asm/arch/spr_syscntl.h> -inline void hang (void ) -{ -serial_puts ("### ERROR ### Please RESET the board ###\n" ); -for (;;) - ; -} -static void ddr_clock_init (void ) {struct misc_regs *misc_p = (struct misc_regs *)CONFIG_SPEAR_MISCBASE ;arch/arm/lib/board.c +0
-6@@ -706,9 +706,3 @@ void board_init_r(gd_t *id, ulong dest_addr)/* NOTREACHED - no way out of command loop except booting */ } - -void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -for (;;); -}arch/avr32/lib/board.c +0
-5@@ -120,11 +120,6 @@ static int display_banner (void)return 0 ; } -void hang (void ) -{ -for (;;) ; -} -static int display_dram_config (void ) {int i;arch/blackfin/lib/board.c +0
-14@@ -432,17 +432,3 @@ void board_init_r(gd_t * id, ulong dest_addr)for (;;)main_loop (); } - -void hang (void ) -{ -#ifdef CONFIG_STATUS_LED -status_led_set (STATUS_LED_BOOT ,STATUS_LED_OFF ); -status_led_set (STATUS_LED_CRASH ,STATUS_LED_BLINKING ); -#endif -puts ("### ERROR ### Please RESET the board ###\n" ); -while (1 ) -/* If a JTAG emulator is hooked up, we'll automatically trigger -* a breakpoint in it. If one isn't, this is just a NOP. -*/ - asm("emuexcpt;" ); -}arch/m68k/lib/board.c +0
-7@@ -663,10 +663,3 @@ void board_init_r (gd_t *id, ulong dest_addr)/* NOTREACHED - no way out of command loop except booting */ } - - -void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -for (;;); -}arch/microblaze/lib/board.c +0
-7@@ -192,10 +192,3 @@ void board_init_f(ulong not_used)main_loop (); } } - -void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -for (;;) - ; -}arch/mips/lib/board.c +0
-7@@ -344,10 +344,3 @@ void board_init_r(gd_t *id, ulong dest_addr)/* NOTREACHED - no way out of command loop except booting */ } - -void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -for (;;) - ; -}arch/nds32/lib/board.c +0
-7@@ -404,10 +404,3 @@ void board_init_r(gd_t *id, ulong dest_addr)/* NOTREACHED - no way out of command loop except booting */ } - -void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -for (;;) - ; -}arch/nios2/lib/board.c +0
-11@@ -162,14 +162,3 @@ void board_init(void)main_loop (); } } - - -/***********************************************************************/ - -void hang (void ) -{ -disable_interrupts (); -puts ("### ERROR ### Please reset board ###\n" ); -for (;;) - ; -}arch/openrisc/lib/board.c +0
-12@@ -154,15 +154,3 @@ void board_init(void)main_loop (); } } - - -/***********************************************************************/ - -void hang (void ) -{ -disable_interrupts (); -puts ("### ERROR ### Please reset board ###\n" ); - -for (;;) - ; -}arch/powerpc/lib/board.c +0
-9@@ -1050,15 +1050,6 @@ void board_init_r(gd_t *id, ulong dest_addr)/* NOTREACHED - no way out of command loop except booting */ } -void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -bootstage_error (BOOTSTAGE_ID_NEED_RESET ); -for (;;) - ; -} - -#if 0 /* We could use plain global data, but the resulting code is bigger */ /* * Pointer to initial global data area arch/sandbox/lib/board.c +0
-7@@ -276,10 +276,3 @@ void board_init_r(gd_t *id, ulong dest_addr)/* NOTREACHED - no way out of command loop except booting */ } - -void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -for (;;) - ; -}arch/sh/lib/board.c +0
-9@@ -200,12 +200,3 @@ void sh_generic_init(void)main_loop (); } } - -/***********************************************************************/ - -void hang (void ) -{ -puts ("Board ERROR\n" ); -for (;;) - ; -}arch/sparc/lib/board.c +0
-9@@ -411,13 +411,4 @@ void board_init_f(ulong bootflag) } -void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -#ifdef CONFIG_SHOW_BOOT_PROGRESS -bootstage_error (BOOTSTAGE_ID_NEED_RESET ); -#endif -for (;;) ; -} -/************************************************************************/ arch/x86/lib/board.c +0
-7@@ -264,10 +264,3 @@ void board_init_r(gd_t *id, ulong dest_addr)/* NOTREACHED - no way out of command loop except booting */ } - -void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -for (;;) - ; -}common/board_f.c +0
-6@@ -1003,9 +1003,3 @@ void board_init_f_r(void) hang(); }#endif /* CONFIG_X86 */ - -void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -for (;;); -}common/spl/spl.c +0
-7@@ -48,13 +48,6 @@ struct spl_image_info spl_image;/* Define board data structure */ static bd_t bdata __attribute__ ((section(".data"))); -inline void hang (void ) -{ -puts ("### ERROR ### Please RESET the board ###\n" ); -for (;;) - ; -} -/* * Default function to determine if u-boot or the OS should * be started. This implementation always returns 1. drivers/mtd/nand/mxc_nand_spl.c +0
-9@@ -355,12 +355,3 @@ void nand_boot(void)hang (); } } - -/* -* Called in case of an exception. -*/ -void hang (void ) -{ -/* Loop forever */ -while (1 ) ; -}lib/Makefile +1
-0@@ -71,6 +71,7 @@ COBJS-$(CONFIG_BCH) += bch.o COBJS-y += crc32.o COBJS-y += ctype.o COBJS-y += div64.o +COBJS-y += hang.o COBJS-y += linux_string.o COBJS-y += string.o COBJS-y += time.olib/hang.c new file +36
-0@@ -0,0 +1,46 @@ +/* +* (C) Copyright 2013 +* Andreas Bie?mann <[email protected]> +* +* This file consolidates all the different hang() functions implemented in +* u-boot. +* +* See file CREDITS for list of people who contributed to this +* project. +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, +* MA 02111-1307 USA +*/ + +#include <common.h> +#include <bootstage.h> + +/** +* hang - stop processing by staying in an endless loop +* +* The purpose of this function is to stop further execution of code cause +* something went completely wrong. To catch this and give some feedback to +* the user one needs to catch the bootstage_error (see show_boot_progress()) +* in the board code.
lib/hang.c line 46
Quoted 10 lines
lib/hang.c new file +10
-0+*/ +void hang (void ) +{ +#if !defined(CONFIG_SPL_BUILD ) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT ) +puts ("### ERROR ### Please RESET the board ###\n" ); +#endif +bootstage_error (BOOTSTAGE_ID_NEED_RESET ); +for (;;) + ; +}
For ARM:
Amicalement,
Signature · 1 line
Albert.
PATCH v3 5/5 lib: consolidate hang()
In reply to Andreas BießmannQuoted 3 lines · Andreas Bie??mann
Delete all occurrences of
hang()and provide a generic function.Signed-off-by Andreas Bie??mann <[email protected]>
With the following:
lib/hang.c +2 -1
@@ -37,7 +37,8 @@*/ void hang (void ) { -#if !defined(CONFIG_SPL_BUILD ) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT ) +#if !defined(CONFIG_SPL_BUILD ) || (defined(CONFIG_SPL_LIBCOMMON_SUPPORT ) && \ + defined(CONFIG_SPL_SERIAL_SUPPORT ))puts ("### ERROR ### Please RESET the board ###\n" );#endif bootstage_error (BOOTSTAGE_ID_NEED_RESET );
To fix build breakage when LIBCOMMON is set, but SERIAL is not and thus we had a build failure, applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130502/5efae8f0/attachment.pgp>
v3 cover consolidate hang()
In reply to Andreas BießmannHi Andreas,
Quoted 21 lines · Andreas Bie?mann
This series started with intention to make a hung board visualize the (end-)user that it does
hang(). The first approach was to make all the differenthang()functions weak and provide board specific versions to implement the 'visualization' there.
After some discussion it turned out, that there is still an interface to visualize such states to the user: the 'bootstage' stuff.BTW:
This is my first try sending a series with patman. All I can say is:
patman is really cool ;)The 'microblaze: fix style in
board.c' is an leftover from the first approach.The 'nios2: fix style in
board.c' is an leftover from the first approach.The 'lib: consolidate
hang()' is build tested on arm and avr32. It may produces errors on other arches like ppc cause the previous SPL inlinedhang()function was also removed. We need to discuss if we always pull in the libgeneric unconditional into SPL or provide a secondhang()for those boards which do not link against libgeneric in SPL.
Quoted 3 lines
Since v2 got a complete (compile-)test on powerpc by Wolfgang I think we can stick with the current solution. v3 includes some minor changes mentioned in the changelog of respective patches.
This series tested on snow with CONFIG_SYS_GENERIC_BOARD enabled. No warnings or problems noted and hang() still works.
Quoted 17 lines
Changes in v3:
* shorten error string for 'no FDT'
* remove unnecessarily addedlinux/compiler.h
* fix typo in newhang()docu
* use simplified macro forSPL_LIBCOMMON_SUPPORTas suggested by Beno?tChanges in v2:
* delete allhang()and provide genericlib/hang.cAndreas Bie?mann (5):
microblaze: fix style inboard.c
nios2: fix style inboard.c.
mx31pdk: addCONFIG_SPL_LIBGENERIC_SUPPORT
tx25: addCONFIG_SPL_LIBGENERIC_SUPPORT
lib: consolidatehang()
v3 cover consolidate hang()
In reply to Andreas BießmannQuoted 6 lines · Andreas Bie??mann
This series started with intention to make a hung board visualize the (end-)user that it does
hang(). The first approach was to make all the differenthang()functions weak and provide board specific versions to implement the 'visualization' there.
After some discussion it turned out, that there is still an interface to visualize such states to the user: the 'bootstage' stuff.
With a change to 5/5, applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130502/ea388d06/attachment.pgp>