Last edited 4 weeks ago

DSI device tree configuration

Applicable for STM32MP15x lines, STM32MP25x lines


1. Article purpose[edit source]

This article explains how to configure the DSI [1] when the peripheral is assigned to the Linux® OS.

The configuration is performed using the device tree mechanism [2].

The Device tree provides a hardware description of the DSI [1] used by the STM32 DSI Linux driver.

2. DT bindings documentation[edit source]

The DSI is represented by the STM32 DSI device tree bindings [3].

3. DT configuration[edit source]

This hardware description is a combination of the STM32 microprocessor device tree files (.dtsi extension) and board device tree files (.dts extension). See the Device tree for an explanation of the device tree file split.

STM32CubeMX can be used to generate the board device tree. Refer to How to configure the DT using STM32CubeMX for more details.

3.1. DT configuration (STM32/SoC level)[edit source]

The DSI node is located in the device tree file for the software components, supporting the peripheral and listed in the above DT bindings documentation paragraph.

For STM32MP15x lines More info.png, the DSI device tree node is declared in stm32mp157.dtsi [4].

		dsi: dsi@5a000000 {
			compatible = "st,stm32-dsi";
			reg = <0x5a000000 0x800>;
			phy-dsi-supply = <&reg18>;
			clocks = <&rcc DSI>, <&clk_hse>, <&rcc DSI_PX>;
			clock-names = "pclk", "ref", "px_clk";
			resets = <&rcc DSI_R>;
			reset-names = "apb";
			status = "disabled";
		};

For STM32MP25x lines More info.png, the DSI device tree node is declared in stm32mp255.dtsi [5].

/ {
	soc@0 {
		rifsc: rifsc@42080000 {
			dsi: dsi@48000000 {
				compatible = "st,stm32mp25-dsi";
				reg = <0x48000000 0x800>;
				#clock-cells = <0>;
				clocks = <&rcc CK_BUS_DSI>, <&rcc CK_KER_DSIPHY>,
					 <&rcc CK_KER_LTDC>;
				clock-names = "pclk", "ref", "px_clk";
				resets = <&rcc DSI_R>;
				reset-names = "apb";
				feature-domains = <&rifsc STM32MP25_RIFSC_DSI_CMN_ID>;
				power-domains = <&CLUSTER_PD>;
				status = "disabled";
			};
...
Warning white.png Warning
This device tree part is related to STM32 microprocessors. It must be kept as is, without being modified by the end-user.


3.2. DT configuration (board level)[edit source]

The DSI device tree related to a particular board may have the following nodes, depending on the board hardware:

  • dsi node: containing the in/out port descriptions and a panel sub-node.
  • ltdc node: containing the in/out port description related to the dsi node.
  • panel_backlight node: related to the panel node.

For STM32MP15x lines More info.png, a full example of the STM32MP157 Evaluation board device tree is available in stm32mp157c-ev1.dts [6].

/ {
	model = "STMicroelectronics STM32MP157C eval daughter on eval mother";
	compatible = "st,stm32mp157c-ev1", "st,stm32mp157c-ed1", "st,stm32mp157";
...
	panel_backlight: panel-backlight {
		compatible = "gpio-backlight";
		gpios = <&gpiod 13 GPIO_ACTIVE_LOW>;
		default-on;
		status = "okay";
	};
...
};
...
&dsi {
	#address-cells = <1>;
	#size-cells = <0>;
	status = "okay";

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

		port@0 {
			reg = <0>;
			dsi_in: endpoint {
				remote-endpoint = <&ltdc_ep0_out>;
			};
		};

		port@1 {
			reg = <1>;
			dsi_out: endpoint {
				remote-endpoint = <&dsi_panel_in>;
			};
		};
	};

	panel_dsi: panel-dsi@0 {
		compatible = "raydium,rm68200";
		reg = <0>;
		reset-gpios = <&gpiof 15 GPIO_ACTIVE_LOW>;
		backlight = <&panel_backlight>;
		power-supply = <&v3v3>;
		status = "okay";

		port {
			dsi_panel_in: endpoint {
				remote-endpoint = <&dsi_out>;
			};
		};
	};
};
...
&ltdc {
	status = "okay";

	port {
		ltdc_ep0_out: endpoint {
			remote-endpoint = <&dsi_in>;
		};
	};
};

For STM32MP25x lines More info.png, a full example of the STM32MP257 Evaluation board device tree is available in stm32mp257f-ev1.dts [7].

/ {
	model = "STMicroelectronics STM32MP257F-EV1 Evaluation Board";
	compatible = "st,stm32mp257f-ev1", "st,stm32mp257";
...
	hdmi: connector {
		compatible = "hdmi-connector";
		label = "hdmi";
		type = "a";

		port {
			hdmi_connector_in: endpoint {
				remote-endpoint = <&adv753x_out>;
			};
		};
	};
...
};
...
&dsi {
	vdd-supply =  <&scmi_vddcore>;
	vdda18-supply = <&scmi_v1v8>;
	status = "disabled";

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

		port@0 {
			reg = <0>;
			dsi_in: endpoint {
				remote-endpoint = <&ltdc_ep0_out>;
			};
		};

		port@1 {
			reg = <1>;
			dsi_out1: endpoint {
				remote-endpoint = <&adv753x_in>;
			};
		};
	};
};
...
&i2c2 {
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&i2c2_pins_a>;
	pinctrl-1 = <&i2c2_sleep_pins_a>;
	i2c-scl-rising-time-ns = <100>;
	i2c-scl-falling-time-ns = <13>;
	clock-frequency = <400000>;
	status = "okay";
	/* spare dmas for other usage */
	/delete-property/dmas;
	/delete-property/dma-names;
...
	adv753x: hdmi@3d {
		/*
		 * With MB1232 board, use "adi,adv7533" (1080p30)
		 * With MB1752 board, use "adi,adv7535" (1080p60)
		 */
		compatible = "adi,adv7533";
		reg = <0x3d>, <0x3c>, <0x3f>, <0x38>;
		reg-names = "main", "cec", "edid", "packet";
		clocks = <&cec_clock>;
		clock-names = "cec";
		interrupt-parent = <&gpiod>;
		interrupts = <10 IRQ_TYPE_EDGE_FALLING>;
		status = "disabled";
		adi,dsi-lanes = <4>;
		reset-gpios = <&gpiog 14 GPIO_ACTIVE_LOW>;
		avdd-supply = <&scmi_v1v8>;
		dvdd-supply = <&scmi_v1v8>;
		pvdd-supply = <&scmi_v1v8>;
		a2vdd-supply = <&scmi_v1v8>;
		v3p3-supply = <&scmi_v3v3>;
		v1p2-supply = <&scmi_v1v8>;

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

			port@0 {
				reg = <0>;
				adv753x_in: endpoint {
					remote-endpoint = <&dsi_out1>;
				};
			};

			port@1 {
				reg = <1>;
				adv753x_out: endpoint {
					remote-endpoint = <&hdmi_connector_in>;
				};
			};

			port@2 {
				reg = <2>;
				adv753x_tx_endpoint: endpoint {
					remote-endpoint = <&i2s2_endpoint>;
				};
			};
		};
	};
...
};
...
&ltdc {
	default-on;
	rotation-memory = <&ltdc_sec_rotation>;
	status = "okay";

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

		ltdc_ep0_out: endpoint@0 {
			reg = <0>;
			remote-endpoint = <&dsi_in>;
		};

		ltdc_ep1_out: endpoint@1 {
			reg = <1>;
			remote-endpoint = <&lvds_in>;
		};
	};
};
...

4. How to configure the DT using STM32CubeMX[edit source]

The STM32CubeMX tool can be used to configure the STM32MPU device and get the corresponding platform configuration device tree files.
The STM32CubeMX may not support all the properties described in the above DT bindings documentation paragraph. If so, the tool inserts user sections in the generated device tree. These sections can then be edited to add some properties and they are preserved from one generation to another. Refer to STM32CubeMX user manual for further information.

5. References[edit source]

Please refer to the following links for additional information: