Registered User mNo edit summary |
Registered User mNo edit summary Tag: 2017 source edit |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{ApplicableFor | |||
|MPUs list=STM32MP15x | |MPUs list=STM32MP15x, STM32MP25x | ||
|MPUs checklist=STM32MP13x, STM32MP15x | |MPUs checklist=STM32MP13x, STM32MP15x, STM32MP25x | ||
}}</noinclude> | }} | ||
<noinclude></noinclude> | |||
== Article purpose == | == Article purpose == | ||
Line 19: | Line 20: | ||
'''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''' 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. | ||
===DT configuration (STM32 level) === | === DT configuration (STM32/SoC level) === | ||
The DSI device tree node is declared in stm32mp157.dtsi <ref name="stm32mp157_dtsi">{{CodeSource | Linux kernel | arch/arm/boot/dts/stm32mp157.dtsi | Linux kernel | The DSI node is located in the [[STM32 MPU device_tree#Device tree structure|device tree file]] for the software components, supporting the peripheral and listed in the above [[#DT bindings documentation|DT bindings documentation]] paragraph. | ||
For {{MicroprocessorDevice | device=15}}, the DSI device tree node is declared in stm32mp157.dtsi <ref name="stm32mp157_dtsi">{{CodeSource | Linux kernel | arch/arm/boot/dts/stm32mp157.dtsi | Linux kernel STM32MP157 device tree (stm32mp157.dtsi)}}</ref>. | |||
<pre> | <pre> | ||
dsi: dsi@5a000000 { | dsi: dsi@5a000000 { | ||
Line 26: | Line 29: | ||
reg = <0x5a000000 0x800>; | reg = <0x5a000000 0x800>; | ||
phy-dsi-supply = <®18>; | phy-dsi-supply = <®18>; | ||
clocks = <&rcc | clocks = <&rcc DSI>, <&clk_hse>, <&rcc DSI_PX>; | ||
clock-names = "pclk", "ref", "px_clk"; | clock-names = "pclk", "ref", "px_clk"; | ||
resets = <&rcc DSI_R>; | resets = <&rcc DSI_R>; | ||
reset-names = "apb"; | reset-names = "apb"; | ||
status = "disabled"; | status = "disabled"; | ||
}; | |||
</pre> | |||
For {{MicroprocessorDevice | device=25}}, the DSI device tree node is declared in stm32mp255.dtsi <ref name="stm32mp255_dtsi">{{CodeSource | Linux kernel | arch/arm64/boot/dts/st/stm32mp255.dtsi | Linux kernel STM32MP255 device tree (stm32mp255.dtsi)}}</ref>. | |||
<pre> | |||
# | / { | ||
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"; | |||
}; | }; | ||
... | |||
</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|This device tree part is related to STM32 microprocessors. It must be kept as is, without being modified by the end-user.}} | ||
{{ReviewsComments|-- [[User:Philippe Cornu|Philippe Cornu]] ([[User talk:Philippe Cornu|talk]]) 16:59, 13 June 2024 (CEST)<br />Add information linked to secure layer configuration)}} | |||
=== DT configuration (board level) === | === DT configuration (board level) === | ||
Line 49: | Line 66: | ||
* '''panel_backlight''' node: related to the panel node. | * '''panel_backlight''' node: related to the panel node. | ||
For {{MicroprocessorDevice | device=15}}, a full example of the [[STM32MP157x-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>. | |||
<pre> | <pre> | ||
/ { | |||
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 { | &dsi { | ||
#address-cells = <1>; | #address-cells = <1>; | ||
Line 71: | Line 101: | ||
reg = <1>; | reg = <1>; | ||
dsi_out: endpoint { | dsi_out: endpoint { | ||
remote-endpoint = <& | remote-endpoint = <&dsi_panel_in>; | ||
}; | }; | ||
}; | }; | ||
}; | }; | ||
panel@0 { | panel_dsi: panel-dsi@0 { | ||
compatible = "raydium,rm68200"; | compatible = "raydium,rm68200"; | ||
reg = <0>; | reg = <0>; | ||
reset-gpios = <&gpiof 15 GPIO_ACTIVE_LOW>; | reset-gpios = <&gpiof 15 GPIO_ACTIVE_LOW>; | ||
backlight = <&panel_backlight>; | backlight = <&panel_backlight>; | ||
power-supply = <&v3v3>; | |||
status = "okay"; | status = "okay"; | ||
port { | port { | ||
dsi_panel_in: endpoint { | |||
remote-endpoint = <&dsi_out>; | remote-endpoint = <&dsi_out>; | ||
}; | }; | ||
Line 90: | Line 121: | ||
}; | }; | ||
}; | }; | ||
... | |||
<dc { | |||
status = "okay"; | |||
port { | |||
ltdc_ep0_out: endpoint { | |||
remote-endpoint = <&dsi_in>; | |||
}; | |||
}; | |||
}; | |||
</pre> | |||
For {{MicroprocessorDevice | device=25}}, a full example of the [[STM32MP257x-EV1 - hardware description | STM32MP257 Evaluation board]] device tree is available in stm32mp257f-ev1.dts <ref name="stm32mp257f_ev1_dts">{{CodeSource | Linux kernel | arch/arm64/boot/dts/st/stm32mp257f-ev1.dts | Linux kernel STM32MP257 Evaluation board device tree (stm32mp257f-ev1.dts)}}</ref>. | |||
<pre> | |||
/ { | |||
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 = <<dc_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>; | |||
}; | |||
}; | |||
}; | |||
}; | |||
... | |||
}; | |||
... | |||
<dc { | <dc { | ||
default-on; | |||
rotation-memory = <<dc_sec_rotation>; | |||
status = "okay"; | status = "okay"; | ||
Line 101: | Line 253: | ||
reg = <0>; | reg = <0>; | ||
remote-endpoint = <&dsi_in>; | remote-endpoint = <&dsi_in>; | ||
}; | |||
ltdc_ep1_out: endpoint@1 { | |||
reg = <1>; | |||
remote-endpoint = <&lvds_in>; | |||
}; | }; | ||
}; | }; | ||
}; | }; | ||
... | ... | ||
</pre> | </pre> | ||
==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# | The [[STM32CubeMX]] tool can be used to configure the STM32MPU device and get the corresponding [[Device_tree#STM32_MPU|platform configuration device tree]] files.<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. | 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. | ||
Latest revision as of 16:59, 13 June 2024
1. Article purpose
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
The DSI is represented by the STM32 DSI device tree bindings [3].
3. 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.
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)
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 , the DSI device tree node is declared in stm32mp157.dtsi [4].
dsi: dsi@5a000000 {
compatible = "st,stm32-dsi";
reg = <0x5a000000 0x800>;
phy-dsi-supply = <®18>;
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 , 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";
};
...
3.2. DT configuration (board level)
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 , 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 = <<dc_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>;
};
};
};
};
...
<dc {
status = "okay";
port {
ltdc_ep0_out: endpoint {
remote-endpoint = <&dsi_in>;
};
};
};
For STM32MP25x lines , 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 = <<dc_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>;
};
};
};
};
...
};
...
<dc {
default-on;
rotation-memory = <<dc_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
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
Please refer to the following links for additional information:
- ↑ Jump up to: 1.0 1.1 DSI internal peripheral
- ↑ Device tree
- ↑ st,stm32-dsi.yaml Linux kernel bindings (including dsi)
- ↑ Linux kernel STM32MP157 device tree (stm32mp157.dtsi)
- ↑ Linux kernel STM32MP255 device tree (stm32mp255.dtsi)
- ↑ Linux kernel STM32MP157 Evaluation board device tree (stm32mp157c-ev1.dts)
- ↑ Linux kernel STM32MP257 Evaluation board device tree (stm32mp257f-ev1.dts)