From: Simon Glass Date: Tue, 26 Sep 2017 13:21:31 -0600 Subject: [U-Boot] [PATCH v2 03/14] Revert "sandbox: Drop special case console code for sandbox" In-Reply-To: <20170926192142.42308-1-sjg@chromium.org> References: <20170926192142.42308-1-sjg@chromium.org> Message-ID: <20170926192142.42308-4-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de While sandbox works OK without the special-case code, it does result in console output being stored in the pre-console buffer while sandbox starts up. If there is a crash or a problem then there is no indication of what is going on. For ease of debugging it seems better to revert this change also. This reverts commit d8c6fb8cedbc35eee27730a7fa544e499b3c81cc. Signed-off-by: Simon Glass --- Changes in v2: None common/console.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/common/console.c b/common/console.c index f83528ca60..18457aab3c 100644 --- a/common/console.c +++ b/common/console.c @@ -482,6 +482,13 @@ static inline void print_pre_console_buffer(int flushpoint) {} void putc(const char c) { +#ifdef CONFIG_SANDBOX + /* sandbox can send characters to stdout before it has a console */ + if (!gd || !(gd->flags & GD_FLG_SERIAL_READY)) { + os_putc(c); + return; + } +#endif #ifdef CONFIG_DEBUG_UART /* if we don't have a console yet, use the debug UART */ if (!gd || !(gd->flags & GD_FLG_SERIAL_READY)) { -- 2.14.1.992.g2c7b836f3a-goog