From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Sun, 17 Sep 2017 11:55:46 -0600 Subject: [U-Boot] [PATCH 02/13] Revert "sandbox: Drop special case console code for sandbox" In-Reply-To: References: <20170916212331.170463-1-sjg@chromium.org> <20170916212331.170463-3-sjg@chromium.org> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Bin, On 17 September 2017 at 06:50, Bin Meng wrote: > Hi Simon, > > On Sun, Sep 17, 2017 at 5:23 AM, Simon Glass wrote: >> 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 >> --- >> >> common/console.c | 7 +++++++ >> configs/sandbox_defconfig | 2 +- >> 2 files changed, 8 insertions(+), 1 deletion(-) >> >> 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)) { >> diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig >> index e7a61bd61a..88ae98d312 100644 >> --- a/configs/sandbox_defconfig >> +++ b/configs/sandbox_defconfig >> @@ -16,7 +16,7 @@ CONFIG_CONSOLE_RECORD=y >> CONFIG_CONSOLE_RECORD_OUT_SIZE=0x1000 >> CONFIG_SILENT_CONSOLE=y >> CONFIG_PRE_CONSOLE_BUFFER=y >> -CONFIG_PRE_CON_BUF_ADDR=0 >> +CONFIG_PRE_CON_BUF_ADDR=0x100000 > > Looks commit d8c6fb8cedbc35eee27730a7fa544e499b3c81cc does not have > this change. Why is the change from 0 to 0x100000? It causes a conflict with other usage of memory in sandbox. I'll split it into a separate patch. >> CONFIG_CMD_CPU=y >> CONFIG_CMD_LICENSE=y >> CONFIG_CMD_BOOTZ=y >> -- > > And looks there is more changes in commit > d8c6fb8cedbc35eee27730a7fa544e499b3c81cc that is not reverted? ie: > puts()? That function doesn't have this code in it anymore. It just calls putc(). Regards, Simon