Difference between revisions of "IPCC device tree configuration"

[unchecked revision] [quality revision]
(Merge articles)
m
 
Applicable for STM32MP15x lines

1 Article purpose[edit]

This article explains how to configure the IPCC internal peripheral controlled by the Linux Mailbox framework.

The configuration is performed using the device tree mechanism that provides a hardware description of the IPCC peripheral, used by the STM32 IPCC Linux driver.

2 DT bindings documentation[edit]

The IPCC internal peripheral is represented by:

  • The Generic mailbox device tree bindings[1]
  • The STM32 IPCC device tree bindings[2]

3 DT configuration[edit]

This hardware description is a combination of the STM32 microprocessor device tree files (.dtsi extension) and the 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 level)[edit]

The IPCC peripheral node is located in stm32mp151.dtsi [3] file.

ipcc: mailbox@4c001000 {
	compatible = "st,stm32mp1-ipcc";
	#mbox-cells = <1>;
	reg = <0x4c001000 0x400>;
	st,proc-id = <0>;
	interrupts-extended =
		<&exti 61 1>,
		<&intc GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
	interrupt-names = "rx", "tx";
	clocks = <&rcc IPCC>;
	wakeup-source;
	power-domains = <&pd_core>;
	status = "disabled";
};
Warning white.png Warning
This device tree part is related to STM32 microprocessors. It must be kept as it is, without being modified by the end-user.

3.2 DT configuration (board level)[edit]

This part is used to enable the IPCC hardware on a board:

&ipcc {
	status = "okay";
};

3.3 DT configuration examples[edit]

Below is an example of the remoteproc client using three mailbox channels:

&m4_rproc {
	...
	mboxes = <&ipcc 0>, <&ipcc 1>, <&ipcc 2>;
	mbox-names = "vq0", "vq1", "shutdown";
	...
};

4 How to configure the DT using STM32CubeMX[edit]

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. In such a case, 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 more information.

5 References[edit]

Refer to the following links for additional information:



<noinclude>{{ApplicableFor
|MPUs list=STM32MP15x
|MPUs checklist=STM32MP13x, STM32MP15x
}}</noinclude>

== Article purpose ==
This article explains how to configure the [[IPCC internal peripheral|'''IPCC''' internal peripheral]] controlled by the [[Linux Mailbox framework overview|Linux Mailbox framework]].

The configuration is performed using the [[Device tree|device tree]] mechanism that provides a hardware description of the IPCC peripheral, used by the STM32 IPCC Linux driver.

== DT bindings documentation ==
The IPCC internal peripheral is represented by:
* The ''Generic mailbox device tree bindings''<ref name="mailbox.txt">{{CodeSource | Linux kernel | Documentation/devicetree/bindings/mailbox/mailbox.txt}}, Generic mailbox device tree bindings</ref>

* The ''STM32 IPCC device tree bindings''<ref name="st,stm32-ipcc.yaml">{{CodeSource |Linux kernel | Documentation/devicetree/bindings/mailbox/st,stm32-ipcc.yaml}}, STM32 IPCC device tree bindings</ref>


== DT configuration ==
This hardware description is a combination of the '''STM32 microprocessor''' device tree files (''.dtsi'' extension) and the '''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|How to configure the DT using STM32CubeMX]] for more details.

===DT configuration (STM32 level) ===
The IPCC peripheral node is located in ''stm32mp151.dtsi'' <ref>{{CodeSource | Linux kernel | arch/arm/boot/dts/stm32mp151.dtsi | arch/arm/boot/dts/stm32mp151.dtsi}}</ref> file. <pre>

ipcc: mailbox@4c001000 {
	compatible = "st,stm32mp1-ipcc";
	#mbox-cells = <1>;
	reg = <0x4c001000 0x400>;
	st,proc-id = <0>;
	interrupts-extended =<&exti 61 1>,<&intc GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
	interrupt-names = "rx", "tx";
	clocks = <&rcc IPCC>;
	wakeup-source;
	power-domains = <&pd_core>;
	status = "disabled";
};</pre>

{{Warning|This device tree part is related to STM32 microprocessors. It must be kept as it is, without being modified by the end-user.}}

=== DT configuration (board level) ===
This part is used to enable the IPCC hardware on a board:<pre>

&ipcc {
	status = "okay";
};</pre>


=== DT configuration examples ===
Below is an example of the remoteproc client using three mailbox channels:<pre>

&m4_rproc {
	...
	mboxes = <&ipcc 0>, <&ipcc 1>, <&ipcc 2>;
	mbox-names = "vq0", "vq1", "shutdown";
	...
};</pre>


==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 may not support all the properties described in the above [[#DT bindings documentation|DT bindings documentation]] paragraph. In such a case, 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 more information.

==References==
Refer to the following links for additional information:
<references />

<noinclude>

{{PublicationRequestId | 22135 | 2022-01-04 | <comment>review done  in stm32Mpuv3 wiki}}
[[Category:Coprocessor management Linux]]
{{ArticleBasedOnModel | Peripheral or framework device tree configuration model}}</noinclude>
Line 67: Line 67:
   
 
<noinclude>
 
<noinclude>
{{PublicationRequestId | 22135 | 2022-01-04 | <comment>}}
+
{{PublicationRequestId | 22135 | 2022-01-04 | review done  in stm32Mpuv3 wiki}}
 
[[Category:Coprocessor management Linux]]
 
[[Category:Coprocessor management Linux]]
 
{{ArticleBasedOnModel | Peripheral or framework device tree configuration model}}
 
{{ArticleBasedOnModel | Peripheral or framework device tree configuration model}}
 
</noinclude>
 
</noinclude>