fix some SPL debug builds.
Subsystems (2)
cover fix some SPL debug builds.
Some boards with SPL fail to build with DEBUG defined. This patch should fix the "undefined reference to `do_reset'".
before with -DDEBUG
--------------------- SUMMARY ---------------------------- Boards compiled: 303
Boards with errors: 44 ( da850_am18xxevm da850evm spear300 spear300_nand spear300_usbtty spear300_usbtty_nand spear310 spear310_pnor spear310_nand spear310_usbtty spear310_usbtty_pnor spear310_usbtty_nand spear320 spear320_pnor spear320_nand spear320_usbtty spear320_usbtty_pnor spear320_usbtty_nand spear600 spear600_nand spear600_usbtty spear600_usbtty_nand am335x_evm omap3_overo am3517_evm am3517_crane omap3_beagle omap3_evm omap3_evm_quick_mmc devkit8000 mcx tricorder omap4_panda omap4_sdp4430 omap5_evm harmony seaboard ventana whistler plutux medcom tec paz00 trimslice )
Boards with warnings but no errors: 8 ( VCMA9 smdk2410 top9000eval_xe lschlv2 lsxhl omap5912osk qong top9000eval_xe )
----------------------------------------------------------
after with -DDEBUG
--------------------- SUMMARY ---------------------------- Boards compiled: 303
Boards with errors: 29 ( spear600_nand spear320_nand spear320_usbtty_nand spear310_pnor plutux medcom spear300_usbtty_nand spear320_usbtty_pnor spear300 spear320_pnor spear300_usbtty spear310_usbtty_nand spear320_usbtty spear310_usbtty_pnor spear600 seaboard trimslice spear600_usbtty tec whistler
ventana harmony paz00 spear300_nand spear320 spear310 spear310_nand spear310_usbtty spear600_usbtty_nand )
Boards with warnings but no errors: 7 ( lsxhl qong top9000eval_xe lschlv2 VCMA9 omap5912osk smdk2410 )
----------------------------------------------------------
Jeroen Hofstee (1):
lib, panic: don't call do_reset in SPL (debug).
lib/vsprintf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
1.7.9.5
PATCH 1/1 lib, panic: don't call do_reset in SPL (debug).
Several omap boards won't build when DEBUG is defined, SPL build error:
"vsprintf.c:791: undefined reference to `do_reset'", since SPL has no commands. Therefore don't call do_reset in SPL. SPL panic will end in an endless loop or call hang if CONFIG_PANIC_HANG is defined.
--- lib/vsprintf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
lib/vsprintf.c +2 -2
@@ -18,7 +18,7 @@#include <errno.h> #include <common.h> -#if !defined (CONFIG_PANIC_HANG ) +#if !defined(CONFIG_PANIC_HANG ) && !defined(CONFIG_SPL_BUILD )#include <command.h> #endif
@@ -786,7 +786,7 @@ void panic(const char *fmt, ...)va_end (args);#if defined (CONFIG_PANIC_HANG )hang (); -#else +#elif !defined(CONFIG_SPL_BUILD )udelay (100000 );/* allow messages to go out */ do_reset (NULL ,0 ,0 ,NULL );#endif
Signature · 1 line
1.7.9.5
PATCH 1/1 lib, panic: don't call do_reset in SPL (debug).
Quoted 7 lines · Jeroen Hofstee
Several omap boards won't build when DEBUG is defined, SPL build error:
"vsprintf.c:791: undefined reference to `do_reset'", since SPL has no commands. Therefore don't calldo_resetin SPL. SPL panic will end in an endless loop or call hang ifCONFIG_PANIC_HANGis defined.cc Tom Rini <[email protected]>Signed-off-by Jeroen Hofstee <[email protected]>
OK, the problem I see with this is it forces a policy on everyone, even non-DEBUG cases. What I'd like to see, and I'll submit the patch, is to document that when debugging SPL one should also set CONFIG_PANIC_HANG as do_reset is often (but it could be defined!) undefined for SPL.
Signature · 1 line
Tom
PATCH 1/1 lib, panic: don't call do_reset in SPL (debug).
Quoted 7 lines · Tom Rini
Quoted 5 lines · Jeroen Hofstee
Several omap boards won't build when DEBUG is defined, SPL build error:
"vsprintf.c:791: undefined reference to `do_reset'", since SPL has no commands. Therefore don't calldo_resetin SPL. SPL panic will end in an endless loop or call hang ifCONFIG_PANIC_HANGis defined.
Quoted 7 lines
Quoted 2 lines
cc Tom Rini <[email protected]>Signed-off-by Jeroen Hofstee <[email protected]>OK, the problem I see with this is it forces a policy on everyone, even non-DEBUG cases. What I'd like to see, and I'll submit the patch, is to document that when debugging SPL one should also set
CONFIG_PANIC_HANGasdo_resetis often (but it could be defined!) undefined for SPL.
Right, we have some kind of dependencies. It is always painful if the reason is unknown, and we should document it.
Best regards,
Stefano
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-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH 1/1 lib, panic: don't call do_reset in SPL (debug).
In reply to Jeroen HofsteeQuoted 25 lines · Jeroen Hofstee
Several omap boards won't build when DEBUG is defined, SPL build error:
"vsprintf.c:791: undefined reference to `do_reset'", since SPL has no commands. Therefore don't calldo_resetin SPL. SPL panic will end in an endless loop or call hang ifCONFIG_PANIC_HANGis defined.cc Tom Rini <[email protected]>Signed-off-by Jeroen Hofstee <[email protected]>--- lib/vsprintf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)lib/vsprintf.c +1
-1@@ -18,7 +18,7 @@#include <errno.h> #include <common.h> -#if !defined (CONFIG_PANIC_HANG ) +#if !defined(CONFIG_PANIC_HANG ) && !defined(CONFIG_SPL_BUILD )#include <command.h> #endif
lib/vsprintf.c void panic(const char *fmt, ...) · line 792
Quoted 8 lines
lib/vsprintf.c +1
-1@@ -786,7 +786,7 @@ void panic(const char *fmt, ...)va_end (args);#if defined (CONFIG_PANIC_HANG )hang (); -#else +#elif !defined(CONFIG_SPL_BUILD )udelay (100000 );/* allow messages to go out */ do_reset (NULL ,0 ,0 ,NULL );#endif
Thinking about this more. The point is that today, no one that does SPL has reset ability. I would like to see this changed, slightly. Lets do:
#if defined(CONFIG_PANIC_HANG) || defined(CONFIG_SPL_BUILD) #if defined(CONFIG_SPL_BUILD)puts("hanging\n");
#endifhang();
#else
...
And no need to not include command.h I think. This makes it clear that a panic results in hang in SPL so that in the future, should someone depend on other behavior it's at least saying why we aren't resetting which is my concern.
Signature · 1 line
Tom
PATCH 1/1 lib, panic: don't call do_reset in SPL (debug).
Dear Tom Rini,
Quoted 5 lines · In message <[email protected]> you wrote:
And no need to not include
command.hI think. This makes it clear that a panic results in hang in SPL so that in the future, should someone depend on other behavior it's at least saying why we aren't resetting which is my concern.
I think a panic should always reset by default. hang() is something the user has explicitly ask for, it should not be used as the default case.
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 We, the unwilling, led by the unknowing, are doing the impossible for the ungrateful. We have done so much, for so long, with so little, we are now qualified to do anything with nothing.