]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
board_f: explicitly disable console on early boot
authorAlexey Brodkin <Alexey.Brodkin@synopsys.com>
Wed, 27 Nov 2013 18:32:40 +0000 (22:32 +0400)
committerTom Rini <trini@ti.com>
Fri, 13 Dec 2013 14:17:32 +0000 (09:17 -0500)
If U-Boot build with DEBUG enabled/defined the first call of "debug"
function (that dumps data to any available console) will happen before
zeroing of initial "gd" in init call "zero_global_data" in
"init_sequence_f".

And if stack was not filled with zeros chances are high that
"gd->have_console" won't be 0. In its turn it will cause attempt to
output things to non-initialized yet serial console.

So for safety and predictability we set "gd->have_console = 0".

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Mischa Jonker <mjonker@synopsys.com>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
common/board_f.c

index f0664bc2b2046acf3fc6f1177c076fcb6d432959..fcfd713b076b0dc45754a634ec982a520e11b7d5 100644 (file)
@@ -1010,6 +1010,7 @@ void board_init_f(ulong boot_flags)
 #endif
 
        gd->flags = boot_flags;
+       gd->have_console = 0;
 
        if (initcall_run_list(init_sequence_f))
                hang();