Silent u-boot (was Re: Current firmware)

Andrea Bolognani eof at
Mon Aug 29 16:24:29 EDT 2011

On Thu, Aug 25, 2011 at 06:08:55PM +0200, Andrea Bolognani wrote:

> The GD_FLG_SILENT flag is checked in various places around the code; the
> place where it is set is in common/console.c, in function console_init_f(),
> with the following code:
> 	if (getenv("silent") != NULL)
> 		gd->flags |= GD_FLG_SILENT;
> 	#endif
> console_init_f() is not called by the xburst specific u-boot code.

I’ve finally found out why GD_FLG_SILENT doesn’t get set.

console_init_f() is actually called by the generic MIPS code in
arch/mips/lib/board.c before relocation; however, the NAND chip
is initialized *after* relocation, and since the environment is
saved to the NAND, it hasn’t been loaded yet when console_init_f()
is called.

(Please correct me if anything is wrong with my analysis.)

To make sure the “silent” environment variable is checked after the
NAND environment has been loaded, I’ve added the same code used in
console_init_f() inside console_init_r(), which is the function that
completes initialization of the console after relocation.

I’ve tested the modified u-boot, and I’m glad to report it works great:
if the “silent” environment variable is set, u-boot doesn’t show any
output; if it is not set, everything works just as before.

I’ve attached two patches: one (310-enable-silent-console.patch) can be
dropped in openwrt-xburst.git/package/uboot-xburst/patches, the other
one (silent-u-boot-by-default.patch) can be applied to mtd.nn in
openwrt-packages.git to make u-boot silent by default.

Andrea Bolognani <eof at>
Resistance is futile, you will be garbage collected.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 310-enable-silent-console.patch
Type: text/x-diff
Size: 1659 bytes
Desc: not available
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: silent-u-boot-by-default.patch
Type: text/x-diff
Size: 756 bytes
Desc: not available
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <>

More information about the discussion mailing list