AnsweredAssumed Answered

How to open ipu2 ,and how to comfirm it is working ?

Question asked by robing cao on Nov 19, 2015
Latest reply on Nov 25, 2015 by robing cao

How to open ipu2 ,and how to comfirm it is working ?

 

 

Hello , I have a problem about ipu2 .

 

 

My questions are "How to open ipu2 ,and how to comfirm it is working ?"

 

 

I'm use imx6q-var-som.dts and imx6qdl-var-som.dtsi to config ipu2. 

The kernel is fsl linux 3.10.53-ga version.

 

 

I want to use an ov9121 camera (on i2c3) through ipu2's channel.

 

 

After config the dts and compile the kernel and dts, boot linux, insert modules

  insmod fsl_csi.ko

  insmod csi_v4l2_capture.ko

  insmod ipu_bg_overlay_sdc.ko

  insmod ipu_csi_enc.ko

  insmod ipu_fg_overlay_sdc.ko

  insmod ipu_prp_enc.ko

  insmod ipu_still.ko

  insmod ov9121_camera.ko

  insmod mxc_v4l2_capture.ko

 

I thought i can capture pictures from /dev/video1 ,

  test_capture -d /dev/video1   

but not data or interrupt come

  cat  /proc/interrupts |head -n 10

   CPU0       CPU1       CPU2       CPU3      

  29:      13565       2396        652        328       GIC  twd

  34:          1          0          0          0       GIC  sdma

  35:          0          0          0          0       GIC  VPU_JPG_IRQ

  37:          0          0          0          0       GIC  2400000.ipu

  38:          8          0          0          0       GIC  2400000.ipu

  39:          0          0          0          0       GIC  2800000.ipu

  40:          0          0          0          0       GIC  2800000.ipu

  43:          1          0          0          0       GIC  galcore interrupt service for 2D

  44:          0          0          0          0       GIC  VPU_CODEC_IRQ

No ipu2 interrupts !

When I read  ipu2's register, kernel dead

  memtool -32 0x2a00000 0x10

But memtool -32 0x2600000 0x10  (for ipu1's register) is ok.

 

If I open camera1 , I can capture pictures from /dev/video0. 

So I guess ipu2 never had worked correctly.

 

 

Can you help me: "How to open ipu2 ,and how to comfirm it is working ?"

 

 

Here are some configs about this :

 

diff --git a/arch/arm/boot/dts/imx6q.dtsi b/arch/arm/boot/dts/imx6q.dtsi

index 75da84f..8419ea6 100644

--- a/arch/arm/boot/dts/imx6q.dtsi

+++ b/arch/arm/boot/dts/imx6q.dtsi

@@ -243,6 +244,19 @@

  ipu2 {

  pinctrl_ipu2_1: ipu2grp-1 {

  fsl,pins = <

+                                MX6QDL_PAD_EIM_A24__IPU2_CSI1_DATA19       0x80000000

+                                MX6QDL_PAD_EIM_A23__IPU2_CSI1_DATA18       0x80000000

+                                MX6QDL_PAD_EIM_A22__IPU2_CSI1_DATA17       0x80000000

+                                MX6QDL_PAD_EIM_A21__IPU2_CSI1_DATA16       0x80000000

+                                MX6QDL_PAD_EIM_A20__IPU2_CSI1_DATA15       0x80000000

+                                MX6QDL_PAD_EIM_A19__IPU2_CSI1_DATA14       0x80000000

+                                MX6QDL_PAD_EIM_A18__IPU2_CSI1_DATA13       0x80000000

+                                MX6QDL_PAD_EIM_A17__IPU2_CSI1_DATA12       0x80000000

+                                MX6QDL_PAD_EIM_A16__IPU2_CSI1_PIXCLK       0x80000000

+                                MX6QDL_PAD_EIM_DA10__IPU2_CSI1_DATA_EN     0x80000000

+                                MX6QDL_PAD_EIM_DA11__IPU2_CSI1_HSYNC       0x80000000

+                                MX6QDL_PAD_EIM_DA12__IPU2_CSI1_VSYNC       0x80000000

+#if 0

  MX6QDL_PAD_DI0_DISP_CLK__IPU2_DI0_DISP_CLK 0x10

  MX6QDL_PAD_DI0_PIN15__IPU2_DI0_PIN15       0x10

  MX6QDL_PAD_DI0_PIN2__IPU2_DI0_PIN02        0x10

@@ -272,6 +286,7 @@

  MX6QDL_PAD_DISP0_DAT21__IPU2_DISP0_DATA21  0x10

  MX6QDL_PAD_DISP0_DAT22__IPU2_DISP0_DATA22  0x10

  MX6QDL_PAD_DISP0_DAT23__IPU2_DISP0_DATA23  0x10

+#endif

  >;

  };

  };

 

  ##up is change ipu2's pads setting ,for parallel camera ov9121

 

 

 

diff --git a/arch/arm/boot/dts/imx6qdl-var-som.dtsi b/arch/arm/boot/dts/imx6qdl-var-som.dtsi

index 892ca8a..f8ebce3 100755

--- a/arch/arm/boot/dts/imx6qdl-var-som.dtsi

+++ b/arch/arm/boot/dts/imx6qdl-var-som.dtsi

@@ -207,6 +207,14 @@

  v4l2_cap_0 {

  compatible = "fsl,imx6q-v4l2-capture";

  ipu_id = <0>;

+ csi_id = <0>;

+ mclk_source = <0>;

+ status = "okay";

+ };

+

+ v4l2_cap_1 {

+ compatible = "fsl,imx6q-v4l2-capture";

+ ipu_id = <1>;

  csi_id = <1>;

  mclk_source = <0>;

  status = "okay";

@@ -255,6 +263,32 @@

  pu-supply = <&pu_dummy>; /* use pu_dummy if VDDSOC share with VDDPU */

};

 

  ##up ipu1 for /dev/video0, ipu2 for /dev/video1 , and ipu/csi channel

 

 

 

@@ -354,6 +388,22 @@

  mclk_source = <0>;

  };

 

+ camera1: ov9121@30 {

+ compatible = "ovti,ov9121";

+ reg = <0x30>;

+ pinctrl-names = "default";

+ pinctrl-0 = <&pinctrl_ipu1_2>;

+ clocks = <&clks 200>;

+ clock-names = "csi_mclk";

+ pwn-gpios = <&gpio3 13 1>;

+ rst-gpios = <&gpio4 10 0>;

+ ipu_id = <0>;

+ csi_id = <0>;

+ mclk = <24000000>;

+ mclk_source = <0>;

+ #status = "okay";

+ status = "disabled";

+ };

};

 

&i2c2 {

 

 

  ##up  camera1 on i2c1, use ipu1,csi 0,  close it  now,

 

 

 

@@ -438,6 +488,22 @@

                  compatible = "dallas,ds1307";

                  reg = <0x68>;

         };

+ camera2: ov9121@30 {

+ compatible = "ovti,ov9121";

+ reg = <0x30>;

+ pinctrl-names = "default";

+ pinctrl-0 = <&pinctrl_ipu2_1>;

+ clocks = <&clks 200>;

+ clock-names = "csi_mclk";

+ pwn-gpios = <&gpio3 11 1>;

+ rst-gpios = <&gpio3 10 0>;

+ ipu_id = <1>;

+ csi_id = <1>;

+ mclk = <24000000>;

+ mclk_source = <0>;

+ #status = "disabled";

+ status = "okay";

+ };

};

 

&iomuxc {

 

 

  ##up is camera2 on i2c3 , use ipu2, csi 1, open it

 

 

 

 

diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c

index e778a75..1f65f82 100644

--- a/arch/arm/mach-imx/mach-imx6q.c

+++ b/arch/arm/mach-imx/mach-imx6q.c

@@ -222,7 +222,7 @@ static void __init imx6q_csi_mux_init(void)

  if (of_machine_is_compatible("fsl,imx6q-sabresd") ||

  of_machine_is_compatible("fsl,imx6q-sabreauto") ||

  of_machine_is_compatible("fsl,imx6q-var-som"))

- regmap_update_bits(gpr, IOMUXC_GPR1, 1 << 19, 1 << 19);

+ regmap_update_bits(gpr, IOMUXC_GPR1, 3 << 19, 3 << 19);

  else if (of_machine_is_compatible("fsl,imx6dl-sabresd") ||

  of_machine_is_compatible("fsl,imx6dl-sabreauto") ||

  of_machine_is_compatible("fsl,imx6dl-var-som"))

 

  ##later , I will use two parallel cameras , chose both iomux,not mipi cameras

 

 

 

 

 

 

Thanks!

Outcomes