Registered User mNo edit summary |
Registered User mNo edit summary |
||
Line 25: | Line 25: | ||
* config files | * config files | ||
** {{CodeSource | U-Boot | include/configs/stm32mp1.h}} | ** {{CodeSource | U-Boot | include/configs/stm32mp1.h}} | ||
* [[ | * [[STM32_MPU_device_tree]] in {{CodeSource | U-Boot | arch/arm/dts }} : stm32mp15*.dts* | ||
** {{HighlightParam|<Device tree>}}.dts : same as kernel | ** {{HighlightParam|<Device tree>}}.dts : same as kernel | ||
** {{HighlightParam|<Device tree>}}-u-boot.dtsi : addition for u-boot automatically included in build process | ** {{HighlightParam|<Device tree>}}-u-boot.dtsi : addition for u-boot automatically included in build process |
Revision as of 12:01, 22 October 2021
This article briefly describes the STM32MP15x lines support in U-Boot.
1. STM32MP15x lines
support
For detailed information, please read the file in the delivered U-Boot code = doc/board/st/stm32mp1.rst or the stm32mp1 documentation generated by make htlmdocs
[1].
Also available in official U-Boot Git.
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.15x : specific configuration for STM32MP15x lines
- arch/arm/mach-stm32mp/Kconfig : generic configuration for STM32 Arm® Cortex® MPUs
- board/st/common : STMicroelectronics common code
- board/st/stm32mp1 : generic STMicroelectronics board for STM32MP1 Series
- drivers/*/*stm32* : drivers
Configuration Files:
- defconfig file
- config files
- STM32_MPU_device_tree in arch/arm/dts : stm32mp15*.dts*
- <Device tree>.dts : same as kernel
- <Device tree>-u-boot.dtsi : addition for u-boot automatically included in build process
2. Selecting targets : choose defconfig and Device Tree
The STM32 MPU boot chain is supported by one U-Boot configuration with defconfig = stm32mp15_trusted_defconfig
Several boards are supported with the associated device-tree (same name as kernel):
Board part number | Device tree | Description |
---|---|---|
STM32MP157A-EV1 Evaluation board ![]() |
stm32mp157a-ev1 | MB1262+MB1263 |
STM32MP157C-EV1 Evaluation board ![]() |
stm32mp157c-ev1 | |
STM32MP157D-EV1 Evaluation board ![]() |
stm32mp157d-ev1 | |
STM32MP157F-EV1 Evaluation board ![]() |
stm32mp157f-ev1 | |
STM32MP157A-DK1 Discovery kit ![]() |
stm32mp157a-dk1 | MB1272 |
STM32MP157D-DK1 Discovery kit ![]() |
stm32mp157d-dk1 | |
STM32MP157C-DK2 Discovery kit ![]() |
stm32mp157c-dk2 | MB1272+MB1407 |
STM32MP157F-DK2 Discovery kit ![]() |
stm32mp157f-dk2 |
For information the 'Evaluation' daughter-board only (MB1263 without MB1262) is also supported by stm32mp15*-ed1.dts device tree files.
3. Compilation
see U-Boot_overview#U-Boot_build
With the defconfig file: stm32mp15_trusted_defconfig
stm32mp15_trusted_defconfig PC $> make DEVICE_TREE=<Device tree> allPC $> make
The supported variables are:
- DEVICE_TREE: select in arch/arm/dts the device tree that is used
- KBUILD_OUTPUT: change the destination directory for the build
- EXT_DTB: select external device tree
Nota: All the compiled device tree are available in $KBUILD_OUTPUT/arch/arm/dts/*.dtb.
You can select them instead of u-boot.dtb without U-Boot recompilation.
The ouput file is u-boot.stm32 for ecosystem release ≤ v2.1.0 or if you activate CONFIG_STM32MP15x_STM32IMAGE in your defconfig for ecosystem release v3.0.0 (this temporary option is only introduced to facilitate the FIP migration but it will be removed in the next EcosystemRelease).
With FIP support for ecosystem release v3.0.0 , the offset on U-Boot environment in NOR are defined in the defconfig with:
CONFIG_ENV_OFFSET=0x480000
CONFIG_ENV_OFFSET_REDUND=0x4C0000
Without FIP support these MTD partition offsets in NOR for default flashlayout change and to reuse the ecosystem release ≤ v2.1.0 flashlayout the defconfig options become:
CONFIG_STM32MP15x_STM32IMAGE=y
CONFIG_ENV_OFFSET=0x280000
CONFIG_ENV_OFFSET_REDUND=0x2C0000
4. U-Boot integration in FIP
U-Boot binary and its associated device tree are part of the FIP binary, created or updated with TF-A Makefile or with fiptools
:
- BL33_CFG or --hw-config = u-boot.dtb
- BL33 or --nt-fw = u-boot-nodtb.bin
5. SPL compilation
The alternate boot chain with SPL is also supported by "stm32mp15_basic_defconfig" but only for U-Boot_SPL:_DDR_interactive_mode
With the defconfig file: stm32mp15_basic_defconfig
stm32mp15_basic_defconfig PC $> make DEVICE_TREE=<Device tree> allPC $> make
The resulting U-Boot files are located in your build directory:
- u-boot-spl.stm32 : FSBL = SPL binary with STM32 image header, loaded by ROM code
- u-boot.img : SSBL = U-Boot binary with U-Boot image header (uImage), loaded by SPL
6. Examples
6.1. STM32MP157F-EV1 Evaluation board 
stm32mp15_trusted_defconfig PC $> make DEVICE_TREE=stm32mp157f-ev1 allPC $> make
6.2. STM32MP157C-EV1 Evaluation board 
stm32mp15_trusted_defconfig PC $> make DEVICE_TREE=stm32mp157c-ev1 allPC $> make
6.3. STM32MP157D-DK1 Discovery kit 
stm32mp15_trusted_defconfig PC $> make DEVICE_TREE=stm32mp157d-dk1 allPC $> make
6.4. STM32MP157C-DK2 Discovery kit 
Using export to select the device tree
stm32mp157c-dk2 PC $> make stm32mp15_trusted_defconfig PC $> make allPC $> export KBUILD_OUTPUT=../build/stm32mp15_trusted PC $> export DEVICE_TREE=
6.5. Custom board with external device tree
stm32mp15_trusted_defconfig PC $> make EXT_DTB=stm32mp151a-myboard.dtb allPC $> make
6.6. SPL for STM32MP157F-EV1 Evaluation board 
stm32mp157f-ev1 allPC $> make stm32mp15_basic_defconfig PC $> make DEVICE_TREE=