From: Wolfgang Denk Date: Sun, 28 Aug 2011 12:08:06 +0200 Subject: [U-Boot] [RFC][PATCH] Pre-console buffer In-Reply-To: <4E5985C8.8020404@gmail.com> References: <1314449645-16900-1-git-send-email-graeme.russ@gmail.com> <20110827134801.94AB511F9E69@gemini.denx.de> <4E5985C8.8020404@gmail.com> Message-ID: <20110828100806.272D6166C8CB@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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.