Issue with using MIPI-CSI 4-Lane on i.MX8MM

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Issue with using MIPI-CSI 4-Lane on i.MX8MM

跳至解决方案
5,431 次查看
namanthaker
Contributor IV

Hello,

I am using a 3rd-party ISP+Sensor combo with i.MX8M Mini and facing an issue when using 4-lane configuration.

When I use 1-lane or 2-lane, I am able to capture from camera successfully. But when I use 4-lanes, I am unable to capture anything. I have measured MIPI signals on all 4-lanes from sensor to IMX8MM and they are fine. 

1-lane DTS configuration:
mipi1_sensor_ep: endpoint@1 {
remote-endpoint = <&camera>;
data-lanes = <1>;
csis-hs-settle = <13>;
csis-clk-settle = <2>;
csis-wclk;
};

2-lane DTS configuration:
mipi1_sensor_ep: endpoint@1 {
remote-endpoint = <&camera>;
data-lanes = <2>;
csis-hs-settle = <13>;
csis-clk-settle = <2>;
csis-wclk;
};

4-lane DTS configuration:
mipi1_sensor_ep: endpoint@1 {
remote-endpoint = <&camera>;
data-lanes = <1 2 3 4>;
csis-hs-settle = <13>;
csis-clk-settle = <2>;
csis-wclk;
};

I also tried to use "data-lanes = <4>", but got same issue.

This issue is reported in another post (link is below). The solution in that post is to use 1-lane only. But that solution is not feasible for me as I need to use higher resolution at later stage. I tried the other suggestions from this post but none of them worked.
https://community.nxp.com/t5/i-MX-Processors/iMX8M-MIPI-CSI-4-lane-configuration/m-p/875755

Q1: Is 4-lane configuration validated on IMX8MM? Any information about the use-case/testing done with 4 lanes will be appreciated.?
Q2: Is there a patch or changes needed to enable 4-lane configuration?
Q3: Any debug pointers to resolve this issue?

Regards,
Naman

标签 (1)
0 项奖励
1 解答
4,695 次查看
namanthaker
Contributor IV

Hello,

We have managed to get 4-lane working on i.MX8M Mini. We disassembled the entire setup and reworked it again and made a new clean SW build to test. I have attached the patch used to get 4-lane working which is same as the changes suggested in this thread.

Thank you very much for your support with the issue!

Regards,
Naman Thaker

在原帖中查看解决方案

0 项奖励
27 回复数
4,696 次查看
namanthaker
Contributor IV

Hello,

We have managed to get 4-lane working on i.MX8M Mini. We disassembled the entire setup and reworked it again and made a new clean SW build to test. I have attached the patch used to get 4-lane working which is same as the changes suggested in this thread.

Thank you very much for your support with the issue!

Regards,
Naman Thaker

0 项奖励
4,772 次查看
joanxie
NXP TechSupport
NXP TechSupport

what resolution and frame rate do you need to support? what bsp do you use? what clock frequency do you set ?

 

0 项奖励
4,756 次查看
namanthaker
Contributor IV

Hi @joanxie ,

I am using 1080p@30hz resolution on Yocto L5.4.47-2.2.0. This resolution is just for testing purpose, my actual use-case will be 5MP@30Hz.

I have not set any clock frequency for MIPI-CSI or MCLK in i.MX8MM. The MCLK (48MHz) is generated through external oscillator.

Attached dts file for reference.

Regards,
Naman

0 项奖励
4,753 次查看
joanxie
NXP TechSupport
NXP TechSupport

what camera do you use? as I known, ov5640 only support 1-lane and 2-lane,1Gbps max per lane, so you need confirm your camera could support this first.

0 项奖励
4,729 次查看
namanthaker
Contributor IV

Hi @joanxie ,

I am using a 3rd Party Camera sensor and ISP combo. It does support MIPI 4-lane which I have tested and checked on its EVM.

When I am using 4-lane configuration, I am seeing MIPI signals on all 4 lanes and they are same as when using 2-lane configuration. So, I do not doubt the issue to be on the camera side.

Regards,
Naman

0 项奖励
4,715 次查看
joanxie
NXP TechSupport
NXP TechSupport

first, you need confirm if your senor set 4-lane already, then tell me what data format you use? currently, development team validated 4k@30 yuv422 on imx8mm successfully, on dts settings are:
data-lanes = <4>;
csis-hs-settle = <13>;
csis-clk-settle = <2>;
 csis-wclk;

0 项奖励
4,702 次查看
namanthaker
Contributor IV

Yes, I have confirmed that the sensor is set at 4-lane configuration and I am trying to capture YUV422 (UYVY) format at 1080@30fps.

0 项奖励
4,678 次查看
joanxie
NXP TechSupport
NXP TechSupport

try to enable double pixel mode in the mipi driver as below:

add this in the drivers/media/platform/mxc/capture/mx6s_capture.c

case V4L2_PIX_FMT_UYVY:
case V4L2_PIX_FMT_YUYV:
cr18 |= BIT_MIPI_DATA_FORMAT_YUV422_8B;
+ cr18 |= BIT_MIPI_DOUBLE_CMPNT;
break;

in the drivers/media/platform/mxc/capture/mxc_mipi_csi.c:

mipi_csis_formats[] = {
.fmt_reg = MIPI_CSIS_ISPCFG_FMT_YCBCR422_8BIT,
.data_alignment = 16,
}, {
+ .code = MEDIA_BUS_FMT_UYVY8_2X8,
+ .fmt_reg = MIPI_CSIS_ISPCFG_FMT_YCBCR422_8BIT,
+ .data_alignment = 16,
+ }, {
.code = MEDIA_BUS_FMT_SBGGR8_1X8,
.fmt_reg = MIPI_CSIS_ISPCFG_FMT_RAW8,
.data_alignment = 8,
@@ -486,6 +490,8 @@ static void __mipi_csis_set_format(struct csi_state *state)
/* Color format */
val = mipi_csis_read(state, MIPI_CSIS_ISPCONFIG_CH0);
val = (val & ~MIPI_CSIS_ISPCFG_FMT_MASK) | state->csis_fmt->fmt_reg;
+ val |= MIPI_CSIS_ISPCFG_DOUBLE_CMPNT;
+
mipi_csis_write(state, MIPI_CSIS_ISPCONFIG_CH0, val);

0 项奖励
4,652 次查看
namanthaker
Contributor IV

Hi @joanxie ,

I tried the above suggested changes, but still unable to capture 4-lane data.

Regards,
Naman

0 项奖励
4,628 次查看
joanxie
NXP TechSupport
NXP TechSupport

if you can get correct signal from 4lane by oscilloscope, you need to check csis-hs-settle=<13>; this is calculated by the bit rate per lane

 

0 项奖励
4,508 次查看
namanthaker
Contributor IV
 
Could you share below information about the 4-lane validation on i.MX8M Mini:
1. What was the sensor used for testing? As I understand, OV5640 supports up to 2-lane only.
2. Was the 4-lane data validated by observing the signals using scope on MIPI data lanes? If yes, could you share the images of the signals for reference if possible?
3. Could you share the complete DTS file used by the development team for validating 4-lane?
 
Regards,
Naman Thaker
标记 (3)
0 项奖励
4,585 次查看
namanthaker
Contributor IV

I set HS settle to 19 as I am using 448Mhz MIPI clock (measured using scope). One of the comments explained that the table is for DDR so I need the HS Settle value for 896Mhz which is 19.

Still I am unable to capture the 4-lane data.

Please correct me if my understanding is incorrect.

0 项奖励
4,538 次查看
joanxie
NXP TechSupport
NXP TechSupport

I have sent to you a reference dts file for 4lane, pls check it

 

0 项奖励
4,513 次查看
namanthaker
Contributor IV

I have not yet received the DTS file. Could you please share it again? Also, please let me know how you have sent the file.

0 项奖励
4,499 次查看
joanxie
NXP TechSupport
NXP TechSupport

if you still failed with this, pls dump the mipi csi register, let me double check it, and send the log file (include 2-lane and 4-land,and confirm if you can get the correct data from the 4-lane on sensor side

0 项奖励
4,414 次查看
namanthaker
Contributor IV

Hi @joanxie ,

Based on the patch I made a correction of adding "fsl,two-8bit-sensor-mode" property in the dts. Otherwise everything seems same. I still need to test with this property enabled.

My i.MX8MM + Camera setup needs some HW rework, as some of the wires are damaged. Getting them repaired will take me some time.
As soon as I have setup repaired I will test with the mentioned property and if it does not work I will capture the 2-lane and 4-lane logs and share them with you.

In the meantime could you please share me the steps to dump the mipi csi register?

Regards,
Naman

0 项奖励
4,402 次查看
joanxie
NXP TechSupport
NXP TechSupport

let me remind again,  you need to confirm you can get the proper data of each 4-lane from the camera side, and double  confirm if you set your camera correct or not, and you can dump the registers of setting 2-lane and 4-lane, then compare with them

0 项奖励
4,273 次查看
namanthaker
Contributor IV

Hi @joanxie ,

From the patch I did not find any differences which could impact the CSI other than "fsl,two-8bit-sensor-mode" property. As you suspected, adding this property did not change anything, the issue still persists.

I have re-confirmed that proper data is coming on all 4-lanes from the camera.

I have shared the dmesg logs (for 2-lane and 4-lane) along with the source files for each case with FAE who will share it with you for your reference. Maybe you could find something that I might have missed.

Furthermore, I am unable to read MIPI CSI registers using memtool. The board hangs with below logs when I read any of the MIPI CSI registers.
root@imx8mmevk:~# /unit_tests/memtool -32 0x32E30004 4
E
Reading 0x4 count starting at address 0x32E30004

This happens with all MIPI CSI registers in working and non-working case, before or after I take a picture. I tried to read other registers like GPIO or PMIC and I am able to read them successfully.
Please suggest a way to solve the issue or an alternative to read the registers.

0 项奖励
4,237 次查看
joanxie
NXP TechSupport
NXP TechSupport

I didn't get the log file, you can put here

I can read the register by memtool, if you don't use memtool, you also can use debug tool to read, let me reproduce this tomorrow, and what camera do you use? it seems this issue doesn't belong to the imx8mm side, since we have already verified 4lanes on the camera successfully

 

 

0 项奖励
4,219 次查看
namanthaker
Contributor IV

Hi @joanxie ,

Attached the files here for reference.

Regards,
Naman

0 项奖励