From patchwork Wed Nov 27 18:32:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Brodkin X-Patchwork-Id: 294635 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 67DE62C009A for ; Thu, 28 Nov 2013 05:33:14 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 36F6F4B7C1; Wed, 27 Nov 2013 19:33:11 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FCrFxPfJeGF6; Wed, 27 Nov 2013 19:33:11 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 49A4B4B75A; Wed, 27 Nov 2013 19:33:08 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8532C4B755 for ; Wed, 27 Nov 2013 19:33:02 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8s5BdtyJ2-Xk for ; Wed, 27 Nov 2013 19:32:57 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from hermes.synopsys.com (us01smtp3.synopsys.com [198.182.44.81]) by theia.denx.de (Postfix) with ESMTP id 32FD44B73D for ; Wed, 27 Nov 2013 19:32:51 +0100 (CET) Received: from WBSNus02mta1 (us02secmta1.synopsys.com [10.12.235.96]) by hermes.synopsys.com (Postfix) with ESMTP id 3EC09FAD9; Wed, 27 Nov 2013 10:32:49 -0800 (PST) Received: from us02secmta1.internal.synopsys.com (us02secmta1.internal.synopsys.com [127.0.0.1]) by us02secmta1.internal.synopsys.com (Service) with ESMTP id 32B454E213; Wed, 27 Nov 2013 10:32:49 -0800 (PST) Received: from mailhost.synopsys.com (mailhost2.synopsys.com [10.9.202.240]) by us02secmta1.internal.synopsys.com (Service) with ESMTP id 10D934E202; Wed, 27 Nov 2013 10:32:49 -0800 (PST) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 03A2DF9E; Wed, 27 Nov 2013 10:32:49 -0800 (PST) Received: from abrodkin-8560l.internal.synopsys.com (abrodkin-8560l.internal.synopsys.com [10.121.8.118]) by mailhost.synopsys.com (Postfix) with ESMTP id 8CCA1F99; Wed, 27 Nov 2013 10:32:46 -0800 (PST) From: Alexey Brodkin To: u-boot@lists.denx.de Date: Wed, 27 Nov 2013 22:32:40 +0400 Message-Id: <1385577160-14826-1-git-send-email-abrodkin@synopsys.com> X-Mailer: git-send-email 1.8.4.2 Cc: Alexey Brodkin , Mischa Jonker Subject: [U-Boot] [PATCH] board_f: explicitly disable console on early boot X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de 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 Cc: Mischa Jonker Cc: Wolfgang Denk Cc: Simon Glass Acked-by: Simon Glass --- common/board_f.c | 1 + 1 file changed, 1 insertion(+) diff --git a/common/board_f.c b/common/board_f.c index f0664bc..fcfd713 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -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();