Enabling Parallel camera with VAR DT6 custom board

cancel
Showing results for 
Search instead for 
Did you mean: 

Enabling Parallel camera with VAR DT6 custom board

1,435 Views
prashs
Contributor I


Hi,

I am trying to enable Parallel Camera interface on iMX6QDL-VAR-DT6 Custom board. I am using e-CAM51_CU5640_MOD OV5640 Camera module and is connected to the VAR-DT6 custom board J11 parallel camera interface via a custom interface board. As per the VAR DT6 Custom board documentation, this is directly connected to the IPU2 CSI 1 interface of the IMX6 processor. Accordingly I have made the following changes in the Linux Source code (Version  3.14.38-6QP) (The yocto release version information is VAR-SOM-MX6 - Yocto fsl-3.14.38_6qp Fido R2 Build Yocto release)

1. mach-imx6q.c

static void __init imx6q_csi_mux_init(void)

{

.....

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

                         of_machine_is_compatible("fsl,imx6dl-sabreauto"))

                        regmap_update_bits(gpr, IOMUXC_GPR13, 0x3F, 0x0C);

else if (of_machine_is_compatible("fsl,imx6q-var-dart"))

                {                     

                        regmap_update_bits(gpr, IOMUXC_GPR1, 1 << 20, 1 << 20);                      

               }

....

}

2. imx6qdl-var-dart.dtsi

v4l2_cap_1 {

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

ipu_id = <1>;

csi_id = <1>;

mclk_source = <0>;

status = "okay";

};

ov5640: ov564x@3c {

compatible = "ovti,ov564x";

reg = <0x3c>;

clocks = <&clks 201>;

clock-names = "csi_mclk";

pinctrl-names = "default";

pinctrl-0 = <&pinctrl_ipu1_2>;

pwn-gpios = <&gpio3 3 1>;

rst-gpios = <&gpio3 10 0>;

csi_id = <1>;

mclk = <24000000>;

mclk_source = <0>;

};

pinctrl_ipu1_2: ipu1grp-2 { /* parallel camera */

fsl,pins = <


MX6QDL_PAD_EIM_D28__IPU2_CSI1_DATA12 0x0001B0B0

MX6QDL_PAD_EIM_D27__IPU2_CSI1_DATA13 0x0001B0B0

MX6QDL_PAD_EIM_D26__IPU2_CSI1_DATA14 0x0001B0B0

MX6QDL_PAD_EIM_D20__IPU2_CSI1_DATA15 0x0001B0B0

MX6QDL_PAD_EIM_D19__IPU2_CSI1_DATA16 0x0001B0B0

MX6QDL_PAD_EIM_D18__IPU2_CSI1_DATA17 0x0001B0B0

MX6QDL_PAD_EIM_D16__IPU2_CSI1_DATA18 0x0001B0B0

MX6QDL_PAD_EIM_A24__IPU2_CSI1_DATA19 0x0001B0B0

MX6QDL_PAD_EIM_D23__IPU2_CSI1_DATA_EN      0x0001B0B1

MX6QDL_PAD_EIM_D17__IPU2_CSI1_PIXCLK 0x0001B0B0

MX6QDL_PAD_EIM_DA11__IPU2_CSI1_HSYNC 0x0000B0B1

MX6QDL_PAD_EIM_DA12__IPU2_CSI1_VSYNC 0x0000B0B1

>;

};

When I run the gstreamer application against video1 device,

gst-launch imxv4l2src device=/dev/video1 ! imxv4l2sink

the application hangs waiting for the camera_callback and times out with the de_queue error message.

ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0

rc0: Internal data flow error.

Looking forward for some pointers to resolve this issue.

Thanks,

Prashanth

Labels (3)
0 Kudos
3 Replies

207 Views
richardwoodham
Contributor I

I had a similar problem try to interface an ov5642 camera to the iMX6QDL-VAR-DT6 Custom board.  I eventually got it to work, but had to delete the mipi camera from the device tree.  

I can see some mistakes in the pin muxing, in particular:

      MX6QDL_PAD_EIM_A16__IPU2_CSI1_PIXCLK 0x0000b0b1
needs to be correct. 

I have DATA_EN pulled high, and pick up CLKO2 from J17.3 (a 33R in series seems to help with signal integrity).

Curiously, if I add the mipi camera stuff back in, the mipi camera works on /dev/video1, but the ov5642 stops working on /dev/video0 (mxc_v4l2_capture.out gives:

"Unable to open /dev/video0")

0 Kudos

207 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi Prashanth

one can try to use patch "0001-IPU-update-IPU-capture-driver-to-support-up-to-four-.patch" to

support camera on any IPU's CSI port.

https://community.freescale.com/docs/DOC-158531

https://community.freescale.com/thread/330749#435854

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

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

-----------------------------------------------------------------------------------------------------------------------

0 Kudos

207 Views
prashs
Contributor I

Hi Igor,

Thanks for your quick reply. The base version of the patch file is different from the one I am currently working on. I will look into the patch file and try to manually modify my code base.


Meanwhile I was looking for some short work flow to make my parallel camera stream video to the HDMI output. I am not worried about the MIPI interface at the moment. I just need the video input from my parallel camera (connected to J11 jumper of VAR DT6 custom board) to be displayed onto the Monitor (640 x 480) via HDMI interface. Is there any such documentation or sample code that I can refer to ?

Thanks,

Prashanth

0 Kudos