Last edited 3 weeks ago

STM32MP23 U-Boot

Applicable for Unknown MPU

This article briefly describes the STM32MP23 unknown microprocessor device support in U-Boot.

1. STM32MP23 unknown microprocessor device 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:

Configuration files:

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

The U-Boot configuration with defconfig is stm32mp23_defconfig.

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

Board part number Device tree Description
STM32MP235F-DK stm32mp235F-DK Discovery Board

3. Compilation[edit | edit source]

see U-Boot_overview#U-Boot_build, with installed aarch64 cross-compiler.

For STM32MP235F-DK, the device tree is already selected in defconfig stm32mp23_defconfig

 make stm32mp23_defconfig
 make all

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

 make stm32mp23_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 TF-A 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.

See EXT_DTS example in next chapter "STM32MP235F-DK with OSTL device tree".

4. Examples[edit | edit source]

4.1. STM32MP235F-DK[edit | edit source]

 make stm32mp23_defconfig
 make DEVICE_TREE=stm32mp235f-dk all

and

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

4.2. STM32MP235F-DK with export[edit | edit source]

 export KBUILD_OUTPUT=../build/stm32mp23
 export DEVICE_TREE=stm32mp235f-dk
 make stm32mp23_defconfig
 make  all

and

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

4.3. STM32MP235F-DK with OSTL device tree[edit | edit source]

For compilation of OSTL device tree in the external Git, u-boot/stm32mp235f-dk-ostl.dts, you can use the git submodule command:

 git submodule add https://github.com/STMicroelectronics/dt-stm32mp arch/arm/dts/external-dt
 make stm32mp23_defconfig
 make DEVICE_TREE=stm32mp235f-dk-ostl all

or git clone command with EXT_DTS:

 git clone https://github.com/STMicroelectronics/dt-stm32mp ../dt-stm32mp
 make stm32mp23_defconfig
 make EXT_DTS=$PATH/dt-stm32mp DEVICE_TREE=stm32mp235f-dk-ostl all

and

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

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

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