Registered User |
Registered User |
||
(31 intermediate revisions by 5 users not shown) | |||
Line 7: | Line 7: | ||
== {{MicroprocessorDevice | device=13}} support == | == {{MicroprocessorDevice | device=13}} support == | ||
For detailed information, | For detailed information, read the file in the delivered U-Boot code = {{CodeSource | U-Boot | doc/board/st/stm32mp1.rst}} or the documentation generated by <code>make htlmdocs</code>: {{DocSource | domain=U-Boot | path=board/st/stm32mp1.html}}. | ||
Code: | |||
Code : | |||
* {{CodeSource | U-Boot | arch/arm/mach-stm32mp}}: arch specific code for {{MicroprocessorDevice | device=Class}} | * {{CodeSource | U-Boot | arch/arm/mach-stm32mp}}: arch specific code for {{MicroprocessorDevice | device=Class}} | ||
** {{CodeSource | U-Boot | arch/arm/mach-stm32mp/Kconfig}}: generic configuration for {{MicroprocessorDevice | device=Class}} | ** {{CodeSource | U-Boot | arch/arm/mach-stm32mp/Kconfig}}: generic configuration for {{MicroprocessorDevice | device=Class}} | ||
** {{CodeSource | U-Boot | arch/arm/mach-stm32mp/Kconfig.13x}}: specific configuration for {{MicroprocessorDevice | device=13}} | ** {{CodeSource | U-Boot | arch/arm/mach-stm32mp/Kconfig.13x}}: specific configuration for {{MicroprocessorDevice | device=13}} | ||
* {{CodeSource | U-Boot | board/st/common}}: STMicroelectronics common code | * {{CodeSource | U-Boot | board/st/common}}: STMicroelectronics common code | ||
* {{CodeSource | U-Boot | board/st/stm32mp1}}: | * {{CodeSource | U-Boot | board/st/stm32mp1}}: STMicroelectronics boards support for {{MicroprocessorDevice | device=1}} | ||
* drivers/*/*stm32* : drivers | * drivers/*/*stm32* : drivers | ||
Configuration | Configuration files: | ||
* defconfig file | * defconfig file | ||
** {{CodeSource | U-Boot | configs/stm32mp13_defconfig}} | ** {{CodeSource | U-Boot | configs/stm32mp13_defconfig}} | ||
* config files | * config files | ||
** {{CodeSource | U-Boot | include/configs/ | ** {{CodeSource | U-Boot | include/configs/stm32mp13_common.h}}: generic for {{MicroprocessorDevice | device=13}} | ||
* [[STM32_MPU_device_tree]] in {{CodeSource | U-Boot | arch/arm/dts }} : stm32mp13*.dts* | ** {{CodeSource | U-Boot | include/configs/stm32mp13_st_common.h}}: STMicroelectronics board for {{MicroprocessorDevice | device=13}} | ||
** {{HighlightParam|<Device tree>}}.dts : same as kernel | * [[STM32_MPU_device_tree]] in {{CodeSource | U-Boot | arch/arm/dts }}: stm32mp13*.dts* | ||
** {{HighlightParam|<Device tree>}}-u-boot.dtsi : addition for u-boot automatically included in build process | ** {{HighlightParam|<Device tree>}}.dts: same as kernel | ||
** {{HighlightParam|<Device tree>}}-u-boot.dtsi: addition for u-boot automatically included in build process | |||
== Selecting targets : choose defconfig and | == Selecting targets: choose defconfig and device tree == | ||
The [[U-Boot_overview#Kbuild|U-Boot configuration with defconfig]] is {{HighlightParam|stm32mp13_defconfig}} | The [[U-Boot_overview#Kbuild|U-Boot configuration with defconfig]] is {{HighlightParam|stm32mp13_defconfig}}. | ||
The [[ | The [[:Category:STM32_MPU_boards#More_about_STM32MP13_boards|STM32MP13 boards]] are supported with the associated device tree (same name as kernel): | ||
{| class="st-table" | {| class="st-table" | ||
Line 38: | Line 37: | ||
! Board part number !! {{HighlightParam|Device tree}} !! Description | ! Board part number !! {{HighlightParam|Device tree}} !! Description | ||
|- | |- | ||
| '''{{Board | type=135F-DK}}''' || {{CodeSource | U-Boot | arch/arm/dts/stm32mp135f-dk.dts|stm32mp135f-dk}} || [[MB1635]] | | '''{{Board | type=135F-DK}}''' || {{CodeSource | U-Boot | arch/arm/dts/stm32mp135f-dk.dts|stm32mp135f-dk}} || [[STM32MP135x-DK_-_hardware_description|MB1635]] | ||
|} | |} | ||
Line 55: | Line 54: | ||
The supported variables are: | The supported variables are: | ||
* '''DEVICE_TREE''': select in arch/arm/dts the device tree that is used | * '''DEVICE_TREE''': select in arch/arm/dts the device tree that is used. | ||
* '''KBUILD_OUTPUT''': change the destination directory for the build | * '''KBUILD_OUTPUT''': change the destination directory for the build | ||
* '''EXT_DTB''': select external device tree | * '''EXT_DTB''': select external device tree. | ||
The output files {{Highlight|'''u-boot.dtb'''}} and {{Highlight|'''u-boot-nodtb.bin'''}} are integrated in [[#U-Boot integration in FIP|FIP]]. | The output files {{Highlight|'''u-boot.dtb'''}} and {{Highlight|'''u-boot-nodtb.bin'''}} are integrated in [[#U-Boot integration in FIP|FIP]]. | ||
Note: All the compiled devices trees are available in $KBUILD_OUTPUT/arch/arm/dts/*.dtb.<br/>You can select them instead of {{Highlight|u-boot.dtb}} without U-Boot recompilation. | |||
== U-Boot integration in FIP == | == U-Boot integration in FIP == | ||
U-Boot binary and its associated device tree are part of the FIP binary, [[How to configure TF-A FIP#FIP_binary_creation|created]] with TF-A Makefile option : | U-Boot binary and its associated device tree are part of the FIP binary, [[How to configure TF-A FIP#FIP_binary_creation|created]] with TF-A Makefile option: | ||
* {{HighlightParam|BL33_CFG}} = {{Highlight|'''u-boot.dtb'''}} | * {{HighlightParam|BL33_CFG}} = {{Highlight|'''u-boot.dtb'''}} | ||
* {{HighlightParam|BL33}} = {{Highlight|'''u-boot-nodtb.bin'''}} | * {{HighlightParam|BL33}} = {{Highlight|'''u-boot-nodtb.bin'''}} | ||
Line 75: | Line 74: | ||
{{PC$}} fiptool {{HighlightParam|--verbose}} {{Highlight|update}} {{HighlightParam|--nt-fw}} {{Highlight|u-boot-nodtb.bin}} \ | {{PC$}} fiptool {{HighlightParam|--verbose}} {{Highlight|update}} {{HighlightParam|--nt-fw}} {{Highlight|u-boot-nodtb.bin}} \ | ||
{{HighlightParam|--hw-config}} {{Highlight|u-boot.dtb}} \ | {{HighlightParam|--hw-config}} {{Highlight|u-boot.dtb}} \ | ||
''' | '''fip-stm32mp135f-dk.bin''' | ||
DEBUG: Replacing nt-fw with .../u-boot-nodtb.bin | DEBUG: Replacing nt-fw with .../u-boot-nodtb.bin | ||
Line 95: | Line 94: | ||
and | and | ||
{{PC$}} fiptool update {{HighlightParam|--nt-fw}} {{Highlight|u-boot-nodtb.bin}} | {{PC$}} fiptool --verbose update {{HighlightParam|--nt-fw}} {{Highlight|u-boot-nodtb.bin}} {{HighlightParam|--hw-config}} {{Highlight|u-boot.dtb}} \ | ||
'''fip-{{HighlightParam|stm32mp135f-dk}}.bin''' | |||
=== {{Board | type=135F-DK}} with export === | === {{Board | type=135F-DK}} with export === | ||
Line 106: | Line 104: | ||
{{PC$}} make all | {{PC$}} make all | ||
{{PC$}} fiptool update {{HighlightParam|--nt-fw}} {{Highlight|$KBUILD_OUTPUT/u-boot-nodtb.bin}} \ | {{PC$}} fiptool --verbose update {{HighlightParam|--nt-fw}} {{Highlight|$KBUILD_OUTPUT/u-boot-nodtb.bin}} \ | ||
{{HighlightParam|--hw-config}} {{Highlight|$KBUILD_OUTPUT/u-boot.dtb}} \ | {{HighlightParam|--hw-config}} {{Highlight|$KBUILD_OUTPUT/u-boot.dtb}} \ | ||
''' | '''fip-{{HighlightParam|stm32mp135f-dk}}.bin''' | ||
=== Custom board with external device tree === | === Custom board with external device tree === | ||
Line 115: | Line 113: | ||
{{PC$}} make EXT_DTB={{HighlightParam|stm32mp131a-myboard.dtb}} all | {{PC$}} make EXT_DTB={{HighlightParam|stm32mp131a-myboard.dtb}} all | ||
{{PC$}} fiptool update {{HighlightParam|--nt-fw}} {{Highlight|u-boot-nodtb.bin}} \ | {{PC$}} fiptool --verbose update {{HighlightParam|--nt-fw}} {{Highlight|u-boot-nodtb.bin}} \ | ||
{{HighlightParam|--hw-config}} {{Highlight|u-boot.dtb}} \ | {{HighlightParam|--hw-config}} {{Highlight|u-boot.dtb}} \ | ||
''' | '''fip-{{HighlightParam|stm32mp131a-myboard}}.bin''' | ||
<noinclude> | <noinclude> | ||
[[Category:U-Boot|U-Boot - | [[Category:U-Boot|U-Boot - 2 STM32MP13]] | ||
{{PublicationRequestId | 23511| 2022-05-16| 2022 review done by Souade . STM32MP15 U-Boot article reviewed by BrunoB /12895 / 2019-08-01}} | |||
</noinclude> | </noinclude> |
Latest revision as of 21:35, 10 March 2023
This article briefly describes the STM32MP13x lines support in U-Boot.
1. STM32MP13x lines
support
For detailed information, read the file in the delivered U-Boot code = doc/board/st/stm32mp1.rst or the documentation generated by make htlmdocs
: board/st/stm32mp1.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.13x : specific configuration for STM32MP13x lines
- arch/arm/mach-stm32mp/Kconfig : generic configuration for STM32 Arm® Cortex® MPUs
- board/st/common : STMicroelectronics common code
- board/st/stm32mp1 : STMicroelectronics boards support for STM32MP1 Series
- drivers/*/*stm32* : drivers
Configuration files:
- defconfig file
- config files
- include/configs/stm32mp13_common.h : generic for STM32MP13x lines
- include/configs/stm32mp13_st_common.h : STMicroelectronics board for STM32MP13x lines
- include/configs/stm32mp13_common.h : generic for STM32MP13x lines
- STM32_MPU_device_tree in arch/arm/dts : stm32mp13*.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 U-Boot configuration with defconfig is stm32mp13_defconfig.
The STM32MP13 boards are supported with the associated device tree (same name as kernel):
Board part number | Device tree | Description |
---|---|---|
STM32MP135F-DK Discovery kit ![]() |
stm32mp135f-dk | MB1635 |
3. Compilation
see U-Boot_overview#U-Boot_build
For STM32MP135F-DK Discovery kit , the device tree is already selected in defconfig stm32mp13_defconfig
stm32mp13_defconfig PC $> make allPC $> make
For other boards, you need to select the correct device tree
stm32mp13_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.
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.
4. U-Boot integration in FIP
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 STM32MP135F-DK Discovery kit :
--verbose update --nt-fw u-boot-nodtb.bin \ --hw-config u-boot.dtb \ fip-stm32mp135f-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: ... bytesPC $> fiptool
5. Examples
5.1. STM32MP135F-DK Discovery kit 
stm32mp13_defconfig PC $> make allPC $> make
or
stm32mp13_defconfig PC $> make DEVICE_TREE=stm32mp135f-dk allPC $> make
and
--nt-fw u-boot-nodtb.bin --hw-config u-boot.dtb \ fip-stm32mp135f-dk.binPC $> fiptool --verbose update
5.2. STM32MP135F-DK Discovery kit
with export
stm32mp135f-dk PC $> make stm32mp13_defconfig PC $> make allPC $> export KBUILD_OUTPUT=../build/stm32mp13 PC $> export DEVICE_TREE=
--nt-fw $KBUILD_OUTPUT/u-boot-nodtb.bin \ --hw-config $KBUILD_OUTPUT/u-boot.dtb \ fip-stm32mp135f-dk.binPC $> fiptool --verbose update
5.3. Custom board with external device tree
stm32mp13_defconfig PC $> make EXT_DTB=stm32mp131a-myboard.dtb allPC $> make
--nt-fw u-boot-nodtb.bin \ --hw-config u-boot.dtb \ fip-stm32mp131a-myboard.binPC $> fiptool --verbose update