[U-Boot] [PATCH] logbuff: Change default console loglevel to 8

Peter Tyser ptyser at xes-inc.com
Fri May 7 19:57:58 CEST 2010


H Detlev,

> > Previously, a default of 3 was assigned to the console loglevel while
> > standard messages had a level of 4.  This resulted in U-Boot's console
> > disappearing if a user enabled CONFIG_LOGBUFFER but didn't manually set
> > the 'loglevel' environment variable to a value greater than 4.
> >
> > Setting the default console loglevel to 8 causes all messages to be
> > printed to the console, which is standard U-Boot operation.  Users can
> > then reduce the console loglevel if they want using the 'loglevel'
> > environment variable.
> 
> I don't really like that patch as I think it will alter how U-Boot
> "looks" (i.e. what it outputs) on e.g. the lwmon5 board where the
> logbuffer is used primarily for logging POST results.
> 
> Can you please explain to me again, why the messages are not output any
> more once CONFIG_LOGBUFFER is enabled?  If 'stdout' is serial (and I
> don't see why this should not be the case) then is there already a
> problem?

I'll step through the process I used to try out CONFIG_LOGBUFFER:
1. Take an board that has a u-boot image on it without logbuff support,
without CONFIG_SYS_CONSOLE_IS_IN_ENV defined, or any of the logbuff
environment variables defined.

2. Build an image for the same board, this time with CONFIG_LOGBUFFER
enabled.

3. Program and boot the new logbuff-enabled image and you'll see
something like the following on the serial console:
...
FLASH: 128 MiB
L2:    512 KB already enabled
NAND:  512 MiB

    PCI1: 64 bit PCI, >= 66 MHz, agent, external-arbiter
    PCI1 on bus 00 - 00
<no more output past this point>


This is because most of U-Boot's output is printed with a message
loglevel of 4, but the default console loglevel was 3.  When the message
loglevel is greater than or equal to the console loglevel, the serial
output is discarded (see line 317 in common/cmd_log.c).

So having a default console loglevel of 3 results in the vast majority
of U-Boot's output being discarded (only after the GD_FLG_DEVINIT is set
in gd->flags, prior to that all output is sent to the serial port).
Thus a user is never presented with a U-Boot prompt and can't interact
with the board.  The board is in essence bricked until it can be
reprogrammed.

Setting the default console loglevel to 8 ensures that by default all
messages will be displayed on the console.  This seems like a more sane
default and the user can decrease the loglevel via the 'loglevel'
environment variable if they need.

I'm not intimately familiar with the logging features, so let me know if
I'm missing something.

Best,
Peter



More information about the U-Boot mailing list