[U-Boot] Boot based on I2C EEPROM value

Wolfgang Denk wd at denx.de
Fri Feb 19 00:16:59 CET 2010


Dear "Canchivaram, Srivatsan",

In message <E3B2C7C726B07C4FA70FFAED2C8A2E6ABFF08D at owa.usmonolithics.com> you wrote:
> 
> Thanks for the response. I was able to use the 'eeprom' command to read
> from the I2C device and copy to memory. 
> With the itest.b command, the comparison always resulted in false even
> when the condition itself was true i.e.
> 
> mw.b 0x200000 1
> if itest.b *0x200000 -eq 1
> This would result as false.
> 
> Through debug of the itest code, I found out the reason to be
> endianness. My target is the PowerPC. Therefore, the itest.b's read of
> address *200000 always returned Byte 3 instead of Byte 0. 

Argh...

> I am able to workaround this issue by forcing the itest function to read
> the correct byte. Do you know if there is any patch available for Big
> Endian in any of the recent versions? Or is this something that needs to
> be added to the source code? I am using version 1.3.3.

This is a bug still present in current code. evalexp() in
"common/cmd_itest.c" does not pay atention to any ".b" or ".w"
modifiers.

This needs to be fixed. Patches are welcome!

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
panic: can't find /


More information about the U-Boot mailing list