Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause |
Patrice Chotard | 90e8278 | 2021-01-04 17:00:56 +0100 | [diff] [blame] | 2 | .. sectionauthor:: Patrick Delaunay <patrick.delaunay@foss.st.com> |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 3 | |
| 4 | STM32MP15x boards |
| 5 | ================= |
| 6 | |
| 7 | This is a quick instruction for setup STM32MP15x boards. |
| 8 | |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 9 | Futher information can be found in STMicrolectronics STM32 WIKI_. |
| 10 | |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 11 | Supported devices |
| 12 | ----------------- |
| 13 | |
| 14 | U-Boot supports STMP32MP15x SoCs: |
| 15 | |
| 16 | - STM32MP157 |
| 17 | - STM32MP153 |
| 18 | - STM32MP151 |
| 19 | |
| 20 | The STM32MP15x is a Cortex-A MPU aimed at various applications. |
| 21 | |
| 22 | It features: |
| 23 | |
| 24 | - Dual core Cortex-A7 application core (Single on STM32MP151) |
| 25 | - 2D/3D image composition with GPU (only on STM32MP157) |
| 26 | - Standard memories interface support |
| 27 | - Standard connectivity, widely inherited from the STM32 MCU family |
| 28 | - Comprehensive security support |
| 29 | |
Patrick Delaunay | db33b0e | 2020-02-26 11:26:43 +0100 | [diff] [blame] | 30 | Each line comes with a security option (cryptography & secure boot) and |
| 31 | a Cortex-A frequency option: |
| 32 | |
| 33 | - A : Cortex-A7 @ 650 MHz |
| 34 | - C : Secure Boot + HW Crypto + Cortex-A7 @ 650 MHz |
| 35 | - D : Cortex-A7 @ 800 MHz |
| 36 | - F : Secure Boot + HW Crypto + Cortex-A7 @ 800 MHz |
| 37 | |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 38 | Everything is supported in Linux but U-Boot is limited to: |
| 39 | |
| 40 | 1. UART |
| 41 | 2. SD card/MMC controller (SDMMC) |
| 42 | 3. NAND controller (FMC) |
| 43 | 4. NOR controller (QSPI) |
| 44 | 5. USB controller (OTG DWC2) |
| 45 | 6. Ethernet controller |
| 46 | |
| 47 | And the necessary drivers |
| 48 | |
| 49 | 1. I2C |
| 50 | 2. STPMIC1 (PMIC and regulator) |
| 51 | 3. Clock, Reset, Sysreset |
| 52 | 4. Fuse |
| 53 | |
| 54 | Currently the following boards are supported: |
| 55 | |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 56 | + stm32mp157a-dk1.dts |
| 57 | + stm32mp157c-dk2.dts |
| 58 | + stm32mp157c-ed1.dts |
| 59 | + stm32mp157c-ev1.dts |
Marek Vasut | 526c951 | 2020-03-31 19:51:36 +0200 | [diff] [blame] | 60 | + stm32mp15xx-dhcor-avenger96.dts |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 61 | |
| 62 | Boot Sequences |
| 63 | -------------- |
| 64 | |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 65 | 2 boot configurations are supported with: |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 66 | |
| 67 | +----------+------------------------+-------------------------+--------------+ |
| 68 | | **ROM** | **FSBL** | **SSBL** | **OS** | |
| 69 | + **code** +------------------------+-------------------------+--------------+ |
| 70 | | | First Stage Bootloader | Second Stage Bootloader | Linux Kernel | |
| 71 | + +------------------------+-------------------------+--------------+ |
| 72 | | | embedded RAM | DDR | |
| 73 | +----------+------------------------+-------------------------+--------------+ |
| 74 | |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 75 | The **Trusted** boot chain with TF-A_ |
| 76 | ````````````````````````````````````` |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 77 | |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 78 | defconfig_file : |
| 79 | + **stm32mp15_defconfig** (for TF-A_ with FIP support) |
| 80 | + **stm32mp15_trusted_defconfig** (for TF-A_ without FIP support) |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 81 | |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 82 | +-------------+--------------------------+------------+-------+ |
| 83 | | ROM code | FSBL | SSBL | OS | |
| 84 | + +--------------------------+------------+-------+ |
| 85 | | |Trusted Firmware-A (TF-A_)| U-Boot | Linux | |
| 86 | +-------------+--------------------------+------------+-------+ |
| 87 | | TrustZone |secure monitor = SPMin or OP-TEE_ | |
| 88 | +-------------+--------------------------+------------+-------+ |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 89 | |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 90 | TF-A_ and OP-TEE_ are 2 separate projects, with their git repository; |
| 91 | they are compiled separately. |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 92 | |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 93 | TF-A_ (BL2) initialize the DDR and loads the next stage binaries from a FIP file: |
| 94 | + BL32: a secure monitor BL32 = SPMin provided by TF-A_ or OP-TEE_ : |
| 95 | performs a full initialization of Secure peripherals and provides service |
| 96 | to normal world |
| 97 | + BL33: a non-trusted firmware = U-Boot, running in normal world and uses |
| 98 | the secure monitor to access to secure resources. |
| 99 | + HW_CONFIG: The hardware configuration file = the U-Boot device tree |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 100 | |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 101 | The **Basic** boot chain with SPL |
| 102 | ````````````````````````````````` |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 103 | |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 104 | defconfig_file : |
| 105 | + **stm32mp15_basic_defconfig** |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 106 | |
| 107 | +-------------+------------+------------+-------+ |
| 108 | | ROM code | FSBL | SSBL | OS | |
| 109 | + +------------+------------+-------+ |
| 110 | | |U-Boot SPL | U-Boot | Linux | |
| 111 | +-------------+------------+------------+-------+ |
| 112 | | TrustZone | | PSCI from U-Boot | |
| 113 | +-------------+------------+------------+-------+ |
| 114 | |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 115 | SPL has limited security initialization. |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 116 | |
| 117 | U-Boot is running in secure mode and provide a secure monitor to the kernel |
| 118 | with only PSCI support (Power State Coordination Interface defined by ARM). |
| 119 | |
| 120 | All the STM32MP15x boards supported by U-Boot use the same generic board |
| 121 | stm32mp1 which support all the bootable devices. |
| 122 | |
| 123 | Each board is configured only with the associated device tree. |
| 124 | |
| 125 | Device Tree Selection |
| 126 | --------------------- |
| 127 | |
| 128 | You need to select the appropriate device tree for your board, |
| 129 | the supported device trees for STM32MP15x are: |
| 130 | |
| 131 | + ev1: eval board with pmic stpmic1 (ev1 = mother board + daughter ed1) |
| 132 | |
| 133 | + stm32mp157c-ev1 |
| 134 | |
| 135 | + ed1: daughter board with pmic stpmic1 |
| 136 | |
| 137 | + stm32mp157c-ed1 |
| 138 | |
| 139 | + dk1: Discovery board |
| 140 | |
| 141 | + stm32mp157a-dk1 |
| 142 | |
| 143 | + dk2: Discovery board = dk1 with a BT/WiFI combo and a DSI panel |
| 144 | |
| 145 | + stm32mp157c-dk2 |
| 146 | |
Marek Vasut | 526c951 | 2020-03-31 19:51:36 +0200 | [diff] [blame] | 147 | + avenger96: Avenger96 board from Arrow Electronics based on DH Elec. DHCOR SoM |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 148 | |
Marek Vasut | 526c951 | 2020-03-31 19:51:36 +0200 | [diff] [blame] | 149 | + stm32mp15xx-dhcor-avenger96 |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 150 | |
| 151 | Build Procedure |
| 152 | --------------- |
| 153 | |
| 154 | 1. Install the required tools for U-Boot |
| 155 | |
| 156 | * install package needed in U-Boot makefile |
| 157 | (libssl-dev, swig, libpython-dev...) |
| 158 | |
| 159 | * install ARMv7 toolchain for 32bit Cortex-A (from Linaro, |
| 160 | from SDK for STM32MP15x, or any crosstoolchains from your distribution) |
| 161 | (you can use any gcc cross compiler compatible with U-Boot) |
| 162 | |
| 163 | 2. Set the cross compiler:: |
| 164 | |
| 165 | # export CROSS_COMPILE=/path/to/toolchain/arm-linux-gnueabi- |
| 166 | |
| 167 | 3. Select the output directory (optional):: |
| 168 | |
| 169 | # export KBUILD_OUTPUT=/path/to/output |
| 170 | |
| 171 | for example: use one output directory for each configuration:: |
| 172 | |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 173 | # export KBUILD_OUTPUT=stm32mp15 |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 174 | # export KBUILD_OUTPUT=stm32mp15_trusted |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 175 | # export KBUILD_OUTPUT=stm32mp15_basic |
| 176 | |
| 177 | you can build outside of code directory:: |
| 178 | |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 179 | # export KBUILD_OUTPUT=../build/stm32mp15 |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 180 | |
| 181 | 4. Configure U-Boot:: |
| 182 | |
| 183 | # make <defconfig_file> |
| 184 | |
| 185 | with <defconfig_file>: |
| 186 | |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 187 | - For **trusted** boot mode : **stm32mp15_defconfig** or |
| 188 | stm32mp15_trusted_defconfig |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 189 | - For basic boot mode: stm32mp15_basic_defconfig |
| 190 | |
| 191 | 5. Configure the device-tree and build the U-Boot image:: |
| 192 | |
| 193 | # make DEVICE_TREE=<name> all |
| 194 | |
| 195 | Examples: |
| 196 | |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 197 | a) trusted boot with FIP on ev1:: |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 198 | |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 199 | # export KBUILD_OUTPUT=stm32mp15 |
| 200 | # make stm32mp15_defconfig |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 201 | # make DEVICE_TREE=stm32mp157c-ev1 all |
| 202 | |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 203 | b) trusted boot without FIP on dk2:: |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 204 | |
Patrick Delaunay | 6557aa8 | 2020-03-18 09:22:51 +0100 | [diff] [blame] | 205 | # export KBUILD_OUTPUT=stm32mp15_trusted |
| 206 | # make stm32mp15_trusted_defconfig |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 207 | # make DEVICE_TREE=stm32mp157c-dk2 all |
| 208 | |
| 209 | c) basic boot on ev1:: |
| 210 | |
| 211 | # export KBUILD_OUTPUT=stm32mp15_basic |
| 212 | # make stm32mp15_basic_defconfig |
| 213 | # make DEVICE_TREE=stm32mp157c-ev1 all |
| 214 | |
| 215 | d) basic boot on ed1:: |
| 216 | |
| 217 | # export KBUILD_OUTPUT=stm32mp15_basic |
| 218 | # make stm32mp15_basic_defconfig |
| 219 | # make DEVICE_TREE=stm32mp157c-ed1 all |
| 220 | |
| 221 | e) basic boot on dk1:: |
| 222 | |
| 223 | # export KBUILD_OUTPUT=stm32mp15_basic |
| 224 | # make stm32mp15_basic_defconfig |
| 225 | # make DEVICE_TREE=stm32mp157a-dk1 all |
| 226 | |
| 227 | f) basic boot on avenger96:: |
| 228 | |
| 229 | # export KBUILD_OUTPUT=stm32mp15_basic |
| 230 | # make stm32mp15_basic_defconfig |
Marek Vasut | 526c951 | 2020-03-31 19:51:36 +0200 | [diff] [blame] | 231 | # make DEVICE_TREE=stm32mp15xx-dhcor-avenger96 all |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 232 | |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 233 | 6. U-Boot Output files |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 234 | |
| 235 | So in the output directory (selected by KBUILD_OUTPUT), |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 236 | you can found the needed U-Boot files: |
| 237 | |
| 238 | - stm32mp15_defconfig = **u-boot-nodtb.bin** and **u-boot.dtb** |
| 239 | |
| 240 | - stm32mp15_trusted_defconfig = u-boot.stm32 |
| 241 | |
| 242 | - stm32mp15_basic_defconfig |
| 243 | |
| 244 | - FSBL = spl/u-boot-spl.stm32 |
| 245 | |
| 246 | - SSBL = u-boot.img (without CONFIG_SPL_LOAD_FIT) or |
| 247 | u-boot.itb (with CONFIG_SPL_LOAD_FIT=y) |
| 248 | |
| 249 | 7. TF-A_ compilation |
| 250 | |
| 251 | This step is required only for **Trusted** boot (stm32mp15_defconfig and |
| 252 | stm32mp15_trusted_defconfig); see OP-TEE_ and TF-A_ documentation for build |
| 253 | commands. |
| 254 | |
| 255 | - For TF-A_ with FIP support: **stm32mp15_defconfig** |
| 256 | |
| 257 | - with OP-TEE_ support, compile the OP-TEE to generate the binary included |
| 258 | in FIP |
| 259 | |
| 260 | - after TF-A compilation, the used files are: |
| 261 | |
| 262 | - TF-A_ BL2 => FSBL = **tf-a.stm32** |
| 263 | |
| 264 | - FIP => **fip.bin** |
| 265 | |
| 266 | FIP file includes the 2 files given in arguments of TF-A_ compilation: |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 267 | |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 268 | - BL33=u-boot-nodtb.bin |
| 269 | - BL33_CFG=u-boot.dtb |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 270 | |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 271 | You can also update a existing FIP after U-boot compilation with fiptool, |
| 272 | a tool provided by TF-A_:: |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 273 | |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 274 | # fiptool update --nt-fw u-boot-nodtb.bin --hw-config u-boot.dtb fip-stm32mp157c-ev1.bin |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 275 | |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 276 | - For TF-A_ without FIP support : **stm32mp15_trusted_defconfig** |
| 277 | SPMin is used and the used files are: |
| 278 | |
| 279 | - FSBL = **tf-a.stm32** (provided by TF-A_ compilation, contening BL2 and |
| 280 | BL32 = SPMin) |
| 281 | |
| 282 | - SSBL = **u-boot.stm32** used instead of fip.bin in next chapters |
| 283 | |
| 284 | 8. The bootloaders files |
| 285 | |
| 286 | + The **ROM code** expects FSBL binaries with STM32 image header = |
| 287 | tf-a.stm32 or u-boot-spl.stm32 |
| 288 | |
| 289 | According the FSBL / the boot mode: |
| 290 | |
| 291 | + **TF-A** expect a FIP binary = fip.bin, including the OS monitor (SPMin or |
| 292 | OP-TEE_) and the U-Boot binary + device tree |
| 293 | |
| 294 | or, without FIP support, binaries with STM32 image header: U-Boot |
| 295 | = u-boot.stm32 and eventually OP-TEE files (tee-header.stm32, tee-pageable.stm32, |
| 296 | tee-pager.stm32) |
| 297 | |
| 298 | + **SPL** expects SSBL = U-Boot with uImage header = u-boot.img |
| 299 | or FIT = u-boot.itb. |
| 300 | |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 301 | |
| 302 | Switch Setting for Boot Mode |
| 303 | ---------------------------- |
| 304 | |
| 305 | You can select the boot mode, on the board with one switch, to select |
| 306 | the boot pin values = BOOT0, BOOT1, BOOT2 |
| 307 | |
| 308 | +-------------+---------+---------+---------+ |
| 309 | |*Boot Mode* | *BOOT2* | *BOOT1* | *BOOT0* | |
| 310 | +=============+=========+=========+=========+ |
| 311 | | Recovery | 0 | 0 | 0 | |
| 312 | +-------------+---------+---------+---------+ |
| 313 | | NOR | 0 | 0 | 1 | |
| 314 | +-------------+---------+---------+---------+ |
| 315 | | eMMC | 0 | 1 | 0 | |
| 316 | +-------------+---------+---------+---------+ |
| 317 | | NAND | 0 | 1 | 1 | |
| 318 | +-------------+---------+---------+---------+ |
| 319 | | Reserved | 1 | 0 | 0 | |
| 320 | +-------------+---------+---------+---------+ |
| 321 | | SD-Card | 1 | 0 | 1 | |
| 322 | +-------------+---------+---------+---------+ |
| 323 | | Recovery | 1 | 1 | 0 | |
| 324 | +-------------+---------+---------+---------+ |
| 325 | | SPI-NAND | 1 | 1 | 1 | |
| 326 | +-------------+---------+---------+---------+ |
| 327 | |
| 328 | - on the **daugther board ed1 = MB1263** with the switch SW1 |
| 329 | - on **Avenger96** with switch S3 (NOR and SPI-NAND are not applicable) |
| 330 | - on board **DK1/DK2** with the switch SW1 = BOOT0, BOOT2 |
| 331 | with only 2 pins available (BOOT1 is forced to 0 and NOR not supported), |
| 332 | the possible value becomes: |
| 333 | |
| 334 | +-------------+---------+---------+ |
| 335 | |*Boot Mode* | *BOOT2* | *BOOT0* | |
| 336 | +=============+=========+=========+ |
| 337 | | Recovery | 0 | 0 | |
| 338 | +-------------+---------+---------+ |
| 339 | | NOR (NA)| 0 | 1 | |
| 340 | +-------------+---------+---------+ |
| 341 | | Reserved | 1 | 0 | |
| 342 | +-------------+---------+---------+ |
| 343 | | SD-Card | 1 | 1 | |
| 344 | +-------------+---------+---------+ |
| 345 | |
| 346 | Recovery is a boot from serial link (UART/USB) and it is used with |
| 347 | STM32CubeProgrammer tool to load executable in RAM and to update the flash |
| 348 | devices available on the board (NOR/NAND/eMMC/SD card). |
| 349 | |
| 350 | The communication between HOST and board is based on |
| 351 | |
| 352 | - for UARTs : the uart protocol used with all MCU STM32 |
| 353 | - for USB : based on USB DFU 1.1 (without the ST extensions used on MCU STM32) |
| 354 | |
| 355 | Prepare an SD card |
| 356 | ------------------ |
| 357 | |
| 358 | The minimal requirements for STMP32MP15x boot up to U-Boot are: |
| 359 | |
| 360 | - GPT partitioning (with gdisk or with sgdisk) |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 361 | - 2 fsbl partitions, named "fsbl1" and "fsbl2", size at least 256KiB |
| 362 | - one partition named "fip" for FIP or U-Boot (TF-A_ search the "fip" |
| 363 | partition and SPL search the 3th partition, because |
| 364 | CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION=3) |
| 365 | |
| 366 | The 2 fsbl partitions have the same content and are present to guarantee a |
| 367 | fail-safe update of FSBL; fsbl2 can be omitted if this ROM code feature is |
| 368 | not required. |
| 369 | |
| 370 | Without FIP support in TF-A_, the 3rd partition "fip" for u-boot.stm32 must |
| 371 | be named "ssbl". |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 372 | |
| 373 | Then the minimal GPT partition is: |
| 374 | |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 375 | For TF-A_ with FIP support: |
| 376 | |
| 377 | +-------+--------+---------+------------------------+ |
| 378 | | *Num* | *Name* | *Size* | *Content* | |
| 379 | +=======+========+=========+========================+ |
| 380 | | 1 | fsbl1 | 256 KiB | TF-A_ BL2 (tf-a.stm32) | |
| 381 | +-------+--------+---------+------------------------+ |
| 382 | | 2 | fsbl2 | 256 KiB | TF-A_ BL2 (tf-a.stm32) | |
| 383 | +-------+--------+---------+------------------------+ |
| 384 | | 3 | fip | 4MB | fip.bin | |
| 385 | +-------+--------+---------+------------------------+ |
| 386 | | 4 | <any> | <any> | Rootfs | |
| 387 | +-------+--------+---------+------------------------+ |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 388 | |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 389 | or: |
| 390 | |
| 391 | +-------+--------+---------+------------------------+------------------------+ |
| 392 | | *Num* | *Name* | *Size* | *Trusted boot content* | *Basic boot content* | |
| 393 | +=======+========+=========+========================+========================+ |
| 394 | | 1 | fsbl1 | 256 KiB | TF-A_ BL2 (tf-a.stm32) | SPL (u-boot-spl.stm32) | |
| 395 | +-------+--------+---------+------------------------+------------------------+ |
| 396 | | 2 | fsbl2 | 256 KiB | TF-A_ BL2 (tf-a.stm32) | SPL (u-boot-spl.stm32) | |
| 397 | +-------+--------+---------+------------------------+------------------------+ |
| 398 | | 3 | ssbl | 2MB | U-Boot (u-boot.stm32) | U-Boot (u-boot.img) | |
| 399 | +-------+--------+---------+------------------------+------------------------+ |
| 400 | | 4 | <any> | <any> | Rootfs | |
| 401 | +-------+--------+---------+------------------------+------------------------+ |
| 402 | |
| 403 | And the 4th partition (Rootfs) is marked bootable with a file extlinux.conf |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 404 | following the Generic Distribution feature (doc/README.distro for use). |
| 405 | |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 406 | The size of fip or ssbl partition must be enough for the associated binary file, |
| 407 | 4MB and 2MB are default values. |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 408 | |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 409 | According the used card reader select the correct block device |
| 410 | (for example /dev/sdx or /dev/mmcblk0), in the next example, it is /dev/mmcblk0 |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 411 | |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 412 | For example: |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 413 | |
| 414 | a) remove previous formatting:: |
| 415 | |
| 416 | # sgdisk -o /dev/<SD card dev> |
| 417 | |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 418 | b) create minimal image for FIP |
| 419 | |
| 420 | For FIP support in TF-A_:: |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 421 | |
| 422 | # sgdisk --resize-table=128 -a 1 \ |
| 423 | -n 1:34:545 -c 1:fsbl1 \ |
| 424 | -n 2:546:1057 -c 2:fsbl2 \ |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 425 | -n 3:1058:9249 -c 3:fip \ |
| 426 | -n 4:9250: -c 4:rootfs -A 4:set:2 \ |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 427 | -p /dev/<SD card dev> |
| 428 | |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 429 | With gpt table with 128 entries an the partition 4 marked bootable (bit 2). |
| 430 | |
| 431 | For basic boot mode or without FIP support in TF-A_:: |
| 432 | |
| 433 | # sgdisk --resize-table=128 -a 1 \ |
| 434 | -n 1:34:545 -c 1:fsbl1 \ |
| 435 | -n 2:546:1057 -c 2:fsbl2 \ |
| 436 | -n 3:1058:5153 -c 3:ssbl \ |
| 437 | -n 4:5154: -c 4:rootfs -A 4:set:2 \ |
| 438 | -p /dev/<SD card dev> |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 439 | |
| 440 | c) copy the FSBL (2 times) and SSBL file on the correct partition. |
| 441 | in this example in partition 1 to 3 |
| 442 | |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 443 | for trusted boot: :: |
| 444 | |
| 445 | # dd if=tf-a.stm32 of=/dev/mmcblk0p1 |
| 446 | # dd if=tf-a.stm32 of=/dev/mmcblk0p2 |
| 447 | # dd if=fip.bin of=/dev/mmcblk0p3 |
| 448 | OR |
| 449 | dd if=u-boot.stm32 of=/dev/mmcblk0p3 # Without FIT support |
| 450 | |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 451 | for basic boot mode : <SD card dev> = /dev/mmcblk0:: |
| 452 | |
| 453 | # dd if=u-boot-spl.stm32 of=/dev/mmcblk0p1 |
| 454 | # dd if=u-boot-spl.stm32 of=/dev/mmcblk0p2 |
Marek Vasut | db4374f | 2021-03-06 21:44:17 +0100 | [diff] [blame] | 455 | # dd if=u-boot.img of=/dev/mmcblk0p3 # Without CONFIG_SPL_LOAD_FIT |
| 456 | OR |
| 457 | dd if=u-boot.itb of=/dev/mmcblk0p3 # With CONFIG_SPL_LOAD_FIT=y |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 458 | |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 459 | To boot from SD card, select BootPinMode = 1 0 1 and reset. |
| 460 | |
| 461 | Prepare eMMC |
| 462 | ------------ |
| 463 | |
| 464 | You can use U-Boot to copy binary in eMMC. |
| 465 | |
| 466 | In the next example, you need to boot from SD card and the images |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 467 | (tf-a.stm32, fip.bin / u-boot-spl.stm32, u-boot.img for systems without |
| 468 | CONFIG_SPL_LOAD_FIT or u-boot.itb for systems with CONFIG_SPL_LOAD_FIT=y) are |
| 469 | presents on SD card (mmc 0) in ext4 partition 4 (bootfs) |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 470 | |
| 471 | To boot from SD card, select BootPinMode = 1 0 1 and reset. |
| 472 | |
| 473 | Then you update the eMMC with the next U-Boot command : |
| 474 | |
| 475 | a) prepare GPT on eMMC, |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 476 | example with 3 partitions, fip, bootfs and roots:: |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 477 | |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 478 | # setenv emmc_part "name=fip,size=4MiB;name=bootfs,type=linux,bootable,size=64MiB;name=rootfs,type=linux,size=512" |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 479 | # gpt write mmc 1 ${emmc_part} |
| 480 | |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 481 | b) copy FSBL, TF-A_ or SPL, on first eMMC boot partition |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 482 | (SPL max size is 256kB, with LBA 512, 0x200):: |
| 483 | |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 484 | # ext4load mmc 0:4 0xC0000000 tf-a.stm32 |
| 485 | or |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 486 | # ext4load mmc 0:4 0xC0000000 u-boot-spl.stm32 |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 487 | |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 488 | # mmc dev 1 |
| 489 | # mmc partconf 1 1 1 1 |
| 490 | # mmc write ${fileaddr} 0 200 |
| 491 | # mmc partconf 1 1 1 0 |
| 492 | |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 493 | c) copy SSBL, FIP or U-Boot binary, in first GPT partition of eMMC:: |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 494 | |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 495 | # ext4load mmc 0:4 0xC0000000 fip.bin |
| 496 | or |
Marek Vasut | db4374f | 2021-03-06 21:44:17 +0100 | [diff] [blame] | 497 | # ext4load mmc 0:4 0xC0000000 u-boot.img # Without CONFIG_SPL_LOAD_FIT |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 498 | or |
| 499 | # ext4load mmc 0:4 0xC0000000 u-boot.itb # With CONFIG_SPL_LOAD_FIT=y |
| 500 | |
| 501 | |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 502 | # mmc dev 1 |
| 503 | # part start mmc 1 1 partstart |
| 504 | # mmc write ${fileaddr} ${partstart} ${filesize} |
| 505 | |
| 506 | To boot from eMMC, select BootPinMode = 0 1 0 and reset. |
| 507 | |
| 508 | MAC Address |
| 509 | ----------- |
| 510 | |
| 511 | Please read doc/README.enetaddr for the implementation guidelines for mac id |
| 512 | usage. Basically, environment has precedence over board specific storage. |
| 513 | |
| 514 | For STMicroelectonics board, it is retrieved in STM32MP15x OTP : |
| 515 | |
| 516 | - OTP_57[31:0] = MAC_ADDR[31:0] |
| 517 | - OTP_58[15:0] = MAC_ADDR[47:32] |
| 518 | |
| 519 | To program a MAC address on virgin OTP words above, you can use the fuse command |
Patrick Delaunay | b10cddf | 2020-02-12 19:37:38 +0100 | [diff] [blame] | 520 | on bank 0 to access to internal OTP and lock them: |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 521 | |
| 522 | Prerequisite: check if a MAC address isn't yet programmed in OTP |
| 523 | |
Patrick Delaunay | b10cddf | 2020-02-12 19:37:38 +0100 | [diff] [blame] | 524 | 1) check OTP: their value must be equal to 0:: |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 525 | |
Patrick Delaunay | b10cddf | 2020-02-12 19:37:38 +0100 | [diff] [blame] | 526 | STM32MP> fuse sense 0 57 2 |
| 527 | Sensing bank 0: |
| 528 | Word 0x00000039: 00000000 00000000 |
| 529 | |
| 530 | 2) check environment variable:: |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 531 | |
Patrick Delaunay | b10cddf | 2020-02-12 19:37:38 +0100 | [diff] [blame] | 532 | STM32MP> env print ethaddr |
| 533 | ## Error: "ethaddr" not defined |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 534 | |
Patrick Delaunay | b10cddf | 2020-02-12 19:37:38 +0100 | [diff] [blame] | 535 | 3) check lock status of fuse 57 & 58 (at 0x39, 0=unlocked, 1=locked):: |
| 536 | |
| 537 | STM32MP> fuse sense 0 0x10000039 2 |
| 538 | Sensing bank 0: |
| 539 | Word 0x10000039: 00000000 00000000 |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 540 | |
| 541 | Example to set mac address "12:34:56:78:9a:bc" |
| 542 | |
| 543 | 1) Write OTP:: |
| 544 | |
| 545 | STM32MP> fuse prog -y 0 57 0x78563412 0x0000bc9a |
| 546 | |
| 547 | 2) Read OTP:: |
| 548 | |
| 549 | STM32MP> fuse sense 0 57 2 |
| 550 | Sensing bank 0: |
| 551 | Word 0x00000039: 78563412 0000bc9a |
| 552 | |
Patrick Delaunay | b10cddf | 2020-02-12 19:37:38 +0100 | [diff] [blame] | 553 | 3) Lock OTP:: |
| 554 | |
| 555 | STM32MP> fuse prog 0 0x10000039 1 1 |
| 556 | |
| 557 | STM32MP> fuse sense 0 0x10000039 2 |
| 558 | Sensing bank 0: |
| 559 | Word 0x10000039: 00000001 00000001 |
| 560 | |
| 561 | 4) next REBOOT, in the trace:: |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 562 | |
| 563 | ### Setting environment from OTP MAC address = "12:34:56:78:9a:bc" |
| 564 | |
Patrick Delaunay | b10cddf | 2020-02-12 19:37:38 +0100 | [diff] [blame] | 565 | 5) check env update:: |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 566 | |
| 567 | STM32MP> env print ethaddr |
| 568 | ethaddr=12:34:56:78:9a:bc |
| 569 | |
| 570 | .. warning:: This command can't be executed twice on the same board as |
| 571 | OTP are protected. It is already done for the board |
| 572 | provided by STMicroelectronics. |
| 573 | |
| 574 | Coprocessor firmware |
| 575 | -------------------- |
| 576 | |
| 577 | U-Boot can boot the coprocessor before the kernel (coprocessor early boot). |
| 578 | |
| 579 | a) Manuallly by using rproc commands (update the bootcmd) |
| 580 | |
| 581 | Configurations:: |
| 582 | |
| 583 | # env set name_copro "rproc-m4-fw.elf" |
| 584 | # env set dev_copro 0 |
| 585 | # env set loadaddr_copro 0xC1000000 |
| 586 | |
| 587 | Load binary from bootfs partition (number 4) on SD card (mmc 0):: |
| 588 | |
| 589 | # ext4load mmc 0:4 ${loadaddr_copro} ${name_copro} |
| 590 | |
| 591 | => ${filesize} variable is updated with the size of the loaded file. |
| 592 | |
| 593 | Start M4 firmware with remote proc command:: |
| 594 | |
| 595 | # rproc init |
| 596 | # rproc load ${dev_copro} ${loadaddr_copro} ${filesize} |
| 597 | # rproc start ${dev_copro}"00270033 |
| 598 | |
| 599 | b) Automatically by using FIT feature and generic DISTRO bootcmd |
| 600 | |
| 601 | see examples in the board stm32mp1 directory: fit_copro_kernel_dtb.its |
| 602 | |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 603 | Generate FIT including kernel + device tree + M4 firmware with cfg with M4 |
| 604 | boot:: |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 605 | |
| 606 | $> mkimage -f fit_copro_kernel_dtb.its fit_copro_kernel_dtb.itb |
| 607 | |
| 608 | Then using DISTRO configuration file: see extlinux.conf to select the correct |
| 609 | configuration: |
| 610 | |
| 611 | - stm32mp157c-ev1-m4 |
| 612 | - stm32mp157c-dk2-m4 |
| 613 | |
| 614 | DFU support |
| 615 | ----------- |
| 616 | |
| 617 | The DFU is supported on ST board. |
| 618 | |
| 619 | The env variable dfu_alt_info is automatically build, and all |
| 620 | the memory present on the ST boards are exported. |
| 621 | |
| 622 | The dfu mode is started by the command:: |
| 623 | |
| 624 | STM32MP> dfu 0 |
| 625 | |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 626 | On EV1 board, booting from SD card, without OP-TEE_:: |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 627 | |
| 628 | STM32MP> dfu 0 list |
| 629 | DFU alt settings list: |
| 630 | dev: RAM alt: 0 name: uImage layout: RAM_ADDR |
| 631 | dev: RAM alt: 1 name: devicetree.dtb layout: RAM_ADDR |
| 632 | dev: RAM alt: 2 name: uramdisk.image.gz layout: RAM_ADDR |
Patrick Delaunay | ccf64ef | 2020-03-18 09:22:54 +0100 | [diff] [blame] | 633 | dev: eMMC alt: 3 name: mmc0_fsbl1 layout: RAW_ADDR |
| 634 | dev: eMMC alt: 4 name: mmc0_fsbl2 layout: RAW_ADDR |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 635 | dev: eMMC alt: 5 name: mmc0_fip layout: RAW_ADDR |
Patrick Delaunay | ccf64ef | 2020-03-18 09:22:54 +0100 | [diff] [blame] | 636 | dev: eMMC alt: 6 name: mmc0_bootfs layout: RAW_ADDR |
| 637 | dev: eMMC alt: 7 name: mmc0_vendorfs layout: RAW_ADDR |
| 638 | dev: eMMC alt: 8 name: mmc0_rootfs layout: RAW_ADDR |
| 639 | dev: eMMC alt: 9 name: mmc0_userfs layout: RAW_ADDR |
| 640 | dev: eMMC alt: 10 name: mmc1_boot1 layout: RAW_ADDR |
| 641 | dev: eMMC alt: 11 name: mmc1_boot2 layout: RAW_ADDR |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 642 | dev: eMMC alt: 12 name: mmc1_fip layout: RAW_ADDR |
Patrick Delaunay | ccf64ef | 2020-03-18 09:22:54 +0100 | [diff] [blame] | 643 | dev: eMMC alt: 13 name: mmc1_bootfs layout: RAW_ADDR |
| 644 | dev: eMMC alt: 14 name: mmc1_vendorfs layout: RAW_ADDR |
| 645 | dev: eMMC alt: 15 name: mmc1_rootfs layout: RAW_ADDR |
| 646 | dev: eMMC alt: 16 name: mmc1_userfs layout: RAW_ADDR |
| 647 | dev: MTD alt: 17 name: nor0 layout: RAW_ADDR |
Patrick Delaunay | b82c97e | 2021-11-25 11:54:53 +0100 | [diff] [blame] | 648 | dev: MTD alt: 18 name: nor1 layout: RAW_ADDR |
| 649 | dev: MTD alt: 19 name: nand0 layout: RAW_ADDR |
| 650 | dev: VIRT alt: 20 name: OTP layout: RAW_ADDR |
| 651 | dev: VIRT alt: 21 name: PMIC layout: RAW_ADDR |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 652 | |
| 653 | All the supported device are exported for dfu-util tool:: |
| 654 | |
| 655 | $> dfu-util -l |
Patrick Delaunay | b82c97e | 2021-11-25 11:54:53 +0100 | [diff] [blame] | 656 | Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=21, name="PMIC", serial="002700333338511934383330" |
| 657 | Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=20, name="OTP", serial="002700333338511934383330" |
| 658 | Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=19, name="nand0", serial="002700333338511934383330" |
| 659 | Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=18, name="nor1", serial="002700333338511934383330" |
Patrick Delaunay | ccf64ef | 2020-03-18 09:22:54 +0100 | [diff] [blame] | 660 | Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=17, name="nor0", serial="002700333338511934383330" |
| 661 | Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=16, name="mmc1_userfs", serial="002700333338511934383330" |
| 662 | Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=15, name="mmc1_rootfs", serial="002700333338511934383330" |
| 663 | Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=14, name="mmc1_vendorfs", serial="002700333338511934383330" |
| 664 | Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=13, name="mmc1_bootfs", serial="002700333338511934383330" |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 665 | Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=12, name="mmc1_fip", serial="002700333338511934383330" |
Patrick Delaunay | ccf64ef | 2020-03-18 09:22:54 +0100 | [diff] [blame] | 666 | Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=11, name="mmc1_boot2", serial="002700333338511934383330" |
| 667 | Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=10, name="mmc1_boot1", serial="002700333338511934383330" |
| 668 | Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=9, name="mmc0_userfs", serial="002700333338511934383330" |
| 669 | Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=8, name="mmc0_rootfs", serial="002700333338511934383330" |
| 670 | Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=7, name="mmc0_vendorfs", serial="002700333338511934383330" |
| 671 | Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=6, name="mmc0_bootfs", serial="002700333338511934383330" |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 672 | Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=5, name="mmc0_fip", serial="002700333338511934383330" |
Patrick Delaunay | ccf64ef | 2020-03-18 09:22:54 +0100 | [diff] [blame] | 673 | Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=4, name="mmc0_fsbl2", serial="002700333338511934383330" |
| 674 | Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=3, name="mmc0_fsbl1", serial="002700333338511934383330" |
| 675 | Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=2, name="uramdisk.image.gz", serial="002700333338511934383330" |
| 676 | Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=1, name="devicetree.dtb", serial="002700333338511934383330" |
| 677 | Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=0, name="uImage", serial="002700333338511934383330" |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 678 | |
| 679 | You can update the boot device: |
| 680 | |
| 681 | - SD card (mmc0) :: |
| 682 | |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 683 | $> dfu-util -d 0483:5720 -a 3 -D tf-a-stm32mp157c-ev1.stm32 |
| 684 | $> dfu-util -d 0483:5720 -a 4 -D tf-a-stm32mp157c-ev1.stm32 |
| 685 | $> dfu-util -d 0483:5720 -a 5 -D fip-stm32mp157c-ev1.bin |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 686 | $> dfu-util -d 0483:5720 -a 6 -D st-image-bootfs-openstlinux-weston-stm32mp1.ext4 |
| 687 | $> dfu-util -d 0483:5720 -a 7 -D st-image-vendorfs-openstlinux-weston-stm32mp1.ext4 |
| 688 | $> dfu-util -d 0483:5720 -a 8 -D st-image-weston-openstlinux-weston-stm32mp1.ext4 |
| 689 | $> dfu-util -d 0483:5720 -a 9 -D st-image-userfs-openstlinux-weston-stm32mp1.ext4 |
| 690 | |
| 691 | - EMMC (mmc1):: |
| 692 | |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 693 | $> dfu-util -d 0483:5720 -a 10 -D tf-a-stm32mp157c-ev1.stm32 |
| 694 | $> dfu-util -d 0483:5720 -a 11 -D tf-a-stm32mp157c-ev1.stm32 |
| 695 | $> dfu-util -d 0483:5720 -a 12 -D fip-stm32mp157c-ev1.bin |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 696 | $> dfu-util -d 0483:5720 -a 13 -D st-image-bootfs-openstlinux-weston-stm32mp1.ext4 |
| 697 | $> dfu-util -d 0483:5720 -a 14 -D st-image-vendorfs-openstlinux-weston-stm32mp1.ext4 |
| 698 | $> dfu-util -d 0483:5720 -a 15 -D st-image-weston-openstlinux-weston-stm32mp1.ext4 |
| 699 | $> dfu-util -d 0483:5720 -a 16 -D st-image-userfs-openstlinux-weston-stm32mp1.ext4 |
| 700 | |
Patrick Delaunay | ccf64ef | 2020-03-18 09:22:54 +0100 | [diff] [blame] | 701 | - you can also dump the OTP and the PMIC NVM with:: |
| 702 | |
| 703 | $> dfu-util -d 0483:5720 -a 19 -U otp.bin |
| 704 | $> dfu-util -d 0483:5720 -a 20 -U pmic.bin |
| 705 | |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 706 | |
Patrick Delaunay | ccf64ef | 2020-03-18 09:22:54 +0100 | [diff] [blame] | 707 | When the board is booting for nor0 or nand0, |
| 708 | only the MTD partition on the boot devices are available, for example: |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 709 | |
Patrick Delaunay | b82c97e | 2021-11-25 11:54:53 +0100 | [diff] [blame] | 710 | - NOR (nor0 = alt 20, nor1 = alt 26) & NAND (nand0 = alt 27) : |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 711 | |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 712 | $> dfu-util -d 0483:5720 -a 21 -D tf-a-stm32mp157c-ev1.stm32 |
| 713 | $> dfu-util -d 0483:5720 -a 22 -D tf-a-stm32mp157c-ev1.stm32 |
| 714 | $> dfu-util -d 0483:5720 -a 23 -D fip-stm32mp157c-ev1.bin |
Patrick Delaunay | b82c97e | 2021-11-25 11:54:53 +0100 | [diff] [blame] | 715 | $> dfu-util -d 0483:5720 -a 28 -D st-image-weston-openstlinux-weston-stm32mp1_nand_4_256_multivolume.ubi |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 716 | |
Patrick Delaunay | ccf64ef | 2020-03-18 09:22:54 +0100 | [diff] [blame] | 717 | - NAND (nand0 = alt 21):: |
Patrick Delaunay | 5f6fdcc | 2020-02-25 19:04:14 +0100 | [diff] [blame] | 718 | |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 719 | $> dfu-util -d 0483:5720 -a 22 -D tf-a-stm32mp157c-ev1.stm32 |
| 720 | $> dfu-util -d 0483:5720 -a 23 -D fip-stm32mp157c-ev1.bin |
| 721 | $> dfu-util -d 0483:5720 -a 24 -D fip-stm32mp157c-ev1.bin |
Patrick Delaunay | ccf64ef | 2020-03-18 09:22:54 +0100 | [diff] [blame] | 722 | $> dfu-util -d 0483:5720 -a 25 -D st-image-weston-openstlinux-weston-stm32mp1_nand_4_256_multivolume.ubi |
Patrick Delaunay | 3e70d3c | 2021-07-26 11:21:37 +0200 | [diff] [blame] | 723 | |
| 724 | References |
| 725 | ---------- |
| 726 | |
| 727 | .. _WIKI: |
| 728 | |
| 729 | STM32 Arm® Cortex®-based MPUs user guide |
| 730 | |
| 731 | + https://wiki.st.com/ |
| 732 | + https://wiki.st.com/stm32mpu/wiki/Main_Page |
| 733 | |
| 734 | .. _TF-A: |
| 735 | |
| 736 | TF-A = The Trusted Firmware-A project provides a reference implementation of |
| 737 | secure world software for Armv7-A and Armv8-A class processors |
| 738 | |
| 739 | + https://www.trustedfirmware.org/projects/tf-a/ |
| 740 | + https://trustedfirmware-a.readthedocs.io/en/latest/ |
| 741 | + https://trustedfirmware-a.readthedocs.io/en/latest/plat/stm32mp1.html |
| 742 | + https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/ |
| 743 | |
| 744 | .. _OP-TEE: |
| 745 | |
| 746 | OP-TEE = an open source Trusted Execution Environment (TEE) implementing the |
| 747 | Arm TrustZone technology |
| 748 | |
| 749 | + https://www.op-tee.org/ |
| 750 | + https://optee.readthedocs.io/en/latest/ |
| 751 | + https://optee.readthedocs.io/en/latest/building/devices/stm32mp1.html |
| 752 | + https://github.com/OP-TEE/optee_os |