public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC][PATCH] Pre-console buffer
Date: Sun, 28 Aug 2011 12:08:06 +0200	[thread overview]
Message-ID: <20110828100806.272D6166C8CB@gemini.denx.de> (raw)
In-Reply-To: <4E5985C8.8020404@gmail.com>

Dear Graeme Russ,

In message <4E5985C8.8020404@gmail.com> you wrote:
>
> > And this is actually wrong.  If we can use the serial console for
> > output, we definitely don;t want to use your buffer any more.
> 
> Look closer - It's a diff weirdness - The actual code is:

I see.  Thanks for pointing out.

> Also, I have noticed in drivers/i2c/ppc4xx_i2c.c:
> 
> 		if (gd->flags & GD_FLG_HAVE_CONSOLE) {
> 			printf("I2C %s: failed %d\n",
> 			       read ? "read" : "write", ret);
> 		}
> 
> and in drivers/i2c/soft_i2c.c:
> 
> #ifdef DEBUG_I2C
> #define PRINTD(fmt,args...)	do {		\
> 	if (gd->flags & GD_FLG_HAVE_CONSOLE)	\
> 		printf (fmt ,##args);		\
> 	} while (0)
> #else
> #define PRINTD(fmt,args...)
> #endif
> 
> So there are drivers that anticipate generating output before console is
> initialised - I think we should not put the onus on the driver and move
> these conditions to printf() in console.c - Unfortunately this could lead
> to head-scratching when one _thinks_ a printf() should generate an output,
> but it is squelched (which is what the pre-console buffer is for)

Indeed - which is why this code is only used for debugging drivers in
certain very special configurations.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
As of 1992, they're called European Economic Community fries.

  reply	other threads:[~2011-08-28 10:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-27 12:54 [U-Boot] [RFC][PATCH] Pre-console buffer Graeme Russ
2011-08-27 13:48 ` Wolfgang Denk
2011-08-28  0:03   ` Graeme Russ
2011-08-28 10:08     ` Wolfgang Denk [this message]
2011-08-28 10:59       ` Graeme Russ

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110828100806.272D6166C8CB@gemini.denx.de \
    --to=wd@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox