I came across an odd behavior of the iMX8M processor's MIPI-CSI camera input.
I have an AR0330 imager, which I wrote a driver for, and is working pretty neat.
The problem is, it only works if I use it with a single MIPI-CSI lane.
The moment I try to make it work with 1+ lanes (2 or 4), the image that gets in looses all the data on every other lane except "Lane 0" (at least that's what it looks like what's happening).
In the working configuration, my .dtsi looks like the following (the relevant parts):
This gets me the image, and I can switch between RAW8 and RAW12 image format after patching the mx6s_capture.c code, with the necessary V4L2 bits and pieces and toggling fsl,two-8bit-sensor-mode;. Everything works like a charm.
Now, when I switch the camera to 4-lane or 2-lane MIPI operation, I modify the following part of the device tree:
And obviously, my driver's register settings towards the camera, so that end also enables the 4-lane transmission.
At this point, I would expect the interface to work, but I might be missing something.
After I deploy my new device tree, I see the target booting with the new configuration:
[ 1.710335] CSI: Registered sensor subdevice: mxc-mipi-csi2.0
[ 1.714820] mxc-mipi-csi2_yav 30a70000.mipi_csi: Remote device at /mipi_csi1@30a70000/port/endpoint1 XXX found
[ 1.723539] mxc-mipi-csi2_yav 30a70000.mipi_csi1: lanes: 4, name: mxc-mipi-csi2.0
[ 3.999571] mxc-mipi-csi2_yav 30a70000.mipi_csi: Registered sensor subdevice: ar0330 3-0010
I have verified the signals with an oscilloscope and they work as expected, so the data definitely gets up until the device's pads, but unfortunately they seem to stop right there.
Also verified if the polarities are right, but that's also fine. + is + and - is - , so at this point I'd rule out HW problems.
The PCB is simulated using CST-Studio, hence I'd also doubt signal integrity problems, more so because a single lane with the same PCB can receive 4x the datarate, so I'd expect if I have the data rate's 1/4th on the other lanes, routed extremely similarly, that must not be a problem.
I'm not entirely sure where to go for documentation as well, because it seems like the iMX8M Reference Manual has almost zero information on the CSI interface, and there are only 1-2 replies in forums saying that this device is somewhat of a mix of the iMX7 and iMX6 interfaces, regarding MIPI and CSI (?!)
Please let me know if I'm missing any documentation or driver.
Right now I'm using Yocto with kernel 4.9.51-imx_4.9.51, but I checked and none of these drivers received any update in 4.14.78.
There seems to be this reference to an upcoming driver in the freescale .dtsi file:
fs, imx8mq-csi -> Is this something that's available somewhere or is it in the makes? Maybe that's what'll be needed for more lanes to work?
Thank you in advance for your answers!