blob: 391620c1a001308655813bffd64d7097212dfee1 [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
Kevin Peng75b0b762022-10-25 18:00:27 +080018 Component configuration <header_file_system>
19 Kconfig <kconfig_system>
Anton Komlev2cd91532022-11-17 13:36:55 +000020 Profiles <profiles/index>
21 test_configuration.rst
Anton Komlevaffe14f2022-11-01 00:07:41 +000022
Anton Komlev2cd91532022-11-17 13:36:55 +000023TF-M is highly configurable project with many configuration options to meet
24a user needs. A user can select the desired set of services and fine-tune
25them to their requirements. There are two types of configuration options
Anton Komlevaffe14f2022-11-01 00:07:41 +000026
Anton Komlev2cd91532022-11-17 13:36:55 +000027Building configuration
Kevin Peng75b0b762022-10-25 18:00:27 +080028 Specifies which file or component to include into compilation and build.
29 These are options, usually used by a build system to enable/disable
30 modules, specify location of external dependency or other selection, global to
31 a project. Please check the corresponded section :ref:`tfm_cmake_configuration`
Anton Komlevaffe14f2022-11-01 00:07:41 +000032
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.
Kevin Peng75b0b762022-10-25 18:00:27 +080036 Options are in C header file. The :ref:`Header_configuration` has more
37 details about it.
Anton Komlevaffe14f2022-11-01 00:07:41 +000038
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
Kevin Peng75b0b762022-10-25 18:00:27 +080044 :ref:`Header_configuration` and moved component options into a dedicated
Anton Komlev2cd91532022-11-17 13:36:55 +000045 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
Kevin Peng75b0b762022-10-25 18:00:27 +080055Use :ref:`tf-m_profiles`.
56 There are 4 sets of predefined configurations for a elected
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
Kevin Peng75b0b762022-10-25 18:00:27 +080067Use :ref:`Kconfig_system`.
Anton Komlev2cd91532022-11-17 13:36:55 +000068 This method is recommended for beginners. Starting from the
Kevin Peng75b0b762022-10-25 18:00:27 +080069 *base configuration* a user can enable necessary services and options.
Anton Komlev2cd91532022-11-17 13:36:55 +000070 KConfig ensurers that all selected options are consistent and valid.
Kevin Peng75b0b762022-10-25 18:00:27 +080071 This is new in v1.7.0 and it covers only SPM and PSA services. 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
Kevin Peng75b0b762022-10-25 18:00:27 +080086:ref:`tfm_cmake_configuration` or :ref:`Header_configuration` please
Anton Komlev2cd91532022-11-17 13:36:55 +000087check 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.*