[U-Boot] [PATCH 1/2] console: Squelch pre-console output in console functions

Simon Glass sjg at chromium.org
Thu Sep 22 01:21:44 CEST 2011


Hi Graeme,

On Mon, Aug 29, 2011 at 5:14 AM, Graeme Russ <graeme.russ at gmail.com> wrote:
> There are some locations in the code which anticipate printf() being called
> before the console is ready by squelching printf() on gd->have_console.
> Move this squelching into printf(), vprintf(), puts() and putc(). Also
> make tstc() and getc() return 0 if console is not yet initialised
>
> Signed-off-by: Graeme Russ <graeme.russ at gmail.com>

This stops U-Boot from hanging if I add a printf() prior to console
init in board_init_f. Great!

Tested-by: Simon Glass <sjg at chromium.org>

Regards,
Simon

> ---
>  arch/powerpc/cpu/mpc5xxx/i2c.c |   30 ++++++++++--------------------
>  arch/powerpc/cpu/mpc8xx/i2c.c  |   18 ++++++------------
>  common/console.c               |   18 ++++++++++++++++++
>  drivers/i2c/ppc4xx_i2c.c       |    5 +----
>  drivers/i2c/soft_i2c.c         |    1 -
>  5 files changed, 35 insertions(+), 37 deletions(-)
>
> diff --git a/arch/powerpc/cpu/mpc5xxx/i2c.c b/arch/powerpc/cpu/mpc5xxx/i2c.c
> index 9fb330f..f9d293b 100644
> --- a/arch/powerpc/cpu/mpc5xxx/i2c.c
> +++ b/arch/powerpc/cpu/mpc5xxx/i2c.c
[snip]


More information about the U-Boot mailing list