This article shows the structure of the device tree files as it is implemented in OpenSTLinux for Linux® kernel, U-Boot, TF-A and OP-TEE.
The purpose of this article is not to explain the device tree concept and the device tree configuration supported by STM32MP1 Series. 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↑
The device tree files are used during boot time by the FSBL (TF-A), the secure OS (OP-TEE), the SSBL (U-Boot) and, at run time, by the Linux kernel.
These files are stored in different github repositories (one for each first level bullet below), but source code reuse is maximized from one repository to another:
The initial device tree files supporting STM32MP1 Series are created in the Linux kernel.
The U-Boot add-ons file, "-u-boot.dtsi", is automatically included at the end of ".dts" during device tree compilation: this is a generic U-Boot Makefile behavior, see binman.rst.
In TF-A, Linux files are copied, completed with the security configuration (firewalling) and the DDR configuration. TF-A BL2 is applying some 'delete-property' on useless nodes, to lighten the final dtb file.
The figure below shows the device tree files structure for Linux, U-Boot, TF-A and OP-TEE:
Information
The board level device tree file completes and/or overloads the default peripherals nodes configuration, defined in the included SoC dtsi file.
The above figure reflects the current implementation on github and may be somehow in advance compare to the upstreamed version for all parts that are still under review.
For the sake of simplicity, the figure only shows the dtsi & dtsfiles structure, without showing the h files that are also included.
The dtb files, resulting from the compilation with the dtc compiler, may be named differently when the compilation is launched with the 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 Device tree structure). 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 explained 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.
This article shows the structure of the device tree files as it is implemented in OpenSTLinux for Linux® kernel, U-Boot, TF-A and OP-TEE.
The purpose of this article is not to explain the device tree concept and the device tree configuration supported by STM32MP1 Series. 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↑
The device tree files are used during boot time by the FSBL (TF-A), the secure OS (OP-TEE), the SSBL (U-Boot) and, at run time, by the Linux kernel.
These files are stored in different github repositories (one for each first level bullet below), but source code reuse is maximized from one repository to another:
The initial device tree files supporting STM32MP1 Series are created in the Linux kernel.
The U-Boot add-ons file, "-u-boot.dtsi", is automatically included at the end of ".dts" during device tree compilation: this is a generic U-Boot Makefile behavior, see binman.rst.
In TF-A, Linux files are copied, completed with the security configuration (firewalling) and the DDR configuration. TF-A BL2 is applying some 'delete-property' on useless nodes, to lighten the final dtb file.
The figure below shows the device tree files structure for Linux, U-Boot, TF-A and OP-TEE:
Information
The board level device tree file completes and/or overloads the default peripherals nodes configuration, defined in the included SoC dtsi file.
The above figure reflects the current implementation on github and may be somehow in advance compare to the upstreamed version for all parts that are still under review.
For the sake of simplicity, the figure only shows the dtsi & dtsfiles structure, without showing the h files that are also included.
The dtb files, resulting from the compilation with the dtc compiler, may be named differently when the compilation is launched with the 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 Device tree structure). 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 explained 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.