summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Wilson <evan@oliodevices.com>2014-04-08 15:46:05 -0700
committerEvan Wilson <evan@oliodevices.com>2014-04-08 15:46:05 -0700
commit431fa94837b5a19acf928f7192773619833a00c5 (patch)
treef708cd427c3d82d4c019d44b05c9c54733623c28
parentdd5f26e797f8d28baeff52ae7ed3587cf602c601 (diff)
downloadolio-uboot-2014.01-H1-2012.04.01.tar.xz
olio-uboot-2014.01-H1-2012.04.01.zip
arm: omap: i2c: don't zero cnt in i2c_writeH1-2012.04.01
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@denx.de> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Tom Rini <trini@ti.com> Cc: Lubomir Popov <lpopov@mm-sol.com> Cc: Enric Balletbo Serra <eballetbo@gmail.com> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Tested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Tested-by: Lubomir Popov <lpopov@mm-sol.com> Conflicts: drivers/i2c/omap24xx_i2c.c
-rw-r--r--drivers/i2c/omap24xx_i2c.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/i2c/omap24xx_i2c.c b/drivers/i2c/omap24xx_i2c.c
index 3a50417b5..5a358f72d 100644
--- a/drivers/i2c/omap24xx_i2c.c
+++ b/drivers/i2c/omap24xx_i2c.c
@@ -144,7 +144,6 @@ void i2c_init(int speed, int slaveadd)
udelay(1000);
flush_fifo();
writew(0xFFFF, &i2c_base->stat);
- writew(0, &i2c_base->cnt);
if (gd->flags & GD_FLG_RELOC)
bus_initialized[current_bus] = 1;
@@ -218,7 +217,6 @@ static int i2c_read_byte(u8 devaddr, u8 regoffset, u8 *value)
read_exit:
flush_fifo();
writew(0xFFFF, &i2c_base->stat);
- writew(0, &i2c_base->cnt);
return i2c_error;
}
@@ -293,8 +291,6 @@ int i2c_probe(uchar chip)
probe_exit:
flush_fifo();
- /* don't allow any more data in... we don't want it. */
- writew(0, &i2c_base->cnt);
writew(0xFFFF, &i2c_base->stat);
return res;
}