[U-Boot] Odd value for I2C_TIMEOUT in fsl_i2c.c

Timur Tabi timur at freescale.com
Fri Sep 4 20:39:26 CEST 2009


Wolfgang Denk wrote:

> Probably not. If you place a read request to a  slow  device  it  may
> take  tens  of milliseconds, or even longer - I have no idea. IIRC we
> had a box with a LCD display connected over  I2C,  which  didn't  ent
> into  production  as  originally designed because writing the content
> took over 100 millisec.

Well, that's an extreme case that is board-specific.  Perhaps I should do this:

#ifndef CONFIG_I2C_TIMEOUT
#define CONFIG_I2C_TIMEOUT	1000
#endif

Keep in mind that so far, the number 250 has been good enough for every board to date.  Why my current board is happier with 500 is a mystery to me.

Also, should we be using the same value for the timeout in i2c_wait4bus() and i2c_wait()?  It looks like i2c_wait() should have a much shorter timeout than i2c_wait4bus()?

-- 
Timur Tabi
Linux kernel developer at Freescale


More information about the U-Boot mailing list