Last edited 6 days ago

Camera bridges hardware components

Applicable for STM32MP13x lines, STM32MP15x lines, STM32MP21x lines, STM32MP23x lines, STM32MP25x lines


1. Article purpose[edit | edit source]

The purpose of this article is to:

  • List the camera bridges hardware components that might be integrated in the different boards.
  • Link these components to the corresponding software framework(s).
  • Point to the appropriate component datasheets.
  • Explain, when necessary, how to configure these components.
Info white.png Information
Some of these hardware components are part of the accessories for STM32 boards.

2. Software frameworks[edit | edit source]

Domain Peripheral Software components Comment
OP-TEE Linux STM32Cube
Visual STMicroelectronics STMIPID02 V4L2 camera framework MIPI® CSI-2 to SMIA CCP2 de-serializer camera bridge


3. STMicroelectronics STMIPID02[edit | edit source]

The STMicroelectronics STMIPID02 camera bridge is dual mode MIPI® CSI-2 / SMIA CCP2 de-serializer.

For details and the datasheet please contact STMicroelectronics.

Info white.png Information
This camera bridge can be found on some STM32MP13 Discovery kits.

Note: Please refer to the application note STM32MP135 line interfacing with a MIPI® CSI-2 camera (AN5478) for more details.

3.1. Linux driver[edit | edit source]

Bindings: Documentation/devicetree/bindings/media/i2c/st,st-mipid02.yaml

Sources: drivers/media/i2c/st-mipid02.c

Devicetree example: arch/arm/boot/dts/st/stm32mp135f-dk.dts

/ {
...
&dcmipp {
	status = "okay";
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&dcmipp_pins_a>;
	pinctrl-1 = <&dcmipp_sleep_pins_a>;
	port {
		dcmipp_0: endpoint {
			remote-endpoint = <&mipid02_2>;
			bus-width = <8>;
			hsync-active = <0>;
			vsync-active = <0>;
			pclk-sample = <0>;
			pclk-max-frequency = <120000000>;
		};
	};
};
...
&i2c5 {
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&i2c5_pins_a>;
	pinctrl-1 = <&i2c5_sleep_pins_a>;
	i2c-scl-rising-time-ns = <170>;
	i2c-scl-falling-time-ns = <5>;
	clock-frequency = <400000>;
	status = "okay";
	/* spare dmas for other usage */
	/delete-property/dmas;
	/delete-property/dma-names;

	stmipi: stmipi@14 {
		compatible = "st,st-mipid02";
		reg = <0x14>;
		status = "okay";
		clocks = <&clk_mco1>;
		clock-names = "xclk";
		VDDE-supply = <&scmi_v1v8_periph>;
		VDDIN-supply = <&scmi_v1v8_periph>;
		reset-gpios = <&mcp23017 2 (GPIO_ACTIVE_LOW | GPIO_PUSH_PULL)>;

		ports {
			#address-cells = <1>;
			#size-cells = <0>;
			port@0 {
				reg = <0>;

				mipid02_0: endpoint {
					data-lanes = <1 2>;
					lane-polarities = <0 0 0>;
					remote-endpoint = <&gc2145_ep>;
				};
			};
			port@2 {
				reg = <2>;

				mipid02_2: endpoint {
					bus-width = <8>;
					hsync-active = <0>;
					vsync-active = <0>;
					pclk-sample = <0>;
					remote-endpoint = <&dcmipp_0>;
				};
			};
		};
	};

	gc2145: gc2145@3c {
		compatible = "galaxycore,gc2145";
		reg = <0x3c>;
		clocks = <&clk_ext_camera>;
		iovdd-supply = <&scmi_v3v3_sw>;
		avdd-supply = <&scmi_v3v3_sw>;
		dvdd-supply = <&scmi_v3v3_sw>;
		powerdown-gpios = <&mcp23017 3 (GPIO_ACTIVE_LOW | GPIO_PUSH_PULL)>;
		reset-gpios = <&mcp23017 4 (GPIO_ACTIVE_LOW | GPIO_PUSH_PULL)>;
		status = "okay";

		port {
			gc2145_ep: endpoint {
				remote-endpoint = <&mipid02_0>;
				clock-lanes = <0>;
				data-lanes = <1 2>;
				link-frequencies = /bits/ 64 <120000000 192000000 240000000>;
			};
		};
	};

	ov5640: camera@3c {
		compatible = "ovti,ov5640";
		reg = <0x3c>;
		clocks = <&clk_ext_camera>;
		clock-names = "xclk";
		DOVDD-supply = <&scmi_v3v3_sw>;
		status = "disabled";
		powerdown-gpios = <&mcp23017 3 (GPIO_ACTIVE_LOW | GPIO_PUSH_PULL)>;
		reset-gpios = <&mcp23017 4 (GPIO_ACTIVE_LOW | GPIO_PUSH_PULL)>;

		port {
			ov5640_0: endpoint {
				/*remote-endpoint = <&mipid02_0>;*/
				clock-lanes = <0>;
				data-lanes = <1 2>;
			};
		};
	};
...


4. To go further[edit | edit source]

Related articles: