“DSI device tree configuration”的版本间的差异
来自百问网嵌入式Linux wiki
| (未显示2个用户的10个中间版本) | |||
| 第1行: | 第1行: | ||
| − | [[ | + | == Article purpose == |
| − | + | ||
| − | [[ | + | 本文介绍了将外围设备分配给 Linux<sup>®</sup> 操作系统时,如何配置''DSI''<ref name="DSI">[[DSI internal peripheral]]</ref> 的方法。 |
| + | 使用'''设备树机制''' <ref> [[Device tree]]</ref>执行配置。 | ||
| + | |||
| + | The [[Device tree]] 提供了STM32“ DSI Linux驱动程序”使用的DSI <ref name="DSI"/>的硬件描述。 | ||
| + | |||
| + | == DT bindings documentation == | ||
| + | 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 == | ||
| + | 该硬件描述是'''STM32微处理器'''设备树文件(扩展名为.dtsi)和'''板子'''设备树文件(扩展名为.dts)的组合。 有关设备树文件分割的说明,请参见[ [[Device tree]]。 | ||
| + | |||
| + | '''STM32CubeMX'''可用于生成板卡设备树。 有关更多详细信息,请参考[[#How_to_configure_the_DT_using_STM32CubeMX|How to configure the DT using STM32CubeMX]]. | ||
| + | |||
| + | ===DT configuration (STM32 level) === | ||
| + | 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> | ||
| + | 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"; | ||
| + | }; | ||
| + | </pre> | ||
| + | |||
| + | {{Warning|该设备树部分与STM32微处理器有关。 它必须保持原样,而不能由最终用户修改。}} | ||
| + | |||
| + | === DT configuration (board level) === | ||
| + | 与特定板卡相关的DSI设备树可能具有以下节点,具体取决于板卡硬件: | ||
| + | * '''dsi'''节点:包含输入/输出端口说明和一个'''panel'''子节点。 | ||
| + | * '''ltdc'''节点:包含与dsi节点相关的输入/输出端口说明。 | ||
| + | * '''panel_backlight'''节点:与面板节点有关。 | ||
| + | |||
| + | [[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> | ||
| + | &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 = <<dc_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>; | ||
| + | }; | ||
| + | }; | ||
| + | }; | ||
| + | }; | ||
| + | |||
| + | <dc { | ||
| + | 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"; | ||
| + | }; | ||
| + | }; | ||
| + | |||
| + | </pre> | ||
| + | |||
| + | ==How to configure the DT using STM32CubeMX== | ||
| + | The [[STM32CubeMX]] 工具可用于配置STM32MPU设备并获取相应的[[Device_tree#STM32|platform configuration device tree]]文件.<br /> | ||
| + | STM32CubeMX可能不支持以上 [[#DT bindings documentation|DT bindings documentation]] 段中描述的所有属性。如果是这样,该工具会在生成的设备树中插入“''用户部分”''。 然后可以编辑这些部分以添加一些属性,并将它们一代一代地保留下来。 有关更多信息,请参见[[STM32CubeMX]]用户手册。 | ||
| + | |||
| + | ==References== | ||
| + | 请参考以下链接以获取更多信息: | ||
| + | |||
| + | <references /> | ||
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";
};
| 该设备树部分与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 = <<dc_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>;
};
};
};
};
<dc {
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用户手册。
References
请参考以下链接以获取更多信息:
- ↑ 1.01.1 DSI internal peripheral
- ↑ Device tree
- ↑ Documentation/devicetree/bindings/display/st,stm32-ltdc.txt | |}} st,stm32-ltdc.txt Linux kernel bindings (including dsi)
- ↑ arch/arm/boot/dts/stm32mp157c.dtsi | |}} Linux kernel STM32MP157C device tree (stm32mp157c.dtsi)
- ↑ arch/arm/boot/dts/stm32mp157c-ev1.dts | |}} Linux kernel STM32MP157 Evaluation board device tree (stm32mp157c-ev1.dts)