stm32mp2.rst 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. STM32MP2
  2. ========
  3. STM32MP2 is a microprocessor designed by STMicroelectronics
  4. based on Arm Cortex-A35.
  5. More information can be found on `STM32MP2 Series`_ page.
  6. For TF-A common configuration of STM32 MPUs, please check
  7. :ref:`STM32 MPUs` page.
  8. STM32MP2 Versions
  9. -----------------
  10. The STM32MP25 series is available in 4 different lines which are pin-to-pin compatible:
  11. - STM32MP257: Dual Cortex-A35 cores, Cortex-M33 core - 3x Ethernet (2+1 switch) - 3x CAN FD – H264 - 3D GPU – AI / NN - LVDS
  12. - STM32MP255: Dual Cortex-A35 cores, Cortex-M33 core - 2x Ethernet – 3x CAN FD - H264 - 3D GPU – AI / NN - LVDS
  13. - STM32MP253: Dual Cortex-A35 cores, Cortex-M33 core - 2x Ethernet – 3x CAN FD - LVDS
  14. - STM32MP251: Single Cortex-A35 core, Cortex-M33 core - 1x Ethernet
  15. Each line comes with a security option (cryptography & secure boot) and a Cortex-A frequency option:
  16. - A Basic + Cortex-A35 @ 1.2GHz
  17. - C Secure Boot + HW Crypto + Cortex-A35 @ 1.2GHz
  18. - D Basic + Cortex-A35 @ 1.5GHz
  19. - F Secure Boot + HW Crypto + Cortex-A35 @ 1.5GHz
  20. The `STM32MP2 part number codification`_ page gives more information about part numbers.
  21. Memory mapping
  22. --------------
  23. ::
  24. 0x00000000 +-----------------+
  25. | |
  26. | ... |
  27. | |
  28. 0x0E000000 +-----------------+ \
  29. | BL31 | |
  30. +-----------------+ |
  31. | ... | |
  32. 0x0E012000 +-----------------+ |
  33. | BL2 DTB | | Embedded SRAM
  34. 0x0E016000 +-----------------+ |
  35. | BL2 | |
  36. 0x0E040000 +-----------------+ /
  37. | |
  38. | ... |
  39. | |
  40. 0x40000000 +-----------------+
  41. | |
  42. | | Devices
  43. | |
  44. 0x80000000 +-----------------+ \
  45. | | |
  46. | | | Non-secure RAM (DDR)
  47. | | |
  48. 0xFFFFFFFF +-----------------+ /
  49. Build Instructions
  50. ------------------
  51. STM32MP2x specific flags
  52. ~~~~~~~~~~~~~~~~~~~~~~~~
  53. Dedicated STM32MP2 build flags:
  54. - | ``STM32MP_DDR_FIP_IO_STORAGE``: to store DDR firmware in FIP.
  55. | Default: 1
  56. - | ``STM32MP25``: to select STM32MP25 variant configuration.
  57. | Default: 1
  58. To compile the correct DDR driver, one flag must be set among:
  59. - | ``STM32MP_DDR3_TYPE``: to compile DDR3 driver and DT.
  60. | Default: 0
  61. - | ``STM32MP_DDR4_TYPE``: to compile DDR4 driver and DT.
  62. | Default: 0
  63. - | ``STM32MP_LPDDR4_TYPE``: to compile LpDDR4 driver and DT.
  64. | Default: 0
  65. Boot with FIP
  66. ~~~~~~~~~~~~~
  67. You need to build BL2, BL31, BL32 (OP-TEE) and BL33 (U-Boot) and retrieve
  68. DDR PHY firmware before building FIP binary.
  69. U-Boot
  70. ______
  71. .. code:: bash
  72. cd <u-boot_directory>
  73. make stm32mp25_defconfig
  74. make DEVICE_TREE=stm32mp257f-ev1 all
  75. OP-TEE
  76. ______
  77. .. code:: bash
  78. cd <optee_directory>
  79. make CROSS_COMPILE64=aarch64-none-elf- CROSS_COMPILE32=arm-none-eabi-
  80. ARCH=arm PLATFORM=stm32mp2 \
  81. CFG_EMBED_DTB_SOURCE_FILE=stm32mp257f-ev1.dts
  82. DDR PHY firmware
  83. ________________
  84. DDR PHY firmware files may not be delivered inside TF-A repository, especially
  85. if you build directly from trustedfirmware.org repository. It then needs to be
  86. retrieved from `STMicroelectronics DDR PHY github`_.
  87. You can either clone the repository to the default directory:
  88. .. code:: bash
  89. git clone https://github.com/STMicroelectronics/stm32-ddr-phy-binary.git drivers/st/ddr/phy/firmware/bin
  90. Or clone it somewhere else, and add ``STM32MP_DDR_FW_PATH=`` in your make command
  91. line when building FIP.
  92. TF-A BL2
  93. ________
  94. To build TF-A BL2 with its STM32 header for SD-card boot:
  95. .. code:: bash
  96. make CROSS_COMPILE=aarch64-none-elf- PLAT=stm32mp2 \
  97. STM32MP_DDR4_TYPE=1 SPD=opteed \
  98. DTB_FILE_NAME=stm32mp257f-ev1.dtb STM32MP_SDMMC=1
  99. For other boot devices, you have to replace STM32MP_SDMMC in the previous command
  100. with the desired device flag.
  101. FIP
  102. ___
  103. .. code:: bash
  104. make CROSS_COMPILE=aarch64-none-elf- PLAT=stm32mp2 \
  105. STM32MP_DDR4_TYPE=1 SPD=opteed \
  106. DTB_FILE_NAME=stm32mp257f-ev1.dtb \
  107. BL33=<u-boot_directory>/u-boot-nodtb.bin \
  108. BL33_CFG=<u-boot_directory>/u-boot.dtb \
  109. BL32=<optee_directory>/tee-header_v2.bin \
  110. BL32_EXTRA1=<optee_directory>/tee-pager_v2.bin
  111. fip
  112. .. _STM32MP2 Series: https://www.st.com/en/microcontrollers-microprocessors/stm32mp2-series.html
  113. .. _STM32MP2 part number codification: https://wiki.st.com/stm32mpu/wiki/STM32MP25_microprocessor#Part_number_codification
  114. .. _STMicroelectronics DDR PHY github: https://github.com/STMicroelectronics/stm32-ddr-phy-binary
  115. *Copyright (c) 2023-2024, STMicroelectronics - All Rights Reserved*