Hi,
First I want to show the following diagram:

We can see that IMX6Q has two IPUs. Each IPU has two inputs: CSI0 and CSI1. It makes four possible inputs:
1) ipu = 0, csi = 0
2) ipu = 0, csi = 1
3) ipu = 1, csi = 0
4) ipu = 1, csi = 1
Looking at device tree include file (provided with linux kernel), we can see the following description of OV5640 sensor connected through MIPI (serial, not parallel) interface:
/* ov5640 camera module */
&i2c2 {
ov5640_mipi: ov5640_mipi@3c { /* i2c2 driver */
compatible = "ovti,ov5640_mipi";
reg = <0x3c>;
clocks = <&clks 201>;
clock-names = "csi_mclk";
DOVDD-supply = <&vgen4_reg>; /* 1.8v */
AVDD-supply = <&vgen3_reg>; /* 2.8v, rev C board is VGEN3
rev B board is VGEN5 */
DVDD-supply = <&vgen2_reg>; /* 1.5v*/
pwn-gpios = <&gpio1 19 1>; /* active low: SD1_CLK */
rst-gpios = <&gpio1 20 0>; /* active high: SD1_DAT2 */
ipu_id = <0>;
csi_id = <1>;
vc = <0>;
mclk = <24000000>;
mclk_source = <0>;
status="okay";
};
};
As we can ipu = 0, and csi = 1 for MIPI camera. OV5640 sensor works fine through MIPI interface. However I don't understand why we use "&i2c2" (i2c bus number 2).
Now I want to connect OV5640 through parallel interface - Parallel 0. "i2cdetect" command sees our sensor on i2c bus number 0, address 0x3c. There is no examples for parallel interface configuration, however there are two OV5640 drivers: "ov5640_mipi" and "ov5640". Also looking at above picture I assume that we need to provide ipu = 0, csi = 0 to work with sensor connected to Parallel 0. And finally it appears that i2c bus number 0 is referenced by "&i2c1". So I change device tree description to the following:
&i2c1 {
ov5640: ov5640@3c { /* i2c2 driver */
compatible = "ovti,ov5640";
reg = <0x3c>;
clocks = <&clks 201>;
clock-names = "csi_mclk";
DOVDD-supply = <&vgen4_reg>; /* 1.8v */
AVDD-supply = <&vgen3_reg>; /* 2.8v, rev C board is VGEN3
rev B board is VGEN5 */
DVDD-supply = <&vgen2_reg>; /* 1.5v*/
pwn-gpios = <&gpio1 19 1>; /* active low: SD1_CLK */
rst-gpios = <&gpio1 20 0>; /* active high: SD1_DAT2 */
ipu_id = <0>;
csi_id = <0>;
vc = <0>;
mclk = <24000000>;
mclk_source = <0>;
status="okay";
};
};
And that does not work. Frame buffer is filled with zeroes.
In this thread:
OV5640 and OV5642 cameras on iMX6
Konstantyn Prokopenko says:
Check IPU configuration in drivers/mxc/ipu3
Make sure you enable proper channels for CSI0 and CSI1 either parallel or MIPI. (ipu_common.c)
Looking at IPU driver (ipu_common.c in /drivers/mxc/ipu3) I didn't find any mention of "parallel" at all. CSI0 and CSI1 channels are referred to by their integer codes "CSI_MEM0" and "CSI_MEM1", however there are another ones: "CSI_MEM2", "CSI_MEM3", "CSI_PRP_ENC_MEM", "CSI_PRP_VF_MEM", "MEM_PRP_VF_MEM", "MEM_VDI_PRP_VF_MEM", "DIRECT_ASYNC0", "DIRECT_ASYNC1" and so on.
There are bunch of another drivers that make direct use of IPU driver. For example ipu_csi_enc.c represents "IPU use case for video capture", it utilizes "CSI_MEM0" and "CSI_MEM1" channels. ipu_prp_enc.c represents "IPU use case for PRP ENC (what is this?)", and utilizes "CSI_PRP_ENC_MEM" channel, and so on.
So do I understand correctly that we need to set ipu = 0, csi = 0 to capture video from Parallel 0 interface? In this case video capturing will de done by ipu_csi_enc.c + ipu_common.c pair on first IPU's CSI_MEM0 channel.
Also there is such thing as IOMUXC_GPR1 register.
Bit 19 controls whether we accept data on IPU0 CSI0 from MIPI (set bit to 1) or from Parallel 0 (set bit to 0)
Bit 20 controls whether we accept data on IPU1 CSI0 from MIPI (set bit to 1) or from Parallel 1 (set bit to 0)
Probably we need to write this register to select parallel source.
Or do we have to configure IPU in another way?
Thank you