How to change the MIPI Clock in driver or dts file

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

How to change the MIPI Clock in driver or dts file

3,417 Views
titusstalin
Contributor V

Hello,

I have a camera which will provide the image 2592x1944 resolution at 19FPS RGB888 and 4 lane count used.

So here is the calculation.

PIXEL clock = 2592 x 1944 x 19 x 1.5(RGB888) x 1.35 (BI)    ==> 193.86MHz

MIPI Data rate = 193.86 x 16bit  ==>   3101Mbps

MIPI Clock =  3101 / 4 (lane count) / 2  = 3101 / 8  ==> 387.73MHz

DDR2 clock = 387.73 x 2 ==> 775.25MHz

Then I wrote 0x32 value in CSI2_PHY_TST_CTRL1 register.

As per the document Debug steps for customer MIPI sensor.docx

                           //  750-800MHz  :0x32   //783Mhz

mipi_csi2_write(info, 0x00000032, CSI2_PHY_TST_CTRL1

            

My question is that where I need to change this new clock settings for my camera ?

I'm using kernel version 3.14.52

Where I need to change the clock settings, driver or dts file ??

Thanks for the help.

Regards,

Titus S.

Labels (4)
0 Kudos
4 Replies

1,969 Views
igorpadykov
NXP Employee
NXP Employee

Hi Titus

please check Chapter 20 MIPI CSI2 Driver attached Linux Manual,

seems example described in Debug steps for customer MIPI sensor:

Example: -     mipi_csi2_write(info, 0x00000014, CSI2_PHY_TST_CTRL1);//ov5640 output clk

can be found in /linux/drivers/mxc/mipi/mxc_mipi_csi2.c, function mipi_csi2_reset()

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

0 Kudos

1,969 Views
titusstalin
Contributor V

Thanks Igor.

I'm aware that mipi_csi2_write lines of code in mxc_mipi_csi2.c but what I'm asking is that whether my calculation is correct and any other clock settings need to be changed ??

mipi_csi2_write(info, 0x00000014, CSI2_PHY_TST_CTRL1);//ov5640 output clk

We also should change the aix_clk_root,(and ccm_pixel_clock) for higher resolution.

Some Experience When Enable MIPI Camera 

I'm getting the same issue mentioned above post, getting distorted (not clear image) image for higher resolution.

1) Any dts need to change or clock drivers for aix_clk_root ?

2) My above calculation is correct ?

Can you please answer ?

0 Kudos

1,969 Views
eason-tang
Contributor III

Hi titusstalin‌:

Did you know how to modify aix_clk_root ?

I want to change the aix_clk_root,(and ccm_pixel_clock) for higher resolution too .

My BSP version is imx_4.1.15_2.0.0_ga.

But i am not find how to change.

Could you tell me ?

Best Regard

0 Kudos

1,969 Views
igorpadykov
NXP Employee
NXP Employee

Hi Titus

for changing clocks may be recommended to check Linux common clock framework

documentation:
https://www.kernel.org/doc/Documentation/clk.txt

http://elinux.org/images/b/b8/Elc2013_Clement.pdf

Best regards
igor

0 Kudos