IMX6 wandboard and sony imx290 image sensor: mipi csi2 driver problem

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

IMX6 wandboard and sony imx290 image sensor: mipi csi2 driver problem

4,030 Views
u_kayacik
Contributor II

Hi friends,

I bought IMX6Q wandboard and avnet ov5640 camera module that works very well in 1920x1080 with 2 lane mipi csi2 interface. Then I started to derive our current sony imx290 image sensor driver from example ov5640 driver. On my imx290 module it doesnt need external clock source like on ov5640 24mhz, internal clock source produce 37.125mhz and ı probed it works well. Also there is not powerdown(pwd) signal , it is already used in ov5640. There is only reset (xclr) pin.

When ı tried to write with I2C it work well, i can write what ever i want to specific address. By the way my data rate 149mbps/lane and with ddr mode i need to capture 298mhz(my case is 4 lane). According to AN5305, it gives me 0x28 and i set like that in "mxc_mipi_csi2.c".

int mipi_csi2_reset(struct mipi_csi2_info *info)
{
    _mipi_csi2_lock(info);

    mipi_csi2_write(info, 0x0, MIPI_CSI2_PHY_SHUTDOWNZ);
    mipi_csi2_write(info, 0x0, MIPI_CSI2_DPHY_RSTZ);
    mipi_csi2_write(info, 0x0, MIPI_CSI2_CSI2_RESETN);

    mipi_csi2_write(info, 0x00000001, MIPI_CSI2_PHY_TST_CTRL0);
    mipi_csi2_write(info, 0x00000000, MIPI_CSI2_PHY_TST_CTRL1);
    mipi_csi2_write(info, 0x00000000, MIPI_CSI2_PHY_TST_CTRL0);
    mipi_csi2_write(info, 0x00000002, MIPI_CSI2_PHY_TST_CTRL0);
    mipi_csi2_write(info, 0x00010044, MIPI_CSI2_PHY_TST_CTRL1);
    mipi_csi2_write(info, 0x00000000, MIPI_CSI2_PHY_TST_CTRL0);
    /*mipi_csi2_write(info, 0x00000014, MIPI_CSI2_PHY_TST_CTRL1);*/
    mipi_csi2_write(info, 0x00000028, MIPI_CSI2_PHY_TST_CTRL1);
    mipi_csi2_write(info, 0x00000002, MIPI_CSI2_PHY_TST_CTRL0);
    mipi_csi2_write(info, 0x00000000, MIPI_CSI2_PHY_TST_CTRL0);

    mipi_csi2_write(info, 0xffffffff, MIPI_CSI2_PHY_SHUTDOWNZ);
    mipi_csi2_write(info, 0xffffffff, MIPI_CSI2_DPHY_RSTZ);
    mipi_csi2_write(info, 0xffffffff, MIPI_CSI2_CSI2_RESETN);

    _mipi_csi2_unlock(info);

    return 0;
}

I have several problems:

1) imx6q returns "mipi csi2 can not receive sensor clk!", i tihnk there is a problem with "0x28".

2) where can we change the csi2 lane number? lane number returns every time 1 (2lane) but i need it should be 3

3) because of image sensor clock source is provided internally, does "mclk" effect something in driver any where?

4) my dtsi is like below, it is derived also from wandboard ov5640 settings, how can i ensure that my virtual channel and ipu channel is ok? what does it mean csi_id?

imx290_mipi: imx290_mipi@1a {
compatible = "sony,imx290_mipi";
reg = <0x1a>;
clocks = <&clks 200>;
clock-names = "csi_mclk";
DOVDD-supply = <&reg_1p8v>;
AVDD-supply = <&reg_2p9v>;
DVDD-supply = <&reg_1p2v>;
rst-gpios = <&gpio1 6 1>; /* xclr */
ipu_id = <0>;
csi_id = <0>;
mclk = <37125000>;
mclk_source = <0>;
lanes = <4>;
};

5) In "Debug steps for customer MIPI sensor" document, there is a check defined like below, does my setting provide this?

  1. hsp_clk > ccm_pixel_clk/0.9 > (mipi_clk_lane frequency /(8bits*2))*Data_lane_number

    if you have any driver for sony cmos image sensor exp in csi2 settings,could you please share ? I hope that this qst helps to everyone in this work, best regards.
0 Kudos
5 Replies

1,607 Views
joanvicient
Contributor II

Hi Umit,

Did you suceed in making the IMX290 working with the wandboard? I am also working on a IMX290 driver and I am facing similar issues and maybe we can share some knowledge. My main issue is in the IPU side...The MIPI/CSI side seems to be working well.

Thanks

0 Kudos

1,607 Views
umitkayacik
Contributor I

Come on, isnt there anybody to help me?

0 Kudos

1,607 Views
alexandrechartr
Contributor II

Hi Umit KAYACIK,

I'm currently facing the same problem as you. I am trying to develop a driver for the IMX278 and I guess it is similar to your camera.

To answer some of your questions:

2) where can we change the csi2 lane number?

For the lane number, make sure your driver is based on OV5640_mipi and in the driver the CSI lane is set there:

   mipi_csi2_set_lanes(mipi_csi2_info); (where mipi_csi2_info take his information from DT)

3) because of image sensor clock source is provided internally, does "mclk" effect something in driver any where?

From what I've saw, "mclk" is not use anywhere in the driver. So, I don't think it affects anything.

4) my dtsi is like below, it is derived also from wandboard ov5640 settings, how can i ensure that my virtual channel and ipu channel is ok? what does it mean csi_id?

Everything is set in mipi_csi node:

&mipi_csi {
    ipu_id = <0>;
    csi_id = <0>;
    v_channel = <0>;
    lanes = <4>;
    status = "okay";
};

You can refer to this document: https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fcache.nxp.com%2Ffiles%2F32bit%2Fdoc%2F...  (Figure 2 will help you)

If you have anything new please let me know.

Best regards,

Alexandre

0 Kudos

1,607 Views
titusstalin
Contributor V

Hello Alexandre,

For me, I'm using the below camera and getting corrupted image.

Resolution : 2592 x 1944

FPS : 19 or maximum

Lane count = 4

I've configured the driver like mentioned below link.

Can you please help me ?

How to change the MIPI Clock in driver or dts file 

Here, one of the customer was able to get the picture at higher resolution, and he was changed the ccm_pixel_clk and aix_clk_root

https://community.nxp.com/thread/307065#comment-332645 

Any help ?

How we can up the higher resolution MIPI camera in imx6 using latest 3.14.52 kernel ?

0 Kudos

1,607 Views
umitkayacik
Contributor I

I still couldnt find solution, could you please help me?

0 Kudos