From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Fri, 24 Aug 2012 12:30:16 -0700 Subject: [U-Boot] [PATCH 1/1] lib, panic: don't call do_reset in SPL (debug). In-Reply-To: <502AB7D2.80503@myspectrum.nl> References: <502AB715.2040403@myspectrum.nl> <502AB7D2.80503@myspectrum.nl> Message-ID: <5037D648.1050808@ti.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 08/14/2012 01:40 PM, Jeroen Hofstee wrote: > 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 > Signed-off-by: Jeroen Hofstee > --- > 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 > > #include > -#if !defined (CONFIG_PANIC_HANG) > +#if !defined(CONFIG_PANIC_HANG) && !defined(CONFIG_SPL_BUILD) > #include > #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 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"); #endif hang(); #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. -- Tom