blob: 29db514fa9efaac733ee08476dc5e79d09a67211 [file] [log] [blame]
Anton Komlev2cd91532022-11-17 13:36:55 +00001.. _tf-m_configuration:
2
Anton Komlevaffe14f2022-11-01 00:07:41 +00003#############
4Configuration
5#############
6
7.. Warning::
8
9 This is a temporay design document for review.
10 Once the design is settled down.
11 It will be converted to user/integration guides.
12
13.. toctree::
14 :maxdepth: 1
15 :glob:
16
Anton Komlev2cd91532022-11-17 13:36:55 +000017 build_configuration.rst
18 Profiles <profiles/index>
19 test_configuration.rst
Anton Komlevaffe14f2022-11-01 00:07:41 +000020
Anton Komlev2cd91532022-11-17 13:36:55 +000021TF-M is highly configurable project with many configuration options to meet
22a user needs. A user can select the desired set of services and fine-tune
23them to their requirements. There are two types of configuration options
Anton Komlevaffe14f2022-11-01 00:07:41 +000024
Anton Komlev2cd91532022-11-17 13:36:55 +000025Building configuration
26 Specifies which file or component to include into compilation and build.
Anton Komlevaffe14f2022-11-01 00:07:41 +000027 These are options, usually used by a build system to enable/disable
28 modules, specify location of external dependency or other selection,
29 global to a project. These options shall be considered while adopting TF-M
30 to other build systems.
31 In the Base configuration table theses options have *Build* type.
32
Anton Komlev2cd91532022-11-17 13:36:55 +000033Component tuning
34 To adjust a particular parameter to a desired value. Those options are
35 local to a component or externally referenced when components are coupled.
36 Options are in C header file. The <Header_configuration> has more details about it.
Anton Komlevaffe14f2022-11-01 00:07:41 +000037 In the Base configuration table theses options have *Component* type.
38
39.. Note::
Anton Komlev2cd91532022-11-17 13:36:55 +000040 Originally, TF-M used CMake variables for both building and component tuning
41 purposes. It was convenient to have a single system for both building and
42 component's configurations. To simplify and improve configurability and
43 better support build systems other than a CMake, TF-M introduced a
44 Header configuration and moved component options into a dedicated
45 config headers.
Anton Komlevaffe14f2022-11-01 00:07:41 +000046
47****************
48How to configure
49****************
50
Anton Komlev2cd91532022-11-17 13:36:55 +000051TF-M Project provides a base build, defined in config_base.cmake. It includes
52SPM and platform code only. Starting from the base, users can enable required
53services and features using several independent methods to configure TF-M.
Anton Komlevaffe14f2022-11-01 00:07:41 +000054
Anton Komlev2cd91532022-11-17 13:36:55 +000055Use <Profiles>.
56 There are 4 sets of predefined configurations for a selected
Anton Komlevaffe14f2022-11-01 00:07:41 +000057 use cases, called profiles. A user can select a profile by providing
58 -DTFM_PROFILE=<profile file name>.
59 Each profiles represented by a pair of configuration files for
60 Building (CMake) options and Component options (.h file)
61
Anton Komlev2cd91532022-11-17 13:36:55 +000062Use a custom profile.
63 Another method is to take existing TF-M profile and adjust the desired
64 options manually editing CMake and config header files. This is for users
65 familiar with TF-M.
Anton Komlevaffe14f2022-11-01 00:07:41 +000066
Anton Komlev2cd91532022-11-17 13:36:55 +000067Use <Kconfig_system>.
68 This method is recommended for beginners. Starting from the
69 <base configuration> a user can enable necessary services and options.
70 KConfig ensurers that all selected options are consistent and valid.
71 This is new in v1.7.0 and it covers only SPM and PSA ervices. As an output
Anton Komlevaffe14f2022-11-01 00:07:41 +000072 KConfig produces a pair of configuration files, similar to a profile.
73
74.. Note::
75 In contrast, before TF-M v1.7.0, the default build includes all possible
76 features. With growing functionality, such rich default build became
77 unpractical by not fitting into every platform and confusing of big
78 memory requirements.
79
80**********
81Priorities
82**********
Anton Komlevaffe14f2022-11-01 00:07:41 +000083
Anton Komlev2cd91532022-11-17 13:36:55 +000084A project configueration performed in multiple steps with priorities.
85The list below explains the process but for the details specific to
86:ref:`tfm_cmake_configuration` or <Header_configuration> please
87check the corresponded document.
Anton Komlevaffe14f2022-11-01 00:07:41 +000088
Anton Komlev2cd91532022-11-17 13:36:55 +000089#. The base configuration with default values is used as a starting point
90#. A profile options applied on top of the base
91#. A platform can check the selected configuration and apply restrictions
92#. Finally, command line options can modify the composed set
93
94.. Note::
95 To ensure a clear intention and conscious choice, all options must be
96 providede explicitly via a project configuration file. Default values
97 on step 1 will generate warnings which expected to break a build.
Anton Komlevaffe14f2022-11-01 00:07:41 +000098
99--------------
100
101*Copyright (c) 2022, Arm Limited. All rights reserved.*