AnsweredAssumed Answered

Camera porting guide for MIPI-CSI2 on i.MX8M?

Question asked by Michael Tang on Sep 10, 2018
Latest reply on Sep 10, 2018 by Michael Tang

Hi, I'm using a i.MX8M EVK to port a driver for my camera over MIPI CSI2. I wondered if there's a porting guide or application note about the camera interface, because the closest document I found is IMXBSPPG (Rev. L4.9.51_imx8mq-ga 03/2018), and it is talking about how to port a camera to i.MX6 series processor. Although they had a few common settings but it is very confused in blur area. So I'm trying to study the source code with reference manual 'IMX8MDQLQRM' but some of the IP/register wasn't describing clearly in source code and reference manual.

 

I had already created a I2C camera driver and could start the stream at camera side (camera is output data through MIPI interface, measured by oscilloscope), but there's no image been captured in system, so I need to find out what's the issue in my video pipeline.

 

There're some difference between OV5640 and my camera, like pixel format, pixel length, MIPI speed and frame rate. I'm trying to change the MIPI clock in 
fsl-imx8mq.dtsi:

mipi_csi_1: mipi_csi1@30a70000 {
   compatible = "fsl,mxc-mipi-csi2_yav";
   reg = <0x0 0x30a70000 0x0 0x1000>; /* MIPI CSI1 Controller base addr */
   interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>;
   clocks = <&clk IMX8MQ_CLK_DUMMY>,
   <&clk IMX8MQ_CLK_CSI1_CORE_DIV>,
   <&clk IMX8MQ_CLK_CSI1_ESC_DIV>,
   <&clk IMX8MQ_CLK_CSI1_PHY_REF_DIV>;
   clock-names = "clk_apb", "clk_core", "clk_esc", "clk_pxl";
   assigned-clocks = <&clk IMX8MQ_CLK_CSI1_CORE_DIV>,
   <&clk IMX8MQ_CLK_CSI1_PHY_REF_DIV>,
   <&clk IMX8MQ_CLK_CSI1_ESC_DIV>;
   // assigned-clock-rates = <133000000>, <100000000>, <66000000>;
   assigned-clock-rates = <266666666>, <800000000>, <400000000>;
      ...
};

The target MIPI clock is 800MHz, I'm not quite sure the requirement between clk_core, clk_phy and clk_esc, is there anything else to be considered or modified in source code, like mipi_csi2_yav.c?

And I saw an article are talking about the pixel format, we need to extend the mx6s_capture.c for suiting our sensor, is there any document? It's not very easy to match the register with reference manual.

Outcomes