“DSI device tree configuration”的版本间的差异

来自百问网嵌入式Linux wiki
 
(未显示同一用户的7个中间版本)
第1行: 第1行:
''Italic text''== Article purpose ==
+
== Article purpose ==
 +
 
 
本文介绍了将外围设备分配给 Linux<sup>&reg;</sup> 操作系统时,如何配置''DSI''<ref name="DSI">[[DSI internal peripheral]]</ref> 的方法。
 
本文介绍了将外围设备分配给 Linux<sup>&reg;</sup> 操作系统时,如何配置''DSI''<ref name="DSI">[[DSI internal peripheral]]</ref> 的方法。
 
使用'''设备树机制''' <ref> [[Device tree]]</ref>执行配置。
 
使用'''设备树机制''' <ref> [[Device tree]]</ref>执行配置。
第6行: 第7行:
  
 
== DT bindings documentation ==
 
== DT bindings documentation ==
The DSI is represented by the STM32 DSI device tree bindings <ref>{{CodeSource | Linux kernel | Documentation/devicetree/bindings/display/st,stm32-ltdc.txt | st,stm32-ltdc.txt Linux kernel bindings (including dsi)}}</ref>.
+
DSI由STM32 DSI设备树绑定表示 <ref>{{CodeSource | Linux kernel | Documentation/devicetree/bindings/display/st,stm32-ltdc.txt | st,stm32-ltdc.txt Linux kernel bindings (including dsi)}}</ref>.
  
 
== DT configuration ==
 
== DT configuration ==
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.
+
该硬件描述是'''STM32微处理器'''设备树文件(扩展名为.dtsi)和'''板子'''设备树文件(扩展名为.dts)的组合。 有关设备树文件分割的说明,请参见[ [[Device tree]]
  
'''STM32CubeMX''' can be used to generate the board device tree. Refer to [[#How_to_configure_the_DT_using_STM32CubeMX|How to configure the DT using STM32CubeMX]] for more details.
+
'''STM32CubeMX'''可用于生成板卡设备树。 有关更多详细信息,请参考[[#How_to_configure_the_DT_using_STM32CubeMX|How to configure the DT using STM32CubeMX]].
  
 
===DT configuration (STM32 level) ===
 
===DT configuration (STM32 level) ===
The DSI device tree node is declared in stm32mp157c.dtsi <ref name="stm32mp157c_dtsi">{{CodeSource | Linux kernel | arch/arm/boot/dts/stm32mp157c.dtsi | Linux kernel STM32MP157C device tree (stm32mp157c.dtsi)}}</ref>. The declaration (shown below) defines the hardware registers base address, the clocks and the reset.
+
DSI设备树节点在stm32mp157c.dtsi中声明 <ref name="stm32mp157c_dtsi">{{CodeSource | Linux kernel | arch/arm/boot/dts/stm32mp157c.dtsi | Linux kernel STM32MP157C device tree (stm32mp157c.dtsi)}}</ref>. 声明(如下所示)定义了硬件寄存器的基地址,时钟和复位。
 
<pre>
 
<pre>
 
dsi: dsi@5a000000 {
 
dsi: dsi@5a000000 {
第27行: 第28行:
 
</pre>
 
</pre>
  
{{Warning|This device tree part is related to STM32 microprocessors. It must be kept as is, without being modified by the end-user.}}
+
{{Warning|该设备树部分与STM32微处理器有关。 它必须保持原样,而不能由最终用户修改。}}
  
 
=== DT configuration (board level) ===
 
=== DT configuration (board level) ===
The DSI device tree related to a particular board may have the following nodes, depending on the board hardware:
+
与特定板卡相关的DSI设备树可能具有以下节点,具体取决于板卡硬件:
* '''dsi''' node: containing the in/out port descriptions and a '''panel''' sub-node.
+
* '''dsi'''节点:包含输入/输出端口说明和一个'''panel'''子节点。
* '''ltdc''' node: containing the in/out port description related to the dsi node.
+
* '''ltdc'''节点:包含与dsi节点相关的输入/输出端口说明。
* '''panel_backlight''' node: related to the panel node.
+
* '''panel_backlight'''节点:与面板节点有关。
 
   
 
   
A full example of the [[STM32MP157C-EV1 - hardware description | STM32MP157 Evaluation board]] device tree is available in stm32mp157c-ev1.dts <ref name="stm32mp157c_ev1_dts">{{CodeSource | Linux kernel | arch/arm/boot/dts/stm32mp157c-ev1.dts | Linux kernel STM32MP157 Evaluation board device tree (stm32mp157c-ev1.dts)}}</ref>.
+
[[STM32MP157x-EV1 - hardware description | 在stm32mp157c-ev1.dts中提供了设备树 <ref name="stm32mp157c_ev1_dts">{{CodeSource | Linux kernel | arch/arm/boot/dts/stm32mp157c-ev1.dts | Linux kernel STM32MP157 Evaluation board device tree (stm32mp157c-ev1.dts)}}</ref>.
  
 
<pre>
 
<pre>
第103行: 第104行:
  
 
==How to configure the DT using STM32CubeMX==
 
==How to configure the DT using STM32CubeMX==
The [[STM32CubeMX]] tool can be used to configure the STM32MPU device and get the corresponding [[Device_tree#STM32|platform configuration device tree]] files.<br />
+
The [[STM32CubeMX]] 工具可用于配置STM32MPU设备并获取相应的[[Device_tree#STM32|platform configuration device tree]]文件.<br />
The STM32CubeMX may not support all the properties described in the above [[#DT bindings documentation|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.
+
STM32CubeMX可能不支持以上 [[#DT bindings documentation|DT bindings documentation]] 段中描述的所有属性。如果是这样,该工具会在生成的设备树中插入“''用户部分”''。 然后可以编辑这些部分以添加一些属性,并将它们一代一代地保留下来。 有关更多信息,请参见[[STM32CubeMX]]用户手册。
  
 
==References==
 
==References==
Please refer to the following links for additional information:
+
请参考以下链接以获取更多信息:
  
 
<references />
 
<references />
 
<noinclude>
 
{{ArticleBasedOnModel | Peripheral or framework device tree configuration model}}
 
{{PublicationRequestId | 9161| 2018-10-11 | BrunoB}}
 
[[Category:Device tree configuration]]
 
[[Category:DRM KMS]]
 
</noinclude>
 

2020年11月10日 (二) 09:05的最新版本

Article purpose

本文介绍了将外围设备分配给 Linux® 操作系统时,如何配置DSI[1] 的方法。 使用设备树机制 [2]执行配置。

The Device tree 提供了STM32“ DSI Linux驱动程序”使用的DSI [1]的硬件描述。

DT bindings documentation

DSI由STM32 DSI设备树绑定表示 [3].

DT configuration

该硬件描述是STM32微处理器设备树文件(扩展名为.dtsi)和板子设备树文件(扩展名为.dts)的组合。 有关设备树文件分割的说明,请参见[ Device tree

STM32CubeMX可用于生成板卡设备树。 有关更多详细信息,请参考How to configure the DT using STM32CubeMX.

DT configuration (STM32 level)

DSI设备树节点在stm32mp157c.dtsi中声明 [4]. 声明(如下所示)定义了硬件寄存器的基地址,时钟和复位。

		dsi: dsi@5a000000 {
			compatible = "st,stm32-dsi";
			reg = <0x5a000000 0x800>;
			clocks = <&rcc DSI_K>, <&clk_hse>, <&rcc DSI_PX>;
			clock-names = "pclk", "ref", "px_clk";
			resets = <&rcc DSI_R>;
			reset-names = "apb";
			status = "disabled";
		};
Warning.png 该设备树部分与STM32微处理器有关。 它必须保持原样,而不能由最终用户修改。

DT configuration (board level)

与特定板卡相关的DSI设备树可能具有以下节点,具体取决于板卡硬件:

  • dsi节点:包含输入/输出端口说明和一个panel子节点。
  • ltdc节点:包含与dsi节点相关的输入/输出端口说明。
  • panel_backlight节点:与面板节点有关。

[[STM32MP157x-EV1 - hardware description | 在stm32mp157c-ev1.dts中提供了设备树 [5].

&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 = <&panel_in>;
			};
		};
	};

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

		port {
			panel_in: endpoint {
				remote-endpoint = <&dsi_out>;
			};
		};
	};
};

&ltdc {
	status = "okay";

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

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

...
	panel_backlight: panel-backlight {
		compatible = "gpio-backlight";
		gpios = <&gpiod 13 GPIO_ACTIVE_LOW>;
		default-on;
		status = "okay";
	};
};

How to configure the DT using STM32CubeMX

The STM32CubeMX 工具可用于配置STM32MPU设备并获取相应的platform configuration device tree文件.
STM32CubeMX可能不支持以上 DT bindings documentation 段中描述的所有属性。如果是这样,该工具会在生成的设备树中插入“用户部分”。 然后可以编辑这些部分以添加一些属性,并将它们一代一代地保留下来。 有关更多信息,请参见STM32CubeMX用户手册。