The MIPI camera sensor interfaces the MIPI CSI-2 RX subsystem with the CSI-2 RX PHY and host controller. This subsystem handles the sensor/image input and processing for all input imaging devices.

The MIPI CSI-2 driver manages the MIPI RX PHY and the communication to the ISI (Image Sensing Interface).

Available camera interfaces

On the ConnectCore 8X SBC Pro:

  • MIPI CSI-2 camera port is available on a 15-pin FFC connector (2 data lanes)

Camera connection

The BSP includes support for:

  • Digilent Pcam 5C MIPI camera (Omnivision OV5640 sensor)

Connect Digilent Pcam 5C MIPI camera

Ensure that the correct cable is used and properly oriented when connecting the MIPI camera to the ConnectCore 8X SBC Pro. Incorrect cable selection or improper orientation may cause permanent damage to the camera.

For ConnectCore 8X SBC Pro, use a 15 pin, 1mm pitch FFC cable with contacts on top on one side, bottom on the other. Pin 1 of the ConnectCore 8X SBC Pro connector aligns with pin 15 of the camera connector.

ConnectCore 8X SBC Pro MIPI camera connection

Kernel configuration

You can manage the MIPI driver and the OmniVision OV5640 MIPI camera sensor driver through the kernel configuration options:

  • IMX8 MIPI CSI2 Controller (CONFIG_IMX8_MIPI_CSI2)

  • OmniVision OV5640 sensor support (CONFIG_VIDEO_OV5640)

These options are enabled as built-in on the default ConnectCore 8X kernel configuration file.

Kernel driver mapping

The driver for MIPI capture is available at the following location:

File Description

drivers/media/i2c/ov5640.c

OV5640 MIPI Camera Subdev Driver

drivers/staging/media/imx/imx8-mipi-csi2.c

MXC MIPI CSI2 driver

Device tree bindings and customization

The device tree must contain entries for:

  • The MIPI interface

  • The ISI interface

  • The I2C interface

  • The camera sensor

Definition of the MIPI CSI interface

i.MX8QXP device tree
mipi_csi_0: csi@58227000 {
	compatible = "fsl,mxc-mipi-csi2";
	reg = <0x58227000 0x1000>,
	      <0x58221000 0x1000>;
	clocks = <&csi0_core_lpcg 0>,
		 <&csi0_esc_lpcg 0>,
		 <&csi0_pxl_lpcg 0>;
	clock-names = "clk_core", "clk_esc", "clk_pxl";
	assigned-clocks = <&csi0_core_lpcg 0>,
			  <&csi0_esc_lpcg 0>;
	assigned-clock-rates = <360000000>, <72000000>;
	power-domains = <&pd IMX_SC_R_CSI_0>, <&pd IMX_SC_R_ISI_CH0>;
	power-domain-names = "pd_csi", "pd_isi_ch0";
	status = "disabled";
};
ConnectCore 8X SBC Pro device tree
&mipi_csi_0 {
	#address-cells = <1>;
	#size-cells = <0>;
	/delete-property/virtual-channel;
	status = "disabled";

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

Definition of the ISI selection

i.MX8QXP device tree
isi_0: isi@58100000 {
	compatible = "fsl,imx8-isi";
	reg = <0x58100000 0x10000>;
	interrupts = <GIC_SPI 297 IRQ_TYPE_LEVEL_HIGH>;
	interrupt-parent = <&gic>;
	clocks = <&pdma0_lpcg 0>;
	clock-names = "per";
	power-domains = <&pd IMX_SC_R_ISI_CH0>;
	interface = <2 0 2>;
	no-reset-control;
	status = "disabled";

	cap_device {
		compatible = "imx-isi-capture";
		status = "disabled";
	};

	m2m_device{
		compatible = "imx-isi-m2m";
		status = "disabled";
	};
};

Definition of the Camera sensor

The ConnectCore 8X SBC Pro device tree defines the MIPI-CSI2 OmniVision OV5640 camera.

ConnectCore 8X SBC Pro device tree
/* MIPI-CSI0 I2C available on MIPI Camera connector */
&i2c_mipi_csi0 {
	#address-cells = <1>;
	#size-cells = <0>;
	pinctrl-names = "default", "gpio";
	pinctrl-0 = <&pinctrl_csi0_lpi2c0>;
	pinctrl-1 = <&pinctrl_csi0_lpi2c0_gpio>;
	scl-gpios = <&lsio_gpio3 6 GPIO_ACTIVE_HIGH>;
	sda-gpios = <&lsio_gpio3 5 GPIO_ACTIVE_HIGH>;
	clock-frequency = <100000>;
	status = "disabled";

	/* MIPI-CSI2 camera */
	ov5640_mipi: ov5640_mipi@3c {
		compatible = "ovti,ov5640";
		reg = <0x3c>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_mipi>;
		clocks = <&xtal24m>;
		clock-names = "xclk";
		csi_id = <0>;
		reset-gpios = <&lsio_gpio3 21 GPIO_ACTIVE_LOW>;
		mclk = <24000000>;
		mclk_source = <0>;
		mipi_csi;
		status = "disabled";

		port {
			ov5640_mipi_ep: endpoint {
				remote-endpoint = <&mipi_csi0_ep>;
				data-lanes = <1 2>;
				clocks-lanes = <0>;
			};
		};
	};
};

IOMUX configuration

The MIPI interface uses dedicated pins.

On the ConnectCore 8X SBC Pro, GPIO3_21 of the CPU is routed to the MIPI connector for camera reset. The IOMUX for this GPIO is defined at the ConnectCore 8X SBC Pro device tree file:

ConnectCore 8X SBC Pro device tree
pinctrl_mipi: mipi {
	fsl,pins = <
		IMX8QXP_QSPI0B_DATA3_LSIO_GPIO3_IO21 0xC0000041
	>;
};