This article briefly describes the STM32MP25x lines support in U-Boot.
1. STM32MP25x lines support[edit | edit source]
For detailed information, read the file in the delivered U-Boot code = doc/board/st/stm32mp2.rst or the documentation generated by make htlmdocs
: board/st/stm32mp2.html.
Code:
- arch/arm/mach-stm32mp : arch specific code for STM32 Arm® Cortex® MPUs
- arch/arm/mach-stm32mp/Kconfig : generic configuration for STM32 Arm® Cortex® MPUs
- arch/arm/mach-stm32mp/Kconfig.25x : specific configuration for STM32MP25x lines
- board/st/common : STMicroelectronics common code
- board/st/stm32mp2 : STMicroelectronics boards support for STM32MP2 series
- drivers/*/*stm32* : drivers
Configuration files:
- defconfig file
- config files
- include/configs/stm32mp25_common.h : generic for STM32MP25x lines
- include/configs/stm32mp25_st_common.h : STMicroelectronics board for STM32MP25x lines
- STM32_MPU_device_tree in arch/arm/dts : stm32mp25*.dts*
- <Device tree>.dts: same as kernel
- <Device tree>-u-boot.dtsi: addition for u-boot automatically included in build process
- stm32mp25-u-boot.dtsi : SoC add-on file included in <Device tree>-u-boot.dtsi
2. Selecting targets: choose defconfig and device tree[edit | edit source]
The U-Boot configuration with defconfig is stm32mp25_defconfig.
The boards are supported with the associated device tree (same name as kernel):
Board part number | Device tree | Description |
---|---|---|
STM32MP257F-DK Discovery kit | stm32mp257f-dk | MB1605 |
STM32MP257F-EV1 Evaluation board | stm32mp257f-ev1 | MB1936 |
STMicroelectronics internal boards with Cut1.0 (old revision of board):
3. Compilation[edit | edit source]
see U-Boot_overview#U-Boot_build, with installed aarch64 cross-compiler.
For STM32MP257F-EV1 Evaluation board , the device tree is already selected in defconfig stm32mp25_defconfig
make stm32mp25_defconfig
make all
For other boards, you need to select the correct device tree
make stm32mp25_defconfig make DEVICE_TREE=<Device tree> all
The supported variables are:
- DEVICE_TREE: select in arch/arm/dts or in EXT_DTS the device tree that is used.
- KBUILD_OUTPUT: change the destination directory for the build
- EXT_DTB: select external device tree.
- EXT_DTS: select PATH of external device tree source, by default the sub-directory "arch/arm/dts/external-dt" is used to allow sub-module.
The output files u-boot.dtb and u-boot-nodtb.bin are integrated in FIP.
Note: All the compiled devices trees are available in $KBUILD_OUTPUT/arch/arm/dts/*.dtb.
You can select them instead of u-boot.dtb without U-Boot recompilation.
3.1. External device tree[edit | edit source]
OpenSTLinux provides some additional device trees in a separate Git: https://github.com/STMicroelectronics/dt-stm32mp.
You can select with DEVICE_TREE any files presnet in the u-boot directory of this Git by
- using submodule in "arch/arm/dts/external-dt"
git submodule add https://github.com/STMicroelectronics/dt-stm32mp arch/arm/dts/external-dt
- cloning this Git in any location <DTS_PATH> and using EXT_DTS=<DTS_PATH> in make command
git clone https://github.com/STMicroelectronics/dt-stm32mp <DTS_PATH>
See example for STM32MP257F-EV1 Evaluation board with OSTL device tree.
4. U-Boot integration in FIP[edit | edit source]
U-Boot binary and its associated device tree are part of the FIP binary, created with TF-A Makefile option:
- BL33_CFG = u-boot.dtb
- BL33 = u-boot-nodtb.bin
or updated with fiptools
:
- --hw-config u-boot.dtb
- --nt-fw u-boot-nodtb.bin
Example for FIP update of STM32MP257F-DK Discovery kit :
fiptool --verbose update --nt-fw u-boot-nodtb.bin \ --hw-config u-boot.dtb \ fip-stm32mp257f-dk.bin DEBUG: Replacing nt-fw with .../u-boot-nodtb.bin DEBUG: Replacing hw-config with .../u-boot.dtb DEBUG: Metadata size: ... bytes DEBUG: Payload size: ... bytes
5. Examples[edit | edit source]
5.1. STM32MP257F-DK Discovery kit [edit | edit source]
make stm32mp25_defconfig make DEVICE_TREE=stm32mp257f-dk all
and
fiptool --verbose update --nt-fw u-boot-nodtb.bin --hw-config u-boot.dtb \ fip-stm32mp257f-dk.bin
5.2. STM32MP257F-EV1 Evaluation board with export[edit | edit source]
export KBUILD_OUTPUT=../build/stm32mp25 export DEVICE_TREE=stm32mp257f-ev1 make stm32mp25_defconfig make all
and
fiptool --verbose update --nt-fw $KBUILD_OUTPUT/u-boot-nodtb.bin \ --hw-config $KBUILD_OUTPUT/u-boot.dtb \ fip-stm32mp257f-ev1.bin
5.3. STM32MP257F-EV1 Evaluation board with OSTL device tree[edit | edit source]
For compilation of OSTL device tree in the external Git, u-boot/stm32mp257f-ev1-ostl.dts, you can use the git submodule
command:
git submodule add https://github.com/STMicroelectronics/dt-stm32mp arch/arm/dts/external-dt make stm32mp25_defconfig make DEVICE_TREE=stm32mp257f-ev1-ostl all
or git clone
command with EXT_DTS:
git clone https://github.com/STMicroelectronics/dt-stm32mp ../dt-stm32mp make stm32mp25_defconfig make EXT_DTS=$PATH/dt-stm32mp DEVICE_TREE=stm32mp257f-ev1-ostl all
and
fiptool --verbose update --nt-fw u-boot-nodtb.bin \ --hw-config u-boot.dtb \ fip-stm32mp257f-ev1-ostl.bin
5.4. Custom board with external device tree[edit | edit source]
make stm32mp25_defconfig make EXT_DTB=stm32mp257f-myboard.dtb all
fiptool --verbose update --nt-fw u-boot-nodtb.bin \ --hw-config u-boot.dtb \ fip-stm32mp257f-myboard.bin