cancel
Showing results for 
Search instead for 
Did you mean: 

Booting directly to kernel from TFA on stm32mp157DAC

adnan_pasha
Associate III

Hi,

I am working on optimizing the boot process on my STM32MP157DAC board by removing U-Boot and booting the Linux kernel directly. I’ve been following the documented procedure from ST for the STM32MP1 series:
ST Wiki - How to optimize the boot time

TF-A Configuration

I’ve updated the configuration in stm32mp1_def.h as follows:

    • #define STM32MP_BL33_BASE (STM32MP_DDR_BASE + U(0x2008000))
      #define STM32MP_BL33_MAX_SIZE U(0x3FF8000)
  1. SD Card Timeout Modification

    Modified the SD card timeout value in <tf-a_sources>/drivers/st/mmc/stm32_sdmmc2.c:

    • timeout = timeout_init_us(TIMEOUT_US_1_S * 10);
  2. TF-A Build Process:

    • I applied the changes as a patch through my custom Yocto layer and rebuilt the tf-a-stm32mp recipe successfully.

  3. Kernel Configuration:

      • I added the following configuration parameters to my stm32_defconfig:
        CONFIG_CMDLINE_BOOL=y
        CONFIG_CMDLINE="root=PARTUUID=e91c4e10-16e6-4c0e-bd0e-77becf4a3582 rootwait rw earlyprintk earlycon console=ttySTM0,115200"

      • I created and applied a patch for this as well via my custom Yocto layer.

  4. FIP Tool Update:

    • I updated the FIP image using fiptool:

      fiptool update --nt-fw kernel/uImage --hw-config kernel/stm32mp157f-dk2.dtb fip/fip-stm32mp157f-dk2-optee-sdcard.bin
    • The result was the new FIP file: fip-stm32mp157f-dk2-optee-sdcard.bin

  5. Flash Layout Modification:

    • I modified the TSV file as follows to include the new TF-A and FIP binaries:

      #OptIdNameTypeIPOffsetBinary
      -0x01fsbl-bootBinarynone0x0arm-trusted-firmware/tf-a-stm32mp157f-dk2-usb.stm32
      -0x03fip-bootFIPnone0x0fip/fip-stm32mp157f-dk2-optee-emmc.bin
      P0x04fsbl1Binarymmc1boot1arm-trusted-firmware/tf-a-stm32mp157f-dk2-optee-emmc.stm32
      P0x05fsbl2Binarymmc1boot2arm-trusted-firmware/tf-a-stm32mp157f-dk2-optee-emmc.stm32
      P0x06metadata1FWU_MDATAmmc10x00080000arm-trusted-firmware/metadata.bin
      P0x07metadata2FWU_MDATAmmc10x00100000arm-trusted-firmware/metadata.bin
      P0x08fip-aFIPmmc10x00180000fip/fip-stm32mp157f-dk2-optee-emmc.bin
      PED0x09fip-bFIPmmc10x02180000none
      PED0x0Au-boot-envENVmmc10x02580000none
      P0x10bootfsSystemmmc10x02600000st-image-bootfs-openstlinux-weston-stm32mp15-disco.ext4
      P0x11vendorfsFileSystemmmc10x06600000st-image-vendorfs-openstlinux-weston-stm32mp15-disco.ext4
      P0x12rootfsFileSystemmmc10x07600000st-image-qt-openstlinux-weston-stm32mp15-disco.ext4

 

When attempting to flash the image using STM32CubeProgrammer, I receive a timeout error indicating "unable to reconnect", and the operation fails at partition 0x03.

I’ve also attached the patch with my TF-A and kernel changes. Please let me know if there’s anything I may have missed or need to correct.

For reference, I’ve reviewed a related thread on ST’s community forum:
Direct kernel boot on STM32MP1

Thanks.

0 REPLIES 0