Anton Komlev | e69cf68 | 2023-01-31 11:59:25 +0000 | [diff] [blame] | 1 | .. _source_structure: |
| 2 | |
| 3 | ################ |
| 4 | Source Structure |
| 5 | ################ |
| 6 | |
| 7 | TF-M is designed to provide a user-friendly source structure to ease |
| 8 | integration and service development. This document introduces the source |
| 9 | structure and its design intention of TF-M. Additionally, the folders below are |
Antonio de Angelis | 9d496a5 | 2025-01-07 21:18:00 +0000 | [diff] [blame] | 10 | important for TF-M integration and described in a separate documents: |
Anton Komlev | e69cf68 | 2023-01-31 11:59:25 +0000 | [diff] [blame] | 11 | |
| 12 | .. toctree:: |
| 13 | :maxdepth: 1 |
| 14 | |
| 15 | Details for the /platform folder <platform_folder.rst> |
| 16 | Details for the /platform/ext folder <platform_ext_folder.rst> |
| 17 | |
| 18 | / (TF-M root) |
| 19 | ============= |
| 20 | This table describes the structure under the root folder with part of |
| 21 | possible folders. |
| 22 | |
| 23 | ========================= ==================================== |
| 24 | Folder name Description |
| 25 | ========================= ==================================== |
| 26 | bl1 The 1st stage immutable bootloader |
| 27 | bl2 MCUBoot based 2nd stage bootloader |
| 28 | cmake Cmake files of the build system |
| 29 | config Configuration system files |
| 30 | docs The documentation |
| 31 | interface RoT service API for client calls |
| 32 | lib The 3rd party libraries |
| 33 | `platform`_ Platform intermedia files |
| 34 | `secure_fw`_ The secure firmware |
| 35 | tools Tools in scripts for building |
| 36 | ========================= ==================================== |
| 37 | |
| 38 | platform |
| 39 | ======== |
| 40 | The `platform` folder contains SW ports of all :ref:`supported platforms |
| 41 | <supported_platforms>` and the files necessary for :ref:`adding a new platform |
| 42 | <adding_platform>`. Please refer to :ref:`platform folder document |
| 43 | <platform_folder>` for more information. |
| 44 | |
| 45 | ========================= ============================================= |
| 46 | Folder name Description |
| 47 | ========================= ============================================= |
| 48 | include HAL and platform public headers |
| 49 | ext Platform ports and related files |
| 50 | ========================= ============================================= |
| 51 | |
| 52 | platform/ext |
| 53 | ------------ |
| 54 | This folder can include imported files licensed differently from TF-M's |
| 55 | BSD-3 license. More details are in the dedicated document :ref:`platform_ext_folder`. |
| 56 | |
| 57 | ========================= ============================================= |
| 58 | Folder name Description |
| 59 | ========================= ============================================= |
| 60 | accelerator Supported Crypto HW accelerators |
| 61 | cmsis A copy of essential CMSIS headers |
| 62 | common Common HAL implementation |
| 63 | driver Driver headers for porting |
| 64 | target/<vendor> Vendor specific folders with ported platforms |
| 65 | ========================= ============================================= |
| 66 | |
| 67 | Each `vendor` is assigned one folder for usage under `target/`. |
| 68 | A `vendor` contributes platform's ports and manages the structure inside it. |
| 69 | |
| 70 | secure_fw |
| 71 | ========= |
| 72 | This folder contains components needed by secure firmware and the exported |
| 73 | interfaces for application, service development and HAL integration. |
| 74 | |
| 75 | ========================= ============================================= |
| 76 | Folder name Description |
| 77 | ========================= ============================================= |
| 78 | include Public headers of `secure_fw` |
| 79 | partitions Default services and SPRTL |
| 80 | spm PSA FF-M SPM implementation |
| 81 | shared Sources shared out of SPRTL |
| 82 | ========================= ============================================= |
| 83 | |
| 84 | The shared sources can be referenced by the building system out of SPRTL. |
| 85 | Generally, they are runtime and PSA APIs. |
| 86 | |
| 87 | secure_fw/include |
| 88 | ----------------- |
| 89 | This folder holds public headers for external references by clients, |
| 90 | services and platforms. Avoid putting private headers, not referenced by |
| 91 | other modules in this `include` folder. |
| 92 | |
| 93 | secure_fw/partitions |
| 94 | -------------------- |
| 95 | This folder contains default services implemented as partitions and runtime |
| 96 | utilities used and provided by TF-M. |
| 97 | |
| 98 | ============================== ============================================= |
| 99 | Folder name Description |
| 100 | ============================== ============================================= |
| 101 | lib/runtime The SPRTL sources and intermedia files |
| 102 | <partition_x> Sources of `partition_x` |
| 103 | <partition_x>/include RoT Service API headers of `partition_x` |
| 104 | <partition_y> Sources of `partition_y` |
| 105 | <partition_y>/include RoT Service API headers of `partition_y` |
| 106 | ============================== ============================================= |
| 107 | |
| 108 | Here `partition_x` and `partition_y` are examples of RoT services without |
| 109 | detailed structure of them. |
| 110 | |
| 111 | secure_fw/spm |
| 112 | ------------- |
| 113 | The SPM is the core component to provide a mechanism for providing secure |
| 114 | services complied with PSA FF-M. |
| 115 | |
| 116 | ============================== ============================================= |
| 117 | Folder name Description |
| 118 | ============================== ============================================= |
| 119 | include SPM public headers. |
Ken Liu | 4427421 | 2023-03-17 15:22:04 +0800 | [diff] [blame] | 120 | core SPM base functionalities |
| 121 | \*ext Extended SPM functionalities |
Anton Komlev | e69cf68 | 2023-01-31 11:59:25 +0000 | [diff] [blame] | 122 | ============================== ============================================= |
| 123 | |
| 124 | -------------- |
| 125 | |
| 126 | *Copyright (c) 2020-2023, Arm Limited. All rights reserved.* |