Yann Gautier | e6ecc3c | 2023-03-17 14:02:12 +0100 | [diff] [blame] | 1 | STM32MP2 |
| 2 | ======== |
| 3 | |
| 4 | STM32MP2 is a microprocessor designed by STMicroelectronics |
| 5 | based on Arm Cortex-A35. |
| 6 | |
Yann Gautier | 7271ab4 | 2023-03-29 17:36:11 +0200 | [diff] [blame] | 7 | More information can be found on `STM32MP2 Series`_ page. |
| 8 | |
Yann Gautier | e6ecc3c | 2023-03-17 14:02:12 +0100 | [diff] [blame] | 9 | For TF-A common configuration of STM32 MPUs, please check |
| 10 | :ref:`STM32 MPUs` page. |
| 11 | |
| 12 | STM32MP2 Versions |
| 13 | ----------------- |
| 14 | |
Yann Gautier | 7d6dffa | 2023-04-20 17:02:52 +0200 | [diff] [blame^] | 15 | Here are the variants for STM32MP2: |
| 16 | - STM32MP21 |
| 17 | - STM32MP25 |
| 18 | |
| 19 | STM32MP21 Versions |
| 20 | ~~~~~~~~~~~~~~~~~~ |
| 21 | The STM32MP21 series is available in 3 different lines which are pin-to-pin compatible: |
| 22 | |
| 23 | - STM32MP215: Single Cortex-A35 + Cortex-M33 - 2x Ethernet - 2x CAN FD - CSI - LTDC |
| 24 | - STM32MP213: Single Cortex-A35 + Cortex-M33 - 2x Ethernet - 2x CAN FD |
| 25 | - STM32MP211: Single Cortex-A35 + Cortex-M33 - 1x Ethernet |
| 26 | |
| 27 | Each line comes with a security option (cryptography & secure boot) and a Cortex-A frequency option: |
| 28 | |
| 29 | - A Basic + Cortex-A35 @ 1.2GHz |
| 30 | - C Secure Boot + HW Crypto + Cortex-A35 @ 1.2GHz |
| 31 | - D Basic + Cortex-A35 @ 1.5GHz |
| 32 | - F Secure Boot + HW Crypto + Cortex-A35 @ 1.5GHz |
| 33 | |
| 34 | STM32MP25 Versions |
| 35 | ~~~~~~~~~~~~~~~~~~ |
Yann Gautier | e6ecc3c | 2023-03-17 14:02:12 +0100 | [diff] [blame] | 36 | The STM32MP25 series is available in 4 different lines which are pin-to-pin compatible: |
| 37 | |
| 38 | - STM32MP257: Dual Cortex-A35 cores, Cortex-M33 core - 3x Ethernet (2+1 switch) - 3x CAN FD – H264 - 3D GPU – AI / NN - LVDS |
| 39 | - STM32MP255: Dual Cortex-A35 cores, Cortex-M33 core - 2x Ethernet – 3x CAN FD - H264 - 3D GPU – AI / NN - LVDS |
| 40 | - STM32MP253: Dual Cortex-A35 cores, Cortex-M33 core - 2x Ethernet – 3x CAN FD - LVDS |
| 41 | - STM32MP251: Single Cortex-A35 core, Cortex-M33 core - 1x Ethernet |
| 42 | |
| 43 | Each line comes with a security option (cryptography & secure boot) and a Cortex-A frequency option: |
| 44 | |
Nicolas Le Bayon | b62f54e | 2024-02-02 18:31:36 +0100 | [diff] [blame] | 45 | - A Basic + Cortex-A35 @ 1.2GHz |
| 46 | - C Secure Boot + HW Crypto + Cortex-A35 @ 1.2GHz |
Yann Gautier | e6ecc3c | 2023-03-17 14:02:12 +0100 | [diff] [blame] | 47 | - D Basic + Cortex-A35 @ 1.5GHz |
| 48 | - F Secure Boot + HW Crypto + Cortex-A35 @ 1.5GHz |
| 49 | |
Yann Gautier | 7271ab4 | 2023-03-29 17:36:11 +0200 | [diff] [blame] | 50 | The `STM32MP2 part number codification`_ page gives more information about part numbers. |
| 51 | |
Yann Gautier | e6ecc3c | 2023-03-17 14:02:12 +0100 | [diff] [blame] | 52 | Memory mapping |
| 53 | -------------- |
| 54 | |
| 55 | :: |
| 56 | |
| 57 | 0x00000000 +-----------------+ |
| 58 | | | |
| 59 | | ... | |
| 60 | | | |
| 61 | 0x0E000000 +-----------------+ \ |
| 62 | | BL31 | | |
| 63 | +-----------------+ | |
| 64 | | ... | | |
| 65 | 0x0E012000 +-----------------+ | |
| 66 | | BL2 DTB | | Embedded SRAM |
| 67 | 0x0E016000 +-----------------+ | |
| 68 | | BL2 | | |
| 69 | 0x0E040000 +-----------------+ / |
| 70 | | | |
| 71 | | ... | |
| 72 | | | |
| 73 | 0x40000000 +-----------------+ |
| 74 | | | |
| 75 | | | Devices |
| 76 | | | |
| 77 | 0x80000000 +-----------------+ \ |
| 78 | | | | |
| 79 | | | | Non-secure RAM (DDR) |
| 80 | | | | |
| 81 | 0xFFFFFFFF +-----------------+ / |
| 82 | |
| 83 | |
| 84 | Build Instructions |
| 85 | ------------------ |
| 86 | |
| 87 | STM32MP2x specific flags |
| 88 | ~~~~~~~~~~~~~~~~~~~~~~~~ |
| 89 | |
| 90 | Dedicated STM32MP2 build flags: |
| 91 | |
| 92 | - | ``STM32MP_DDR_FIP_IO_STORAGE``: to store DDR firmware in FIP. |
| 93 | | Default: 1 |
Yann Gautier | 7d6dffa | 2023-04-20 17:02:52 +0200 | [diff] [blame^] | 94 | - | ``STM32MP21``: to select STM32MP21 variant configuration. |
| 95 | | Default: 0 |
Yann Gautier | e6ecc3c | 2023-03-17 14:02:12 +0100 | [diff] [blame] | 96 | - | ``STM32MP25``: to select STM32MP25 variant configuration. |
| 97 | | Default: 1 |
| 98 | |
| 99 | To compile the correct DDR driver, one flag must be set among: |
| 100 | |
| 101 | - | ``STM32MP_DDR3_TYPE``: to compile DDR3 driver and DT. |
| 102 | | Default: 0 |
| 103 | - | ``STM32MP_DDR4_TYPE``: to compile DDR4 driver and DT. |
| 104 | | Default: 0 |
| 105 | - | ``STM32MP_LPDDR4_TYPE``: to compile LpDDR4 driver and DT. |
| 106 | | Default: 0 |
| 107 | |
| 108 | |
| 109 | Boot with FIP |
| 110 | ~~~~~~~~~~~~~ |
Maxime Méré | b151f68 | 2024-09-13 17:57:58 +0200 | [diff] [blame] | 111 | You need to build BL2, BL31, BL32 (OP-TEE) and BL33 (U-Boot) and retrieve |
| 112 | DDR PHY firmware before building FIP binary. |
Yann Gautier | e6ecc3c | 2023-03-17 14:02:12 +0100 | [diff] [blame] | 113 | |
| 114 | U-Boot |
| 115 | ______ |
| 116 | |
| 117 | .. code:: bash |
| 118 | |
| 119 | cd <u-boot_directory> |
| 120 | make stm32mp25_defconfig |
| 121 | make DEVICE_TREE=stm32mp257f-ev1 all |
| 122 | |
| 123 | OP-TEE |
| 124 | ______ |
| 125 | |
| 126 | .. code:: bash |
| 127 | |
| 128 | cd <optee_directory> |
| 129 | make CROSS_COMPILE64=aarch64-none-elf- CROSS_COMPILE32=arm-none-eabi- |
| 130 | ARCH=arm PLATFORM=stm32mp2 \ |
| 131 | CFG_EMBED_DTB_SOURCE_FILE=stm32mp257f-ev1.dts |
| 132 | |
Maxime Méré | b151f68 | 2024-09-13 17:57:58 +0200 | [diff] [blame] | 133 | DDR PHY firmware |
| 134 | ________________ |
| 135 | DDR PHY firmware files may not be delivered inside TF-A repository, especially |
| 136 | if you build directly from trustedfirmware.org repository. It then needs to be |
| 137 | retrieved from `STMicroelectronics DDR PHY github`_. |
| 138 | |
| 139 | You can either clone the repository to the default directory: |
| 140 | |
| 141 | .. code:: bash |
| 142 | |
| 143 | git clone https://github.com/STMicroelectronics/stm32-ddr-phy-binary.git drivers/st/ddr/phy/firmware/bin |
| 144 | |
| 145 | Or clone it somewhere else, and add ``STM32MP_DDR_FW_PATH=`` in your make command |
| 146 | line when building FIP. |
| 147 | |
| 148 | TF-A BL2 |
| 149 | ________ |
| 150 | To build TF-A BL2 with its STM32 header for SD-card boot: |
Yann Gautier | e6ecc3c | 2023-03-17 14:02:12 +0100 | [diff] [blame] | 151 | |
| 152 | .. code:: bash |
| 153 | |
| 154 | make CROSS_COMPILE=aarch64-none-elf- PLAT=stm32mp2 \ |
| 155 | STM32MP_DDR4_TYPE=1 SPD=opteed \ |
| 156 | DTB_FILE_NAME=stm32mp257f-ev1.dtb STM32MP_SDMMC=1 |
| 157 | |
| 158 | For other boot devices, you have to replace STM32MP_SDMMC in the previous command |
| 159 | with the desired device flag. |
| 160 | |
| 161 | |
| 162 | FIP |
| 163 | ___ |
| 164 | |
| 165 | .. code:: bash |
| 166 | |
| 167 | make CROSS_COMPILE=aarch64-none-elf- PLAT=stm32mp2 \ |
| 168 | STM32MP_DDR4_TYPE=1 SPD=opteed \ |
| 169 | DTB_FILE_NAME=stm32mp257f-ev1.dtb \ |
| 170 | BL33=<u-boot_directory>/u-boot-nodtb.bin \ |
| 171 | BL33_CFG=<u-boot_directory>/u-boot.dtb \ |
| 172 | BL32=<optee_directory>/tee-header_v2.bin \ |
| 173 | BL32_EXTRA1=<optee_directory>/tee-pager_v2.bin |
| 174 | fip |
| 175 | |
Yann Gautier | 7271ab4 | 2023-03-29 17:36:11 +0200 | [diff] [blame] | 176 | .. _STM32MP2 Series: https://www.st.com/en/microcontrollers-microprocessors/stm32mp2-series.html |
| 177 | .. _STM32MP2 part number codification: https://wiki.st.com/stm32mpu/wiki/STM32MP25_microprocessor#Part_number_codification |
Maxime Méré | b151f68 | 2024-09-13 17:57:58 +0200 | [diff] [blame] | 178 | .. _STMicroelectronics DDR PHY github: https://github.com/STMicroelectronics/stm32-ddr-phy-binary |
Yann Gautier | 7271ab4 | 2023-03-29 17:36:11 +0200 | [diff] [blame] | 179 | |
Yann Gautier | 7d6dffa | 2023-04-20 17:02:52 +0200 | [diff] [blame^] | 180 | *Copyright (c) 2023-2025, STMicroelectronics - All Rights Reserved* |