[U-Boot] [U-Boot, V2] arm: omap: i2c: don't zero cnt in i2c_write

Heiko Schocher hs at denx.de
Mon Dec 9 07:57:14 CET 2013


Hello Nikita,

Am 28.11.2013 17:04, schrieb Nikita Kiryanov:
> Writing zero into I2Ci.I2C_CNT register causes random I2C failures in OMAP3
> based devices. This seems to be related to the following advisory which
> apears in multiple erratas for OMAP3 SoCs (OMAP35xx, DM37xx), as well as
> OMAP4430 TRM:
>
> Advisory:
> I2C Module Does Not Allow 0-Byte Data Requests
> Details:
> When configured as the master, the I2C module does not allow 0-byte data
> transfers. Note: Programming I2Ci.I2C_CNT[15:0]: DCOUNT = 0 will cause
> undefined behavior.
> Workaround(s):
> No workaround. Do not use 0-byte data requests.
>
> The writes in question are unnecessary from a functional point of view.
> Most of them are done after I/O has finished, and the only one that preceds
> I/O (in i2c_probe()) is also unnecessary because a stop bit is sent before
> actual data transmission takes place.
>
> Therefore, remove all writes that zero the cnt register.
>
> Cc: Heiko Schocher<hs at denx.de>
> Cc: Thomas Petazzoni<thomas.petazzoni at free-electrons.com>
> Cc: Tom Rini<trini at ti.com>
> Cc: Lubomir Popov<lpopov at mm-sol.com>
> Cc: Enric Balletbo Serra<eballetbo at gmail.com>
> Signed-off-by: Nikita Kiryanov<nikita at compulab.co.il>
> Tested-by: Thomas Petazzoni<thomas.petazzoni at free-electrons.com>
> Tested-by: Lubomir Popov<lpopov at mm-sol.com>
>
> ---
> Changes in V2:	
> 	Removed all instances of writew(0,&i2c_base->cnt) instead of just the
> 	one in i2c_write (following a test of V1 by Thomas Petazzoni).
>
>   drivers/i2c/omap24xx_i2c.c | 6 ------
>   1 file changed, 6 deletions(-)

Thanks! Applied to u-boot-i2c.git.

bye,
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany


More information about the U-Boot mailing list