I have modified ov5640_mipi.c to support my camera sensor, ov4188. I2C communication works fine to read/write sensor register or control power, etc,..
In .dtsi file:
ipu_id = <0>;
csi_id = <1>;
v_channel = <0>;
lanes = <4>;
Linux kernel 3.10.53
However, MIPI_CSI_PHY_STATE is always 0x2f0 and when querying frame, it returns
"ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0"
I tried all dphy clock range in Debug steps for customer MIPI sensor.docx ( https://community.freescale.com/docs/DOC-94312#comment-29669 ), but no help. I also adjust PLL settings of the camera sensor to attain a good clock range as the Debug document, but it's still not correct.
After that, I found ov5640 datasheet to calculate mipi clk. It's 56Mhz, not 849Mhz.
Register address value
So, I am very curious about how to calculate ov5640 output clk to map 0x00000014 to csi2 as the following line:
mipi_csi2_write(info, 0x00000014, CSI2_PHY_TST_CTRL1);//ov5640 output clk
Can anyone show me how to calculate mipi dphy clk correctly? And what's problem with mipi_phy_state?
Thank you very much!!!
Please see attach file for OV5640 PLL diagram