blob: 88251d6afb3f2bc5b235bf576202392788d41448 [file] [log] [blame]
Paul Beesleyf3653a62019-05-22 11:22:44 +01001STMicroelectronics STM32MP1
2===========================
Yann Gautier75115392018-07-16 14:49:34 +02003
4STM32MP1 is a microprocessor designed by STMicroelectronics
5based on a dual Arm Cortex-A7.
6It is an Armv7-A platform, using dedicated code from TF-A.
Yann Gautier969be342019-02-20 17:34:16 +01007The STM32MP1 chip also embeds a Cortex-M4.
8More information can be found on `STM32MP1 Series`_ page.
Yann Gautier75115392018-07-16 14:49:34 +02009
10
11Design
12------
13The STM32MP1 resets in the ROM code of the Cortex-A7.
14The primary boot core (core 0) executes the boot sequence while
15secondary boot core (core 1) is kept in a holding pen loop.
16The ROM code boot sequence loads the TF-A binary image from boot device
17to embedded SRAM.
18
19The TF-A image must be properly formatted with a STM32 header structure
20for ROM code is able to load this image.
21Tool stm32image can be used to prepend this header to the generated TF-A binary.
22
23At compilation step, BL2, BL32 and DTB file are linked together in a single
24binary. The stm32image tool is also generated and the header is added to TF-A
25binary. This binary file with header is named tf-a-stm32mp157c-ev1.stm32.
26It can then be copied in the first partition of the boot device.
27
28
29Memory mapping
30~~~~~~~~~~~~~~
31
32::
33
34 0x00000000 +-----------------+
35 | | ROM
36 0x00020000 +-----------------+
37 | |
38 | ... |
39 | |
40 0x2FFC0000 +-----------------+ \
41 | | |
42 | ... | |
43 | | |
44 0x2FFD8000 +-----------------+ |
45 | TF-A DTB | | Embedded SRAM
46 0x2FFDC000 +-----------------+ |
47 | BL2 | |
48 0x2FFEF000 +-----------------+ |
49 | BL32 | |
50 0x30000000 +-----------------+ /
51 | |
52 | ... |
53 | |
54 0x40000000 +-----------------+
55 | |
56 | | Devices
57 | |
58 0xC0000000 +-----------------+ \
59 | | |
60 0xC0100000 +-----------------+ |
61 | BL33 | | Non-secure RAM (DDR)
62 | ... | |
63 | | |
64 0xFFFFFFFF +-----------------+ /
65
66
67Boot sequence
68~~~~~~~~~~~~~
69
70ROM code -> BL2 (compiled with BL2_AT_EL3) -> BL32 (SP_min) -> BL33 (U-Boot)
71
Yann Gautierb3386f72019-04-19 09:41:01 +020072or if Op-TEE is used:
73
74ROM code -> BL2 (compiled with BL2_AT_EL3) -> OP-TEE -> BL33 (U-Boot)
75
Yann Gautier75115392018-07-16 14:49:34 +020076
77Build Instructions
78------------------
79
Yann Gautierb3386f72019-04-19 09:41:01 +020080To build with SP_min:
Yann Gautier75115392018-07-16 14:49:34 +020081
82.. code:: bash
83
Manivannan Sadhasivamde9fdf92019-04-26 18:46:29 +053084 make CROSS_COMPILE=arm-linux-gnueabihf- PLAT=stm32mp1 ARCH=aarch32 ARM_ARCH_MAJOR=7 AARCH32_SP=sp_min DTB_FILE_NAME=stm32mp157c-ev1.dtb
Yann Gautierb4ddd302018-10-24 10:50:12 +020085 cd <u-boot_directory>
Yann Gautierb7168ee2019-05-20 11:50:18 +020086 make stm32mp15_trusted_defconfig
Yann Gautier969be342019-02-20 17:34:16 +010087 make DEVICE_TREE=stm32mp157c-ev1 all
Yann Gautier75115392018-07-16 14:49:34 +020088
Yann Gautierb3386f72019-04-19 09:41:01 +020089To build TF-A with with Op-TEE support:
90
91.. code:: bash
92
93 make CROSS_COMPILE=arm-linux-gnueabihf- PLAT=stm32mp1 ARCH=aarch32 ARM_ARCH_MAJOR=7 AARCH32_SP=optee
94
Yann Gautier75115392018-07-16 14:49:34 +020095The following build options are supported:
96
97- ``ENABLE_STACK_PROTECTOR``: To enable the stack protection.
Yann Gautierb4ddd302018-10-24 10:50:12 +020098
99
100Populate SD-card
101----------------
102
103The SD-card has to be formated with GPT.
104It should contain at least those partitions:
105
106- fsbl: to copy the tf-a-stm32mp157c-ev1.stm32 binary
107- ssbl: to copy the u-boot.stm32 binary
108
109Usually, two copies of fsbl are used (fsbl1 and fsbl2) instead of one partition fsbl.
Yann Gautier969be342019-02-20 17:34:16 +0100110
111
112.. _STM32MP1 Series: https://www.st.com/en/microcontrollers-microprocessors/stm32mp1-series.html