Want to interface customized camera in CSI

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Want to interface customized camera in CSI

Jump to solution
2,098 Views
titusstalin
Contributor V

Dear All,

I have nitrogen Sabrelite EVM board and I have customized camera module which supports RGB888/YUV422 10bit mode, I am able to get the frame using OV5640 MIPI camera, but I want to do the same with my customized camera so can you Please tell me what are all the changes I have to done to get a from my camera.

Using the different driver based on OV5640_mipi.c file but not sure whether I need to change anything.

PS: Don't want to configure the camera via i2c, once its up, camera will start providing the frames.

Thanks for the support.

Regards,

Titus S.

Labels (4)
0 Kudos
1 Solution
1,119 Views
titusstalin
Contributor V
0 Kudos
8 Replies
1,119 Views
igorpadykov
NXP Employee
NXP Employee

CSI can not capture YUV420, please check for CSI supported formats in Table 37-2. Data Formats
Supported By The Camera Port i.MX6DQ RM
http://cache.freescale.com/files/32bit/doc/ref_manual/IMX6DQRM.pdf
also regarding yuv420 capture one can check
https://community.nxp.com/thread/303414

0 Kudos
1,119 Views
titusstalin
Contributor V

Thanks for the reply.

Okay, I have changed the camera code to support RGB565 format and modified the "pix.pixelformat to V4L2_PIX_FMT_RGB565"

Now also I got the same set of values in MIPI registers.

Any help please ?

Do you know why the "MIPI_CSI2_PHY_STATE is in 0x210" ?

Why not 0x300 or 0x310 as single lane should have these values ?

0 Kudos
1,120 Views
titusstalin
Contributor V

I am able to solve the problem.

https://community.nxp.com/thread/437356

0 Kudos
1,119 Views
igorpadykov
NXP Employee
NXP Employee

please check the registers MIPI_CSI_ERR1 and 2. They must be 0x00.

In ov5640_mipi case (2 data lanes are used), the correct MIPI_CSI_PHY_STATE is
0x330 (and the bit 11 is jumping between 0 and 1, the value is jump between 0x330 and 0xb30).

May be useful to check :

https://community.nxp.com/docs/DOC-332436

https://community.freescale.com/docs/DOC-102233

Best regards
igor

0 Kudos
1,119 Views
titusstalin
Contributor V

Thanks for the reply.

If you refer to my last post, I have given complete MIPI registers including ERR1 and ERR2, it shows 0 for both of the Error status registers.

MIPI_CSI2_VERSION 3130302a
MIPI_CSI2_N_LANES 1
MIPI_CSI2_PHY_SHUTDOWNZ 1
MIPI_CSI2_DPHY_RSTZ 1
MIPI_CSI2_CSI2_RESETN 1
MIPI_CSI2_PHY_STATE 210
MIPI_CSI2_DATA_IDS_1 0
MIPI_CSI2_DATA_IDS_2 0
MIPI_CSI2_ERR1 0
MIPI_CSI2_ERR2 0
MIPI_CSI2_MASK1 0
MIPI_CSI2_MASK2 0
MIPI_CSI2_PHY_TST_CTRL0 0
MIPI_CSI2_PHY_TST_CTRL1 4444
MIPI_CSI2_SFT_RESET 0

What should I write in "MIPI_CSI2_PHY_TST_CTRL1" and "MIPI_CSI2_PHY_TST_CTRL0" registers for my sensor (provided the details of my sensor)

Also what I need to check to get the expected value in MIPI_CSI2_PHY_STATE ??

0 Kudos
1,119 Views
igorpadykov
NXP Employee
NXP Employee

Hi Titus

please check Debug steps for customer MIPI sensor.docx
https://community.freescale.com/docs/DOC-94312
AN5305 MIPI–CSI2 Peripheral on i.MX6 MPU
http://cache.nxp.com/files/32bit/doc/app_note/AN5305.pdf

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
1,119 Views
titusstalin
Contributor V

Hi Igor,

Thanks for the reply.

I have dumped the MIPI registers here,

I have created the V4L2 application and attached the log, driver didn't call the "camera_callback" function to proceed "QBUF"

MIPI_CSI2_VERSION 3130302a
MIPI_CSI2_N_LANES 1
MIPI_CSI2_PHY_SHUTDOWNZ 1
MIPI_CSI2_DPHY_RSTZ 1
MIPI_CSI2_CSI2_RESETN 1
MIPI_CSI2_PHY_STATE 210
MIPI_CSI2_DATA_IDS_1 0
MIPI_CSI2_DATA_IDS_2 0
MIPI_CSI2_ERR1 0
MIPI_CSI2_ERR2 0
MIPI_CSI2_MASK1 0
MIPI_CSI2_MASK2 0
MIPI_CSI2_PHY_TST_CTRL0 0
MIPI_CSI2_PHY_TST_CTRL1 4444
MIPI_CSI2_SFT_RESET 0

Device tree changes:

    custom_mipi: custom_mipi@ac {
        compatible = "ov,custom_mipi";
        reg = <0xac>;
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_i2c2_ov5640_mipi>;
        clocks = <&clks IMX6QDL_CLK_PWM3>;
        clock-names = "csi_mclk";
        DOVDD-supply = <&reg_1p8v>;
        AVDD-supply = <&reg_2p5v>;
        DVDD-supply = <&reg_1p8v>;
        pwn-gpios = GP_OV5640_MIPI_POWER_DOWN;
        rst-gpios = GP_OV5640_MIPI_RESET;
        ipu_id = <1>;//        ipu_id = <1>;
        csi_id = <0>;//        csi_id = <0>;
        mclk = <188000000>;//Titus//22000000
        mclk_source = <0>;
        pwms = <&pwm3 0 45>;
    };

&custom_mipi {
    ipu_id = <1>;
    csi_id = <0>;
};

drivers/mxc/mipi/mxc_mipi_csi2.c

//    mipi_csi2_write(info, 0x00000014, MIPI_CSI2_PHY_TST_CTRL1);//Default OV5640_mipi camera
    mipi_csi2_write(info, 0x00000044, MIPI_CSI2_PHY_TST_CTRL1); //180MHz to 200MHz

Can you please tell me what could be the problem for not getting/receiving the interrupt ?

What are the things need to change the camera driver.

PS: I have used ov5640_mipi.c driver.

Customized Camera details:

We don't want to configure the sensor, default it will generate the frame at 800x600 45fps in YUV420 8bit format (data type is 18)

Camera sensor bit clock is 48MHz

Camera MIPI TX is configured for 1.5Gbps

Byte clock is 187.5MHz

1 Lane

8bit parallel data

Thanks for the support.

Please let me know if you need further information.

Regards,

Titus S.

0 Kudos
1,119 Views
titusstalin
Contributor V

Hi Igorpadykov,

Can you please provide any insights on this issue ?

Whether I'm getting correct value for all the MIPI CSI2 registers ?

PHY state looks different, can you please tell me what can I do to address this problem too ?

MIPI_CSI2_PHY_STATE 210

Thanks for your help!

0 Kudos