stm32mp1.rst 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. STM32MP1
  2. ========
  3. STM32MP1 is a microprocessor designed by STMicroelectronics
  4. based on Arm Cortex-A7.
  5. It is an Armv7-A platform, using dedicated code from TF-A.
  6. More information can be found on `STM32MP1 Series`_ page.
  7. For TF-A common configuration of STM32 MPUs, please check
  8. :ref:`STM32 MPUs` page.
  9. STM32MP1 Versions
  10. -----------------
  11. There are 2 variants for STM32MP1: STM32MP13 and STM32MP15
  12. STM32MP13 Versions
  13. ~~~~~~~~~~~~~~~~~~
  14. The STM32MP13 series is available in 3 different lines which are pin-to-pin compatible:
  15. - STM32MP131: Single Cortex-A7 core
  16. - STM32MP133: STM32MP131 + 2*CAN, ETH2(GMAC), ADC1
  17. - STM32MP135: STM32MP133 + DCMIPP, LTDC
  18. Each line comes with a security option (cryptography & secure boot) and a Cortex-A frequency option:
  19. - A Cortex-A7 @ 650 MHz
  20. - C Secure Boot + HW Crypto + Cortex-A7 @ 650 MHz
  21. - D Cortex-A7 @ 900 MHz
  22. - F Secure Boot + HW Crypto + Cortex-A7 @ 900 MHz
  23. STM32MP15 Versions
  24. ~~~~~~~~~~~~~~~~~~
  25. The STM32MP15 series is available in 3 different lines which are pin-to-pin compatible:
  26. - STM32MP157: Dual Cortex-A7 cores, Cortex-M4 core @ 209 MHz, 3D GPU, DSI display interface and CAN FD
  27. - STM32MP153: Dual Cortex-A7 cores, Cortex-M4 core @ 209 MHz and CAN FD
  28. - STM32MP151: Single Cortex-A7 core, Cortex-M4 core @ 209 MHz
  29. Each line comes with a security option (cryptography & secure boot) and a Cortex-A frequency option:
  30. - A Basic + Cortex-A7 @ 650 MHz
  31. - C Secure Boot + HW Crypto + Cortex-A7 @ 650 MHz
  32. - D Basic + Cortex-A7 @ 800 MHz
  33. - F Secure Boot + HW Crypto + Cortex-A7 @ 800 MHz
  34. The `STM32MP1 part number codification`_ page gives more information about part numbers.
  35. Memory mapping
  36. --------------
  37. ::
  38. 0x00000000 +-----------------+
  39. | | ROM
  40. 0x00020000 +-----------------+
  41. | |
  42. | ... |
  43. | |
  44. 0x2FFC0000 +-----------------+ \
  45. | BL32 DTB | |
  46. 0x2FFC5000 +-----------------+ |
  47. | BL32 | |
  48. 0x2FFDF000 +-----------------+ |
  49. | ... | |
  50. 0x2FFE3000 +-----------------+ |
  51. | BL2 DTB | | Embedded SRAM
  52. 0x2FFEA000 +-----------------+ |
  53. | BL2 | |
  54. 0x2FFFF000 +-----------------+ |
  55. | SCMI mailbox | |
  56. 0x30000000 +-----------------+ /
  57. | |
  58. | ... |
  59. | |
  60. 0x40000000 +-----------------+
  61. | |
  62. | | Devices
  63. | |
  64. 0xC0000000 +-----------------+ \
  65. | | |
  66. 0xC0100000 +-----------------+ |
  67. | BL33 | | Non-secure RAM (DDR)
  68. | ... | |
  69. | | |
  70. 0xFFFFFFFF +-----------------+ /
  71. Build Instructions
  72. ------------------
  73. STM32MP1x specific flags
  74. ~~~~~~~~~~~~~~~~~~~~~~~~
  75. Dedicated STM32MP1 flags:
  76. - | ``STM32_TF_VERSION``: to manage BL2 monotonic counter.
  77. | Default: 0
  78. - | ``STM32MP13``: to select STM32MP13 variant configuration.
  79. | Default: 0
  80. - | ``STM32MP15``: to select STM32MP15 variant configuration.
  81. | Default: 1
  82. Boot with FIP
  83. ~~~~~~~~~~~~~
  84. You need to build BL2, BL32 (SP_min or OP-TEE) and BL33 (U-Boot) before building FIP binary.
  85. U-Boot
  86. ______
  87. .. code:: bash
  88. cd <u-boot_directory>
  89. make stm32mp15_trusted_defconfig
  90. make DEVICE_TREE=stm32mp157c-ev1 all
  91. OP-TEE (recommended)
  92. ____________________
  93. OP-TEE is the default BL32 supported for STMicroelectronics platforms.
  94. .. code:: bash
  95. cd <optee_directory>
  96. make CROSS_COMPILE=arm-linux-gnueabihf- ARCH=arm PLATFORM=stm32mp1 \
  97. CFG_EMBED_DTB_SOURCE_FILE=stm32mp157c-ev1.dts
  98. TF-A BL32 (SP_min) (not recommended)
  99. ____________________________________
  100. If you choose not to use OP-TEE, you can use TF-A SP_min.
  101. This is not the recommended BL32 to use, and will have very limited support.
  102. To build TF-A BL32, and its device tree file:
  103. .. code:: bash
  104. make CROSS_COMPILE=arm-none-eabi- PLAT=stm32mp1 ARCH=aarch32 ARM_ARCH_MAJOR=7 \
  105. AARCH32_SP=sp_min DTB_FILE_NAME=stm32mp157c-ev1.dtb bl32 dtbs
  106. TF-A BL2
  107. ________
  108. To build TF-A BL2 with its STM32 header for SD-card boot:
  109. .. code:: bash
  110. make CROSS_COMPILE=arm-none-eabi- PLAT=stm32mp1 ARCH=aarch32 ARM_ARCH_MAJOR=7 \
  111. DTB_FILE_NAME=stm32mp157c-ev1.dtb STM32MP_SDMMC=1
  112. For other boot devices, you have to replace STM32MP_SDMMC in the previous command
  113. with the desired device flag.
  114. This BL2 is independent of the BL32 used (SP_min or OP-TEE)
  115. FIP
  116. ___
  117. With BL32 SP_min:
  118. .. code:: bash
  119. make CROSS_COMPILE=arm-none-eabi- PLAT=stm32mp1 ARCH=aarch32 ARM_ARCH_MAJOR=7 \
  120. AARCH32_SP=sp_min \
  121. DTB_FILE_NAME=stm32mp157c-ev1.dtb \
  122. BL33=<u-boot_directory>/u-boot-nodtb.bin \
  123. BL33_CFG=<u-boot_directory>/u-boot.dtb \
  124. fip
  125. With OP-TEE:
  126. .. code:: bash
  127. make CROSS_COMPILE=arm-none-eabi- PLAT=stm32mp1 ARCH=aarch32 ARM_ARCH_MAJOR=7 \
  128. AARCH32_SP=optee \
  129. DTB_FILE_NAME=stm32mp157c-ev1.dtb \
  130. BL33=<u-boot_directory>/u-boot-nodtb.bin \
  131. BL33_CFG=<u-boot_directory>/u-boot.dtb \
  132. BL32=<optee_directory>/tee-header_v2.bin \
  133. BL32_EXTRA1=<optee_directory>/tee-pager_v2.bin
  134. BL32_EXTRA2=<optee_directory>/tee-pageable_v2.bin
  135. fip
  136. Trusted Boot Board
  137. __________________
  138. .. code:: shell
  139. tools/cert_create/cert_create -n --rot-key build/stm32mp1/release/rot_key.pem \
  140. --tfw-nvctr 0 \
  141. --ntfw-nvctr 0 \
  142. --key-alg ecdsa --hash-alg sha256 \
  143. --trusted-key-cert build/stm32mp1/release/trusted_key.crt \
  144. --tos-fw <optee_directory>/tee-header_v2.bin \
  145. --tos-fw-extra1 <optee_directory>/tee-pager_v2.bin \
  146. --tos-fw-extra2 <optee_directory>/tee-pageable_v2.bin \
  147. --tos-fw-cert build/stm32mp1/release/tos_fw_content.crt \
  148. --tos-fw-key-cert build/stm32mp1/release/tos_fw_key.crt \
  149. --nt-fw <u-boot_directory>/u-boot-nodtb.bin \
  150. --nt-fw-cert build/stm32mp1/release/nt_fw_content.crt \
  151. --nt-fw-key-cert build/stm32mp1/release/nt_fw_key.crt \
  152. --hw-config <u-boot_directory>/u-boot.dtb \
  153. --fw-config build/stm32mp1/release/fdts/fw-config.dtb \
  154. --stm32mp-cfg-cert build/stm32mp1/release/stm32mp_cfg_cert.crt
  155. tools/fiptool/fiptool create --tos-fw <optee_directory>/tee-header_v2.bin \
  156. --tos-fw-extra1 <optee_directory>/tee-pager_v2.bin \
  157. --tos-fw-extra2 <optee_directory>/tee-pageable_v2.bin \
  158. --nt-fw <u-boot_directory>/u-boot-nodtb.bin \
  159. --hw-config <u-boot_directory>/u-boot.dtb \
  160. --fw-config build/stm32mp1/release/fdts/fw-config.dtb \
  161. --trusted-key-cert build/stm32mp1/release/trusted_key.crt \
  162. --tos-fw-cert build/stm32mp1/release/tos_fw_content.crt \
  163. --tos-fw-key-cert build/stm32mp1/release/tos_fw_key.crt \
  164. --nt-fw-cert build/stm32mp1/release/nt_fw_content.crt \
  165. --nt-fw-key-cert build/stm32mp1/release/nt_fw_key.crt \
  166. --stm32mp-cfg-cert build/stm32mp1/release/stm32mp_cfg_cert.crt \
  167. build/stm32mp1/release/stm32mp1.fip
  168. .. _STM32MP1 Series: https://www.st.com/en/microcontrollers-microprocessors/stm32mp1-series.html
  169. .. _STM32MP1 part number codification: https://wiki.st.com/stm32mpu/wiki/STM32MP15_microprocessor#Part_number_codification
  170. *Copyright (c) 2023-2024, STMicroelectronics - All Rights Reserved*