Registered User mNo edit summary |
Registered User mNo edit summary |
||
Line 1: | Line 1: | ||
== Purpose and scope == | == Purpose and scope == | ||
This article shows the structure of the device tree files as it is implemented in STM32MP15 for the following software components: [[STM32MP15 Linux kernel overview|Linux<sup>®</sup> kernel]], [[U-Boot overview|U-Boot]] and [[TF-A overview|TF-A]]. | This article shows the structure of the device tree files as it is implemented in STM32MP15 for the following software components: [[STM32MP15 Linux kernel overview|Linux<sup>®</sup> kernel]], [[U-Boot overview|U-Boot]] and [[TF-A overview|TF-A]]. | ||
Line 27: | Line 21: | ||
[[File:Device_tree_for_Linux_U-Boot_TF-A.png|center|link=]] | [[File:Device_tree_for_Linux_U-Boot_TF-A.png|center|link=]] | ||
Color legend: | Color legend: | ||
* <span style="color:#FFFFFF; background: | * <span style="color:#FFFFFF; background:{{STDarkBlue}};"> Linux </span> in dark blue | ||
* <span style="color:#FFFFFF; background: | * <span style="color:#FFFFFF; background:{{STLightGreen}};"> U-Boot </span> in green | ||
* <span style="color:#FFFFFF; background: | * <span style="color:#FFFFFF; background:{{STPink}};"> TF-A </span> in pink | ||
* <span style="color:#FFFFFF; background: | * <span style="color:#FFFFFF; background:{{STLightBlue}};"> STM32CubeMX generated parts </span> in light blue | ||
The above color codes are used for all the figures included in this article. | The above color codes are used for all the figures included in this article. | ||
Line 57: | Line 51: | ||
=== STM32CubeMX generated device tree === | === STM32CubeMX generated device tree === | ||
==== Overview ==== | ==== Overview ==== | ||
[[STM32CubeMX]] can be used to '''generate''' the device tree files for a given project. The tool generates the files <span style="color:#FFFFFF; background: | [[STM32CubeMX]] can be used to '''generate''' the device tree files for a given project. The tool generates the files <span style="color:#FFFFFF; background:{{STLightBlue}};"> highlighted in light blue </span> in the following diagrams, including the upstreamed files shown in the previous chapter.<br /> | ||
<br /> | <br /> | ||
{{ReviewsComments| CMO w845.1, during latest discussion/meeting with SVA/CubeMX team, we keep ProjectName in the name of dts file}} | {{ReviewsComments| CMO w845.1, during latest discussion/meeting with SVA/CubeMX team, we keep ProjectName in the name of dts file}} | ||
Line 73: | Line 67: | ||
==== TF-A ==== | ==== TF-A ==== | ||
[[File:Device tree TF-A STM32CubeMX.png|center|link=]]<br /> | [[File:Device tree TF-A STM32CubeMX.png|center|link=]]<br /> | ||
<noinclude> | |||
[[Category:STM32MP15 platform configuration|6]] | |||
{{PublicationRequestId | 10415 | 2019-01-31 | AnneJ}} | |||
</noinclude> |
Revision as of 14:42, 22 January 2020
1. Purpose and scope
This article shows the structure of the device tree files as it is implemented in STM32MP15 for the following software components: Linux® kernel, U-Boot and TF-A.
The purpose of this article is not to explain the device tree concept and the device tree configuration supported by STM32MP15. A good knowledge of the concept is a prerequisite before reading this article. The articles regarding the configuration can be read afterwards.
2. Device tree structure for Linux, U-Boot and TF-A
2.1. Introduction
The device tree files are used during boot time by the FSBL (TF-A / U-Boot SPL), the SSBL (U-Boot), and eventually by the Linux kernel.
These files are stored in different repositories, but source code reuse is maximized from one repository to another:
- The initial device tree files supporting STM32MP15 are created in the Linux kernel.
- The source code path is arch/arm/boot/dts/stm32mp15* .
- In U-Boot, Linux files are copied and overloaded with U-Boot properties (including DDR configuration).
- The source code path is arch/arm/dts/stm32mp15* .
- In TF-A, Linux files are partly copied (for device tree blob size optimization), and then completed with the DDR configuration copied from U-Boot, and with the security configuration (firewalling).
- The source code path is fdts/stm32mp15* .
The figure below shows the device tree creation flow for Linux, U-Boot and TF-A:

Color legend:
- Linux in dark blue
- U-Boot in green
- TF-A in pink
- STM32CubeMX generated parts in light blue
The above color codes are used for all the figures included in this article.
2.2. Upstreamed device tree
2.2.1. Overview
As explained in the STM32 MPU Embedded Software Open Source Software (OSS) philosophy, STMicroelectronics maximizes the usage of open source software and the upstreaming to the communities.
As a result, the device tree files supporting the evaluation board and the Discovery kit are upstreamed to Linux , U-Boot and TF-A repositories.
2.2.2. Linux


2.2.3. U-Boot


2.2.4. TF-A


Note: The hashed areas on Linux device tree files represent the fact that these files are partly copied in TF-A.
2.3. STM32CubeMX generated device tree
2.3.1. Overview
STM32CubeMX can be used to generate the device tree files for a given project. The tool generates the files highlighted in light blue in the following diagrams, including the upstreamed files shown in the previous chapter.
The device tree files generated by STM32CubeMX can be built with the Developer Package or Distribution Package:
- Use the Developer Package to store the STM32CubeMX-generated files in the folder of your choice. Then, manually copy or link them into Linux, U-Boot and TF-A device tree folders (see introduction). Do not forget to add your device tree file name in ../Makefile.sdk (for TF-A SDK and U-Boot SDK) and in arch/arm/boot/dts/Makefile (for Linux kernel SDK), before compiling them as expalined in How to cross-compile with the Developer Package.
- Use the Distribution Package to store the STM32CubeMX-generated files in meta-st/meta-st-stm32mp-addons/mx, as explained in the How to create your own machine article. This article also describes how to build the complete image. Examples of Linux (device tree), U-Boot and TF-A individual compiling can be found in the How to cross-compile with the Distribution Package article.
2.3.2. Linux

2.3.3. U-Boot

2.3.4. TF-A
