blob: 661208c338570a05e2a26be278e42b12b99f36e0 [file] [log] [blame]
Ilias Apalodimas4aa6a9f2021-03-29 17:36:51 +03001.. _stmm:
2
3############
4StandAloneMM
5############
6
7StandAlomeMM is a PE/COFF binary produced by EDK2. For Arm platforms we
8can compile and use it, in combination with OP-TEE to store EFI variables
9in and RPMB partition of our eMMC.
10
11EDK2 Build instructions
12***********************
13
14.. code-block:: bash
15
16 $ git clone https://github.com/tianocore/edk2.git
17 $ git clone https://github.com/tianocore/edk2-platforms.git
18 $ cd edk2
19 $ git submodule init && git submodule update --init --recursive
20 $ cd ..
21 $ export WORKSPACE=$(pwd)
22 $ export PACKAGES_PATH=$WORKSPACE/edk2:$WORKSPACE/edk2-platforms
23 $ export ACTIVE_PLATFORM="Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.dsc"
24 $ export GCC5_AARCH64_PREFIX=aarch64-linux-gnu-
25 $ source edk2/edksetup.sh
26 $ make -C edk2/BaseTools
27 $ build -p $ACTIVE_PLATFORM -b RELEASE -a AARCH64 -t GCC5 -n `nproc`
28
29OP-TEE Build instructions
30*************************
31
32.. code-block:: bash
33
34 $ git clone https://github.com/OP-TEE/optee_os.git
35 $ cd optee_os
36 $ ln -s ../Build/MmStandaloneRpmb/RELEASE_GCC5/FV/BL32_AP_MM.fd
37 $ export ARCH=arm
38 $ CROSS_COMPILE32=arm-linux-gnueabihf- make -j32 CFG_ARM64_core=y \
39 PLATFORM=<myboard> CFG_STMM_PATH=BL32_AP_MM.fd CFG_RPMB_FS=y \
40 CFG_RPMB_FS_DEV_ID=0 CFG_CORE_HEAP_SIZE=524288 CFG_RPMB_WRITE_KEY=1 \
41 CFG_CORE_HEAP_SIZE=524288 CFG_CORE_DYN_SHM=y CFG_RPMB_TESTKEY=y \
42 CFG_REE_FS=n CFG_CORE_ARM64_PA_BITS=48 CFG_TEE_CORE_LOG_LEVEL=1 \
43 CFG_TEE_TA_LOG_LEVEL=1 CFG_SCTLR_ALIGNMENT_CHECK=n
44
45U-Boot Build instructions
46*************************
47
48Although the StandAloneMM binary comes from EDK2, using and storing the
49variables is currently available in U-Boot only.
50
51.. code-block:: bash
52
53 $ git clone https://github.com/u-boot/u-boot.git
54 $ cd u-boot
55 $ export CROSS_COMPILE=aarch64-linux-gnu-
56 $ export ARCH=<arch>
57 $ make <myboard>_defconfig
58 $ make menuconfig
59
60Enable ``CONFIG_OPTEE``, ``CONFIG_CMD_OPTEE_RPMB`` and ``CONFIG_EFI_MM_COMM_TEE``
61
62.. code-block:: bash
63
64 $ make -j `nproc`
65
66
67.. warning::
68
69 - Your OP-TEE platform port must support Dynamic shared memory, since that's
70 the only kind of memory U-Boot supports for now.