Julian Hall | e76ade8 | 2020-11-25 03:07:21 +0100 | [diff] [blame] | 1 | Deploying trusted services in S-EL0 Secure Partitions under OP-TEE |
| 2 | ================================================================== |
| 3 | |
| 4 | Trusted services built for the *opteesp* environment may be deployed to run within S-EL0 secure |
Julian Hall | c6268b0 | 2022-03-10 10:31:09 +0000 | [diff] [blame] | 5 | partitions, managed by OP-TEE. The current implementation of the OP-TEE SPMC supports booting SPs |
| 6 | embedded into the OP-TEE OS binary (similar to early-TAs) or from the FIP. |
Julian Hall | e76ade8 | 2020-11-25 03:07:21 +0100 | [diff] [blame] | 7 | |
| 8 | Tool prerequisites and general build instruction for OP-TEE are described here: |
| 9 | `<https://optee.readthedocs.io/en/latest/building/gits/build.html>`_ |
| 10 | |
| 11 | Download page for Arm Fixed Virtual Platforms (FVP): |
| 12 | `<https://developer.arm.com/tools-and-software/simulation-models/fixed-virtual-platforms>`_ |
| 13 | |
Julian Hall | c6268b0 | 2022-03-10 10:31:09 +0000 | [diff] [blame] | 14 | |
| 15 | Embedding SP images into the *OP-TEE OS* image |
| 16 | ---------------------------------------------- |
Julian Hall | e76ade8 | 2020-11-25 03:07:21 +0100 | [diff] [blame] | 17 | |
| 18 | The set of SP images to include in the built *OP-TEE OS* image are specified to the *OP-TEE OS* |
Julian Hall | c6268b0 | 2022-03-10 10:31:09 +0000 | [diff] [blame] | 19 | build by the ``SP_PATHS`` make variable. The ``SP_PATHS`` variable should be assigned a string |
| 20 | containing a space separated list of file paths for each SP image file to include. SP images |
Julian Hall | e76ade8 | 2020-11-25 03:07:21 +0100 | [diff] [blame] | 21 | that need to be deployed from the Trusted Services project will be located in the install directory, |
| 22 | specified when the SP images where built i.e.:: |
| 23 | |
Julian Hall | c6268b0 | 2022-03-10 10:31:09 +0000 | [diff] [blame] | 24 | <CMAKE_INSTALL_PREFIX>/opteesp/bin |
Julian Hall | e76ade8 | 2020-11-25 03:07:21 +0100 | [diff] [blame] | 25 | |
Julian Hall | c6268b0 | 2022-03-10 10:31:09 +0000 | [diff] [blame] | 26 | The following example illustrates a setting of the ``SP_PATHS`` variable to deploy the Secure Storage |
Julian Hall | e76ade8 | 2020-11-25 03:07:21 +0100 | [diff] [blame] | 27 | SP and Crypto SP:: |
| 28 | |
Julian Hall | c6268b0 | 2022-03-10 10:31:09 +0000 | [diff] [blame] | 29 | SP_PATHS="ts-install-dir/opteesp/bin/dc1eef48-b17a-4ccf-ac8b-dfcff7711b14.stripped.elf \ |
| 30 | ts-install-dir/opteesp/bin/d9df52d5-16a2-4bb2-9aa4-d26d3b84e8c0.stripped.elf" |
Julian Hall | e76ade8 | 2020-11-25 03:07:21 +0100 | [diff] [blame] | 31 | |
Julian Hall | e76ade8 | 2020-11-25 03:07:21 +0100 | [diff] [blame] | 32 | |
| 33 | Reference OP-TEE build with PSA RoT Services |
| 34 | -------------------------------------------- |
Julian Hall | e76ade8 | 2020-11-25 03:07:21 +0100 | [diff] [blame] | 35 | |
Julian Hall | c6268b0 | 2022-03-10 10:31:09 +0000 | [diff] [blame] | 36 | To provide an example integration of OP-TEE with a set of trusted services, a makefile called |
| 37 | *fvp-ps-sp.mk* is included in the OP-TEE build repository that builds OP-TEE OS with a set of SP |
| 38 | images. SP images are built using the standard trusted services build flow and are automatically |
| 39 | injected into the *optee_os* build using the TA feature described above. |
Julian Hall | e76ade8 | 2020-11-25 03:07:21 +0100 | [diff] [blame] | 40 | |
Julian Hall | c6268b0 | 2022-03-10 10:31:09 +0000 | [diff] [blame] | 41 | A bootable Linux image is created that is intended to run on the Arm AEM FVP virtual platform. The |
| 42 | built image includes user space programs that may be used to test and demonstrate the deployed |
| 43 | trusted services. |
Julian Hall | e76ade8 | 2020-11-25 03:07:21 +0100 | [diff] [blame] | 44 | |
Julian Hall | e76ade8 | 2020-11-25 03:07:21 +0100 | [diff] [blame] | 45 | |
Julian Hall | c6268b0 | 2022-03-10 10:31:09 +0000 | [diff] [blame] | 46 | Getting build dependencies |
| 47 | '''''''''''''''''''''''''' |
| 48 | |
| 49 | To help setup the workspace, a manifest file called *fvp-ts.xml* is included in OP-TEE manifests |
| 50 | repository. This may be used with the *repo* tool to manage the set of git repositories. |
| 51 | |
| 52 | Having created a new directory for the workspace, the required set of git repositories can be cloned |
| 53 | and fetched using:: |
| 54 | |
| 55 | repo init -u https://github.com/OP-TEE/manifest.git -b master -m fvp-ts.xml |
Julian Hall | e76ade8 | 2020-11-25 03:07:21 +0100 | [diff] [blame] | 56 | repo sync |
| 57 | |
Julian Hall | c6268b0 | 2022-03-10 10:31:09 +0000 | [diff] [blame] | 58 | |
Julian Hall | e76ade8 | 2020-11-25 03:07:21 +0100 | [diff] [blame] | 59 | Building the reference OP-TEE image |
| 60 | ''''''''''''''''''''''''''''''''''' |
Julian Hall | e76ade8 | 2020-11-25 03:07:21 +0100 | [diff] [blame] | 61 | |
Julian Hall | c6268b0 | 2022-03-10 10:31:09 +0000 | [diff] [blame] | 62 | To build the bootable image that includes OP-TEE and the set of secure partition images that hold the |
| 63 | PSA RoT services, use the following (from the root directory of the workspace):: |
| 64 | |
| 65 | make -C build |
Julian Hall | e76ade8 | 2020-11-25 03:07:21 +0100 | [diff] [blame] | 66 | |
| 67 | This will take many tens of minutes to complete. |
| 68 | |
Julian Hall | c6268b0 | 2022-03-10 10:31:09 +0000 | [diff] [blame] | 69 | |
Julian Hall | e76ade8 | 2020-11-25 03:07:21 +0100 | [diff] [blame] | 70 | Running the reference OP-TEE image on FVP |
| 71 | ''''''''''''''''''''''''''''''''''''''''' |
Julian Hall | c6268b0 | 2022-03-10 10:31:09 +0000 | [diff] [blame] | 72 | |
Julian Hall | e76ade8 | 2020-11-25 03:07:21 +0100 | [diff] [blame] | 73 | The fvp makefile includes a *run* and *run-only* target which can be used to start the FVP model and |
| 74 | boot the built image. The example assumes that the FVP model has been installed in the following |
| 75 | directory relative to the OP-TEE build directory:: |
| 76 | |
Julian Hall | c6268b0 | 2022-03-10 10:31:09 +0000 | [diff] [blame] | 77 | ../Base_RevC_AEMvA_pkg/models/Linux64_GCC-9.3 |
Julian Hall | e76ade8 | 2020-11-25 03:07:21 +0100 | [diff] [blame] | 78 | |
| 79 | To boot the built image on FVP without building, use:: |
| 80 | |
Julian Hall | c6268b0 | 2022-03-10 10:31:09 +0000 | [diff] [blame] | 81 | FVP_PATH=../Base_RevC_AEMvA_pkg/models/Linux64_GCC-9.3 make run-only |
Julian Hall | e76ade8 | 2020-11-25 03:07:21 +0100 | [diff] [blame] | 82 | |
| 83 | For information on running user space programs on FVP, see: |
| 84 | |
Julian Hall | c6268b0 | 2022-03-10 10:31:09 +0000 | [diff] [blame] | 85 | :ref:`Running User-space Programs on FVP` |
Julian Hall | e76ade8 | 2020-11-25 03:07:21 +0100 | [diff] [blame] | 86 | |
| 87 | -------------- |
| 88 | |
Julian Hall | c6268b0 | 2022-03-10 10:31:09 +0000 | [diff] [blame] | 89 | *Copyright (c) 2020-2022, Arm Limited and Contributors. All rights reserved.* |
Julian Hall | e76ade8 | 2020-11-25 03:07:21 +0100 | [diff] [blame] | 90 | |
| 91 | SPDX-License-Identifier: BSD-3-Clause |