[U-Boot] [PATCH 1/1] lib, panic: don't call do_reset in SPL (debug).

Jeroen Hofstee dasuboot at myspectrum.nl
Tue Aug 14 22:40:50 CEST 2012


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.

cc: Tom Rini <trini at ti.com>
Signed-off-by: Jeroen Hofstee <jhofstee at victronenergy.com>
---
  lib/vsprintf.c |    4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index e38a4b7..4fa392d 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -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
-- 
1.7.9.5



More information about the U-Boot mailing list