I am trying to capture RGB888 data via the MIPI-CSI2 link on an IMX8M.
I had to modify the mx6s_capture.c driver to set the PARALLEL24_EN bit in register CSIRC18 (otherwise all I got was bits 2-9 of each 24-bit pixel). Setting the PARALLEL24_EN bit got me all 24 bits of the RGB888 pixels, but unfortunately it looks as though the CSI bridge is padding a zero byte onto each pixel, so that the pixels go from 24 bits wide to 32 bits wide. That is, each 32-bit word in the bridge fifo contains a 24-bit RGB pixel with a zero byte added as padding.
The IMX7 reference manual states -- section 184.108.40.206.3 -- (for some bizarre reason, the CSI bridge is completely undocumented in the IMX8M manual, you *really* need to fix that)
An optional scheme to pack a dummy byte is provided. For every group of 3 bytes data, a
dummy zero is packed to form a 32-bit word as shown in the figure below. The dummy
zero can be packed at the LSB position or MSB position. Using
RGB888A_FORMAT_SEL in CSI_CSICR18 to determine to put the dummy bytes
packed at LSB or MSB position.
I see the bit in CSICR18 that controls *where* the zero byte gets added (lsb v msb), but I don't see any bit that stops the zero-byte padding altogether, as the first sentence in the above quote suggests.
Is there a way to disable the zero-byte padding for RGB888 data?
Alternatively, is there any way to make the zero pad byte drop away when transferring data out of the bridge fifo? (Other than software repacking the image data?)
I've run into the same issue with an i.MX6ULL. So no MIPI, but same 24-bit CSI interface. PARALLEL24_EN in CSI_CSICR18 is set, and TWO_8BIT_SENSOR in CSI_CSICR3 is unset. I get exactly what email@example.com reported: the (correct) 3 bytes of RGB24 image data, with with a 0-byte added to pad every pixel out to 32 bits. Most frustratingly, CSI_CSICR3 has a ZERO_PACK_EN bit that purports to enable/disable this exact feature, but does not:
Just for the sake of trying everything, I attempted to set that bit as well, but with no change in behavior. The throughput advantage of the 24-bit input is useless if the resulting image data needs to be software-unpacked to remove the zero bytes. Certainly there must be a way around this?
i.mx 6ull imx 6ull 6ull csi imx6 24-bit rgb888 rgb24 zero_pack_en #parallel24_en
Do you figure out this question? I have come across the same problem, and I did what you did before, but it does not work, is there some detials to pay attention to?
For anyone stumbling upon this thread.
You cannot receive packed RGB888 (RGB24) from the CSI-reciever on the IMX6/IMX7/IMX8.
What you have to do is enabling PARALLEL24_EN in CSIRC18 and receive the data as XBGR32.