On Sat, Mar 21, 2009 at 3:47 PM, Wolfgang Denk <w...@denx.de> wrote:
> Dear Jon,
>
> In message <20090321133844.11905.61201.st...@localhost> you wrote:
>> From: Sascha Hauer <s.ha...@pengutronix.de>
>>
>> On boards which have the environment in eeprom, i2c_init()
>> is called before the console and ram is initialized. Do
>> not printf here.
>>
>> Signed-off-by: Sascha Hauer <s.ha...@pengutronix.de>
>> ---
>>  cpu/mpc5xxx/i2c.c |   10 ----------
>>  1 files changed, 0 insertions(+), 10 deletions(-)
>
> Rather than doing this unconditionally, this change should only be
> implemented on boards which actually hold the envrionment in I2C
> EEPROM (alternatively, one should consider fixing these boards to use
> more appropriate storage; in addition to being not reliable, I2C
> EEPROM is slow - see
> http://www.denx.de/wiki/DULG/AN2004_11_BootTimeOptimization )
>

How about this instead?  Is there a variable that indicates when the
console is safe to use, if so I can adjust the macro.

From: Jon Smirl <jonsm...@gmail.com>

On boards which have the environment in eeprom, i2c_init()
is called before the console and ram is initialized. Do
not printf here.

Signed-off-by: Jon Smirl <jonsm...@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..40f1682 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. Do
+ * not printf here. */
+#define printf(format, arg...) do {} while (0)
+#endif
+
 struct mpc5xxx_i2c_tap {
        int scl2tap;
        int tap2tap;


-- 
Jon Smirl
jonsm...@gmail.com
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to