Last edited 2 months ago

STM32MP15 U-Boot

Applicable for STM32MP15x lines

This article briefly describes the STM32MP15x lines More info.png support in U-Boot.

1. STM32MP15x lines More info.png support[edit | edit source]

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 :

Configuration files:

The two next defconfig are kept only for compatibility with upstream, don't use them:

2. Selecting targets : choose defconfig and device tree[edit | edit source]

The STM32 MPU boot chain is supported by one U-Boot configuration with defconfig = stm32mp15_defconfig

Several boards are supported with the associated device-tree (same name as kernel):

Board part number Device tree Description
STM32MP157A-EV1 Evaluation board Warning.png stm32mp157a-ev1 MB1262+MB1263
STM32MP157C-EV1 Evaluation board Warning.png stm32mp157c-ev1
STM32MP157D-EV1 Evaluation board More info green.png stm32mp157d-ev1
STM32MP157F-EV1 Evaluation board More info green.png stm32mp157f-ev1
STM32MP157A-DK1 Discovery kit Warning.png stm32mp157a-dk1 MB1272
STM32MP157D-DK1 Discovery kit More info green.png stm32mp157d-dk1
STM32MP157C-DK2 Discovery kit Warning.png stm32mp157c-dk2 MB1272+MB1407
STM32MP157F-DK2 Discovery kit More info green.png stm32mp157f-dk2

For information the 'Evaluation' daughter-board only (MB1263 without MB1262) is also supported by stm32mp15*-ed1.dts device tree files.

Warning white.png Warning
In OpenSTLinux, the content the board device tree <board>.dts have the same content then upstreamed smci device tree <board>-scmi.dts, thanks to #include "<board>-scmi.dtsi"

in official U-Boot version, the smci device tree <board>-scmi.dts are used with stm32mp15_defconfig when the system resources are secured in OP-TEE (RCC_TZCR.TZEN:1), the configuration recommended by STMicroelectronics for product.
see board/st/stm32mp1.html (vlatest) for details.

3. Compilation[edit | edit source]

See U-Boot_overview#U-Boot_build with the defconfig file: stm32mp15_defconfig

 make stm32mp15_defconfig
 make DEVICE_TREE=<Device tree> all

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
  • 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 TF-A FIP.

Note: All the compiled device trees are available in $KBUILD_OUTPUT/arch/arm/dts/*.dtb.
You can select them instead of u-boot.dtb without U-Boot recompilation.

4. Examples[edit | edit source]

4.1. STM32MP157F-EV1 Evaluation board More info green.png[edit | edit source]

 make stm32mp15_defconfig
 make DEVICE_TREE=stm32mp157f-ev1 all

An existing FIP file is updated with:

 fiptool --verbose update --nt-fw u-boot-nodtb.bin --hw-config u-boot.dtb \
              fip-stm32mp157f-ev1.bin

4.2. STM32MP157C-EV1 Evaluation board Warning.png[edit | edit source]

 make stm32mp15_defconfig
 make DEVICE_TREE=stm32mp157c-ev1 all

An existing FIP file is updated with:

 fiptool --verbose update --nt-fw u-boot-nodtb.bin --hw-config u-boot.dtb \
              fip-stm32mp157c-ev1.bin

4.3. STM32MP157D-DK1 Discovery kit More info green.png[edit | edit source]

 make stm32mp15_defconfig
 make DEVICE_TREE=stm32mp157d-dk1 all

An existing FIP file is updated with:

 fiptool --verbose update --nt-fw u-boot-nodtb.bin --hw-config u-boot.dtb \
              fip-stm32mp157d-dk1.bin

4.4. STM32MP157C-DK2 Discovery kit Warning.png[edit | edit source]

Using export to select the device tree

 export KBUILD_OUTPUT=../build/stm32mp15
 export DEVICE_TREE=stm32mp157c-dk2
 make stm32mp15_defconfig
 make all

An existing FIP file is updated with:

 fiptool --verbose update --nt-fw $KBUILD_OUTPUT/u-boot-nodtb.bin \
              --hw-config  $KBUILD_OUTPUT/u-boot.dtb \
              fip-stm32mp157c-dk2.bin

4.5. Custom board with external device tree[edit | edit source]

 make stm32mp15_defconfig
 make EXT_DTB=stm32mp151a-myboard.dtb all

Then you can create or update the FIP