Last edited 2 months ago

DSI device tree configuration

Applicable for STM32MP15x lines, STM32MP23x lines, STM32MP25x lines


1. Article purpose[edit | 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 | edit source]

The DSI is represented by the STM32 DSI device tree bindings file: st,stm32-dsi.yaml

3. DT configuration[edit | 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 | 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.

The DSI device tree node is declared in:

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

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

				port@0 {
					reg = <0>;
					dsi_in: endpoint {
					};
				};

				port@1 {
					reg = <1>;
					dsi_out: endpoint {
					};
				};
			};
		};
...
...
&rifsc {
...
	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";
		access-controllers = <&rifsc 81>;
		power-domains = <&CLUSTER_PD>;
		status = "disabled";
	};
...
...
&rifsc {
...
	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";
		access-controllers = <&rifsc 81>;
		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 | 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 arch/arm/boot/dts/st/stm32mp157c-ev1.dts :

/ {
	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;
		default-brightness-level = <1>;
		status = "okay";
	};
...
};
...
&dsi {
	#address-cells = <1>;
	#size-cells = <0>;
	default-on;
	status = "okay";

	panel_dsi: panel@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>;
			};
		};
	};
};

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

&dsi_out {
	remote-endpoint = <&dsi_panel_in>;
};
...
&i2c2 {
...
	gt9147: goodix-ts@5d {
		compatible = "goodix,gt9147";
		reg = <0x5d>;
		panel = <&panel_dsi>;
		pinctrl-0 = <&goodix_pins>;
		pinctrl-names = "default";
		AVDD28-supply = <&v3v3>;
		VDDIO-supply = <&v3v3>;
		status = "okay";

		interrupts = <14 IRQ_TYPE_EDGE_RISING>;
		interrupt-parent = <&stmfx_pinctrl>;
	};
};
...
&ltdc {
	default-on;
	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 arch/arm64/boot/dts/st/stm32mp257f-ev1.dts :

/ {
	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 | 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 | edit source]

Please refer to the following links for additional information: