Error while testing ov5640_mipi camera with custom carrier board

Hello, I’m trying to configure the device tree to use the ov5640_mipi camera like the bringup image.
This is my DeviceTree, in particular the camera block:

&i2c3 {
	#address-cells = <1>;
	#size-cells = <0>;
	clock-frequency = <100000>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_lpi2c3>;
	status = "okay";

	ov5640_mipi@3c {
		/*compatible = "ovti,ov564x_mipi";*/
		compatible = "ovti,ov5640_mipi";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_cam>;
		reg = <0x3c>;
		/*
		DOVDD-supply = <&reg_1p8v>;
		AVDD-supply = <&reg_2p5v>;
		DVDD-supply = <&reg_1p8v>;
		*/
		/*pwdn-gpios = <&gpio3 26 GPIO_ACTIVE_HIGH>;*/
		pwn-gpios = <&gpio1 22 GPIO_ACTIVE_HIGH>;
		rst-gpios = <&gpio3 28 GPIO_ACTIVE_LOW>;
		ipu_id = <0>;
		csi_id = <1>;
		mclk = <24000000>;
		mclk_source = <0>;
		status = "okay";

		port {
			ov5640_ep: endpoint {
				remote-endpoint = <&mipi_csi1_ep>;
				data-lanes = <1 2 3 4>;
			};
		};
	};

};



and


&mipi_csi_1 {
	#address-cells = <1>;
	#size-cells = <0>;
	virtual-channel;
	status = "okay";

	/* Camera 0 MIPI CSI-2 (CSIS1) */
	port@0 {
		reg = <0>;
		mipi_csi1_ep: endpoint {
			remote-endpoint = <&ov5640_ep>;
			data-lanes = <1 2>;
		};
	};
};

and the pinctrls:

pinctrl_cam: camgrp {
			fsl,pins = <
				SC_P_M40_GPIO0_00_LSIO_GPIO0_IO08		0x06000021
				SC_P_M40_GPIO0_01_LSIO_GPIO0_IO09		0x06000021
				SC_P_MLB_SIG_LSIO_GPIO3_IO26			0x00000021
			>;
		};

We have theese gpios connected to the camera modules:
410 LSIO_GPIO3_IO26 GPIO OUTPUT 15 CAM1_PWR_CTRL_015 → ENABLE CAMERA SUPPLY
412 LSIO_GPIO3_IO28 GPIO OUTPUT 17 CAM1_RESET_017 → the reset
470 LSIO_GPIO1_IO22 GPIO OUTPUT 123 CAM1_PWRDOWN_123 → POWERDOWN PIN

in the DMESG we can see something:

root@apalis-imx8:~# dmesg | grep mipi
[    3.759706] ov5640_mipi_nv 2-003c: ov5640: i2c transfer failed at 3108
[    3.766248] camera ov5640_mipi is found, ret: 0
[    3.782891] mxc-mipi-csi2 58247000.csi: mipi_csi2_probe
[    3.810071] mx8-img-md: Registered sensor subdevice: ov5640_mipi_nv 2-003c (1)

the error is something related to the i2c data transfert…

we are using the last BSP build from yocto (sumo 4.14.78) and to test the camera we do this:

export DISPLAY=:0.0
gst-launch-1.0 v4l2src device='/dev/video4' ! video/x-raw,format=RGB16,width=1920,height=1080,framerate=30/1 ! glimagesink

and GSTREAMER retur this error (with log level 2):

Setting pipeline to PAUSED ...
0:00:00.212217946  4559     0x11feb960 WARN                    v4l2 v4l2_calls.c:668:gst_v4l2_open:<v4l2src0> error: Could not open device '/dev/video4' for reading and writing.
0:00:00.212304195  4559     0x11feb960 WARN                    v4l2 v4l2_calls.c:668:gst_v4l2_open:<v4l2src0> error: system error: Invalid argument
ERROR: Pipeline doesn't want to pause.
Got context from element 'sink': gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayWayland\)\ gldisplaywayland0";
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Could not open device '/dev/video4' for reading and writing.
Additional debug info:
../../../git/sys/v4l2/v4l2_calls.c(668): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
system error: Invalid argument
Setting pipeline to NULL ...
Freeing pipeline ...

Thank you so much for the help.

What exact hardware (module and carrier board) and software versions of things are you talking about?

Please note that the bring-up image is no longer supported as it got superseded by our BSP 3.0b1. However, CSI is known to be broken there and will only be fully functional starting with BSP 3.0b2. You may find a working solution already on our -next branch here:

http://git.toradex.com/cgit/linux-toradex.git/log/?h=toradex_4.14-2.0.x-imx-next