STM32MP13 U-Boot

Applicable for STM32MP13x lines

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

1 STM32MP13x lines More info.png support[edit]

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:

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

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 More info green.png stm32mp135f-dk MB1635

3 Compilation[edit]

see U-Boot_overview#U-Boot_build

For STM32MP135F-DK Discovery kit More info green.png, the device tree is already selected in defconfig stm32mp13_defconfig

  make stm32mp13_defconfig
  make all

For other boards, you need to select the correct device tree

  make stm32mp13_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.

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[edit]

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 More info green.png:

  fiptool --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: ... bytes

5 Examples[edit]

5.1 STM32MP135F-DK Discovery kit More info green.png[edit]

  make stm32mp13_defconfig
  make  all

or

  make stm32mp13_defconfig
  make DEVICE_TREE=stm32mp135f-dk all

and

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

5.2 STM32MP135F-DK Discovery kit More info green.png with export[edit]

  export KBUILD_OUTPUT=../build/stm32mp13
  export DEVICE_TREE=stm32mp135f-dk
  make stm32mp13_defconfig
  make all
  fiptool --verbose update --nt-fw $KBUILD_OUTPUT/u-boot-nodtb.bin \
             --hw-config  $KBUILD_OUTPUT/u-boot.dtb \
             fip-stm32mp135f-dk.bin

5.3 Custom board with external device tree[edit]

  make stm32mp13_defconfig
  make EXT_DTB=stm32mp131a-myboard.dtb all
  fiptool --verbose update --nt-fw u-boot-nodtb.bin \
             --hw-config  u-boot.dtb \
             fip-stm32mp131a-myboard.bin