
On Sat, Mar 21, 2009 at 4:56 PM, Wolfgang Denk wd@denx.de wrote:
Dear Jon Smirl,
In message 9e4733910903211339u60f5531cp7a9574f2d1ba264f@mail.gmail.com you wrote:
How about this instead? Is there a variable that indicates when the console is safe to use, if so I can adjust the macro.
BTW: you might want to compare with cpu/mpc8xx/i2c.c or cpu/ppc4xx/i2c.c
I've test this version with the eeprom and it works correctly.
----------------------------------------------- mpc5200 with eeprom, suppress printf until console initialized
From: Jon Smirl jonsmirl@gmail.com
On boards which have the environment in eeprom, i2c_init() is called before the console and ram is initialized. Suppress printfs until the console is initialized.
Signed-off-by: Jon Smirl jonsmirl@gmail.com --- cpu/mpc5xxx/i2c.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/cpu/mpc5xxx/i2c.c b/cpu/mpc5xxx/i2c.c index 7d76274..a5478b2 100644 --- a/cpu/mpc5xxx/i2c.c +++ b/cpu/mpc5xxx/i2c.c @@ -41,6 +41,13 @@ DECLARE_GLOBAL_DATA_PTR; #define I2C_TIMEOUT 100 #define I2C_RETRIES 3
+#ifdef CONFIG_ENV_IS_IN_EEPROM +/* On boards which have the environment in eeprom, i2c_init() + * is called before the console and ram is initialized. Suppress + * printf until the console is initialized. */ +#define printf(format, arg...) if (gd->have_console) printf(format, ## arg) +#endif + struct mpc5xxx_i2c_tap { int scl2tap; int tap2tap;