[U-Boot] [RFC][PATCH] Pre-console buffer

Wolfgang Denk wd at denx.de
Sun Aug 28 12:08:06 CEST 2011


Dear Graeme Russ,

In message <4E5985C8.8020404 at 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.


More information about the U-Boot mailing list