[U-Boot] [PATCH v4] Add board_pre_console_putc to deal with early console output

Stefano Babic sbabic at denx.de
Fri Dec 2 18:09:19 CET 2011


On 19/10/2011 01:43, Simon Glass wrote:
> This patch adds support for console output before the console is inited.
> The main purpose of this is to deal with a very early panic() which would
> otherwise cause a silent hang.
> 
> A new board_pre_console_putc() function is added to the board API. If
> provided by the board it will be called in the event of console output
> before the console is ready. This function should turn on all UARTs and
> spray the character out if it possibly can.
> 
> The feature is controlled by a new CONFIG_PRE_CONSOLE_PUTC option.
> 
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---

Hi Simon,


> Changes in v2:
> - Made this feature conditional on CONFIG_PRE_CONSOLE_PANIC
> 
> Changes in v3:
> - Rewrite this to be independent of panic()
> - Rename feature to CONFIG_PRE_CONSOLE_PUTC
> 
> Changes in v4:
> - Remove weak function, so we get a link error if it is undefined by the board

maybe I have not understood the real goal of this patch. We have already
a CONFIG_PRE_CONSOLE_BUFFER, that tries to store the output when the
console is not avalable - and can be retrieved with a JTAG debugger.

Your patch adds a way to call some serial setup in board code, but it is
not said that works or can work for all / most boards. Compared to the
usage of the circular buffer, it is not so general - am I missing
something ?

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================


More information about the U-Boot mailing list