Hi,

Is anyone aware of the compatibility of I2C controller in MPC8245 and MPC8240? 
Now DENX supports i2c-algo-8240.c in its distribution. Is this algorithm 
working for MPC8245's I2C controller? It should be.

However I have some problem using this module on my custom MPC8245 board. There 
is no problem for write. Data seems to be written into SEEPROM. The following 
message is captured by the i2c monitor.
Msg     3 [Start]#A0[W][A]00[A]00[A]01[A]02[A]03[A]04[A][Stop]

But for read, only the first byte is returned when I try to read multiple 
bytes. The following messages show that I try to read 4 bytes at the beginning 
of SEEPROM.
Msg    14 [Start]#A0[W][A]00[A]00[A][Stop]
Msg    15 [Start]#A0[R][A]01[N]FF[N]FF[N]FF[N]FF[N][Stop]

I suspect that the i2c controller doesn't generate the ack bit, which is 
supposed to do so. Why does the controller generate ACK automatically for write 
operations but not for read operations?

Then I go back to check the code of i2c-algo-8240.c and find m8240_readbytes() 
has confused me.
        //m8240_iic_write(&i2c->i2ccr, M8240_I2CCR_TXAK, M8240_I2CCR_TXAK);
Why is TXAK set only after all multiple bytes are read? I think the ACK should 
be generated after each byte is read if the ACK is generated by the driver 
instead of the controller itself. Should TXAK be set during the initialization?

Thanks,
-Shawn.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/



Reply via email to