From: "Krzysztof Hałasa" <khalasa@piap.pl>
To: linux-media <linux-media@vger.kernel.org>,
lkml <linux-kernel@vger.kernel.org>
Subject: Sony IMX290/462 image sensors I2C xfer peculiarity
Date: Fri, 29 Sep 2023 12:53:21 +0200 [thread overview]
Message-ID: <m3y1gpw8ri.fsf@t19.piap.pl> (raw)
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
next reply other threads:[~2023-09-29 10:53 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-29 10:53 Krzysztof Hałasa [this message]
2023-09-29 13:33 ` Sony IMX290/462 image sensors I2C xfer peculiarity 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3y1gpw8ri.fsf@t19.piap.pl \
--to=khalasa@piap.pl \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.