linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Sony IMX290/462 image sensors I2C xfer peculiarity
@ 2023-09-29 10:53 Krzysztof Hałasa
  2023-09-29 13:33 ` Dave Stevenson
  0 siblings, 1 reply; 13+ messages in thread
From: Krzysztof Hałasa @ 2023-09-29 10:53 UTC (permalink / raw)
  To: linux-media, lkml

Hi,

I am debugging certain IMX290 and IMX462 I2C failures on an NXP
i.MX6MP based board and there seem to be interesting "feature" here:
Sony IMX290 and IMX462 image sensors apparently terminate I2C transfers
after 2^18 of their master clock cycles. For example, with a typical
37.125 MHz clock oscillator, this means about 7 ms. In practice, I'm
barely able to read a block of 128 registers (at I2C 400 kHz clock
rate).

I think the sensors simply disconnect from the bus after 2^18 clock
cycles (starting from the first START condition, the repeated STARTs
don't reset the timeout). This means, in case of a READ operation, the
data read by the CPU after the timeout contains all bits set to 1.
i.MX8MP detects arbitration losses, so if the SDA change to 1 happens on
high clock value (but not on ACK bit), the whole transfer is aborted.
Otherwise, the ending bytes are simply set to FF (and the last non-FF
may be corrupted partially).

The problem is 7 ms is a short time and on a non-real time system even
a simple non-DMA I2C register writes can take as much time. This causes
driver failures.

Needless to say, the datasheets know nothing about the feature.

Any thoughts?
-- 
Krzysztof "Chris" Hałasa

Sieć Badawcza Łukasiewicz
Przemysłowy Instytut Automatyki i Pomiarów PIAP
Al. Jerozolimskie 202, 02-486 Warszawa

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2023-10-13 10:39 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-29 10:53 Sony IMX290/462 image sensors I2C xfer peculiarity Krzysztof Hałasa
2023-09-29 13:33 ` Dave Stevenson
2023-10-03 12:59   ` Krzysztof Hałasa
2023-10-10  9:46     ` Krzysztof Hałasa
2023-10-11  9:10       ` Krzysztof Hałasa
2023-10-11  9:50         ` Krzysztof Hałasa
2023-10-11 10:15           ` Stefan Lengfeld
2023-10-11 11:25             ` Krzysztof Hałasa
2023-10-11 11:59               ` Alexander Stein
2023-10-11 12:18                 ` Krzysztof Hałasa
2023-10-12 22:01               ` Stefan Lengfeld
2023-10-13  7:17                 ` Wolfram Sang
2023-10-13 10:39                 ` Krzysztof Hałasa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).