8xx: i2c-algo-8xx - fixed timeout detection and transmission errors

cajus.hahn at de.abb.com cajus.hahn at de.abb.com
Mon Aug 15 15:59:11 EST 2005





Hi Jocke,

I changed the force_reinit() to

// Disable interrupts.
i2c->i2c_i2cmr = 0;
i2c->i2c_i2cer = 0xff;
// Clear enable
i2c->i2c_i2mod &= ~1;
// Reset internal state
iip->iic_rstate = 0;
iip->iic_tstate = 0;

This seems to work and is less code than my old force_reinit().
On the other hand: This kind of CPM timeout will only occur on heavy I2C
bus conflicts. They should not appear at all. The code will not be executed
if a slave device does not answer! The original driver is from the year
2001 and nobody has mentioned problems of this kind before. Without
detailed knowledge of the CPM internals I feel much safer using my old
force_reinit(), which does a complete re-init.

Cajus




More information about the Linuxppc-embedded mailing list