blob: 8ad53a46145e129175e0e786d88fb8d84c17bcef [file] [log] [blame]
Paul Beesley43f35ef2019-05-29 13:59:40 +01001Prerequisites
2=============
3
4This document describes the software requirements for building |TF-A| for
5AArch32 and AArch64 target platforms.
6
7It may possible to build |TF-A| with combinations of software packages that are
8different from those listed below, however only the software described in this
9document can be officially supported.
Sandrine Bailleux4a1bcd52022-07-11 10:53:42 +020010
Paul Beesley43f35ef2019-05-29 13:59:40 +010011Build Host
12----------
13
Harrison Mutaiab4d5df2024-04-09 11:17:07 +000014|TF-A| can be compiled on both Linux and Windows-based machines.
15However, we strongly recommend using a UNIX-compatible build environment.
Paul Beesley43f35ef2019-05-29 13:59:40 +010016
Harrison Mutaiab4d5df2024-04-09 11:17:07 +000017Testing is performed using Ubuntu 22.04 LTS (64-bit), but other distributions
18should also work, provided the necessary tools and libraries are installed.
Paul Beesley43f35ef2019-05-29 13:59:40 +010019
20.. _prerequisites_toolchain:
21
22Toolchain
23---------
24
25|TF-A| can be built with any of the following *cross-compiler* toolchains that
26target the Armv7-A or Armv8-A architectures:
27
Jayanth Dodderi Chidanand8cf07ab2023-09-07 11:14:30 +010028- TF-A has been tested with version 12.3.Rel1 (gcc 12.3) from the `Arm Developer website`_
Boyan Karatotevb50838b2022-10-27 14:47:18 +010029
30 You will need the targets ``arm-none-eabi`` and ``aarch64-none-elf`` for
31 AArch32 and AArch64 builds respectively.
32
Boyan Karatotev415195c2023-02-09 15:59:39 +000033- Clang == 14.0.0
34- Arm Compiler == 6.18
Paul Beesley43f35ef2019-05-29 13:59:40 +010035
36In addition, a native compiler is required to build the supporting tools.
37
38.. note::
Boyan Karatotev415195c2023-02-09 15:59:39 +000039 Versions greater than the ones specified are likely but not guaranteed to
40 work. This is predominantly because TF-A carries its own copy of compiler-rt,
41 which may be older than the version expected by the compiler. Fixes and bug
42 reports are always welcome.
43
44.. note::
Paul Beesley43f35ef2019-05-29 13:59:40 +010045 For instructions on how to select the cross compiler refer to
46 :ref:`Performing an Initial Build`.
47
48.. _prerequisites_software_and_libraries:
49
50Software and Libraries
51----------------------
52
53The following tools are required to obtain and build |TF-A|:
54
55- An appropriate toolchain (see :ref:`prerequisites_toolchain`)
56- GNU Make
57- Git
58
59The following libraries must be available to build one or more components or
60supporting tools:
61
Juan Pablo Condecf2dd172022-10-25 19:41:02 -040062- OpenSSL >= 1.1.1 (v3.0.0 to v3.0.6 highly discouraged due to security issues)
Paul Beesley43f35ef2019-05-29 13:59:40 +010063
Juan Pablo Condecf2dd172022-10-25 19:41:02 -040064 Required to build the cert_create, encrypt_fw, and fiptool tools.
Paul Beesley43f35ef2019-05-29 13:59:40 +010065
Juan Pablo Conde8caf10a2022-06-28 16:56:32 -040066 .. note::
67
Juan Pablo Condecf2dd172022-10-25 19:41:02 -040068 If using OpenSSL 3, older Linux versions may require it to be built from
69 source code, as it may not be available in the default package repositories.
70 Please refer to the OpenSSL project documentation for more information.
Juan Pablo Conde8caf10a2022-06-28 16:56:32 -040071
Sandrine Bailleux5cae3372022-04-22 15:47:31 +020072The following libraries are required for Trusted Board Boot and Measured Boot
73support:
Paul Beesley43f35ef2019-05-29 13:59:40 +010074
Sandrine Bailleuxe686cdb2023-09-11 17:02:22 +020075- mbed TLS == 3.4.1 (tag: ``mbedtls-3.4.1``)
Paul Beesley43f35ef2019-05-29 13:59:40 +010076
Tamas Banc19977b2023-06-06 13:58:21 +020077The following libraries are required for DICE Protection Environment support:
78
79- QCBOR == 1.2 (tag: ``v1.2``)
80
Paul Beesley43f35ef2019-05-29 13:59:40 +010081These tools are optional:
82
Govindraj Raja0d7e7022023-05-12 14:56:42 -050083- Device Tree Compiler (DTC) >= 1.4.7
Paul Beesley43f35ef2019-05-29 13:59:40 +010084
85 Needed if you want to rebuild the provided Flattened Device Tree (FDT)
86 source files (``.dts`` files). DTC is available for Linux through the package
87 repositories of most distributions.
88
Daniel Boulby4466cf82022-05-03 16:46:16 +010089- Arm `Development Studio (Arm-DS)`_
Paul Beesley43f35ef2019-05-29 13:59:40 +010090
91 The standard software package used for debugging software on Arm development
92 platforms and |FVP| models.
93
Chris Kay35cc4972021-11-02 10:19:37 +000094- Node.js >= 16
Chris Kayba393622020-12-09 12:56:27 +000095
96 Highly recommended, and necessary in order to install and use the packaged
97 Git hooks and helper tools. Without these tools you will need to rely on the
98 CI for feedback on commit message conformance.
99
Harrison Mutai793f72c2023-02-16 10:20:48 +0000100- Poetry >= 1.3.2
101
Harrison Mutai95f4abe2023-04-24 09:58:17 +0100102 Required for managing Python dependencies, this will allow you to reliably
103 reproduce a Python environment to build documentation and run analysis tools.
104 Most importantly, it ensures your system environment will not be affected by
105 dependencies in the Python scripts.
Harrison Mutai793f72c2023-02-16 10:20:48 +0000106
Paul Beesley43f35ef2019-05-29 13:59:40 +0100107Package Installation (Linux)
108^^^^^^^^^^^^^^^^^^^^^^^^^^^^
109
110If you are using the recommended Ubuntu distribution then you can install the
111required packages with the following command:
112
113.. code:: shell
114
Juan Pablo Conde8caf10a2022-06-28 16:56:32 -0400115 sudo apt install build-essential git
Paul Beesley43f35ef2019-05-29 13:59:40 +0100116
117The optional packages can be installed using:
118
119.. code:: shell
120
121 sudo apt install device-tree-compiler
122
Chris Kay10c969c2022-10-10 14:34:23 +0100123Additionally, to install a version of Node.js compatible with TF-A's repository
124scripts, you can use the `Node Version Manager`_. To install both NVM and an
125appropriate version of Node.js, run the following **from the root directory of
126the repository**:
Chris Kayba393622020-12-09 12:56:27 +0000127
128.. code:: shell
129
Chris Kay10c969c2022-10-10 14:34:23 +0100130 curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
131 exec "$SHELL" -ic "nvm install; exec $SHELL"
Chris Kayba393622020-12-09 12:56:27 +0000132
133.. _Node Version Manager: https://github.com/nvm-sh/nvm#install--update-script
134
Paul Beesley43f35ef2019-05-29 13:59:40 +0100135Supporting Files
136----------------
137
138TF-A has been tested with pre-built binaries and file systems from `Linaro
Zelalem99a99eb2021-06-01 17:05:16 -0500139Release 20.01`_. Alternatively, you can build the binaries from source using
Paul Beesley43f35ef2019-05-29 13:59:40 +0100140instructions in :ref:`Performing an Initial Build`.
141
142.. _prerequisites_get_source:
143
144Getting the TF-A Source
145-----------------------
146
147Source code for |TF-A| is maintained in a Git repository hosted on
148TrustedFirmware.org. To clone this repository from the server, run the following
149in your shell:
150
151.. code:: shell
152
Chris Kayba393622020-12-09 12:56:27 +0000153 git clone "https://review.trustedfirmware.org/TF-A/trusted-firmware-a"
Paul Beesley43f35ef2019-05-29 13:59:40 +0100154
Chris Kayba393622020-12-09 12:56:27 +0000155Additional Steps for Contributors
156^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Paul Beesley43f35ef2019-05-29 13:59:40 +0100157
Chris Kayba393622020-12-09 12:56:27 +0000158If you are planning on contributing back to TF-A, there are some things you'll
159want to know.
Paul Beesley43f35ef2019-05-29 13:59:40 +0100160
Chris Kayba393622020-12-09 12:56:27 +0000161TF-A is hosted by a `Gerrit Code Review`_ server. Gerrit requires that all
162commits include a ``Change-Id`` footer, and this footer is typically
163automatically generated by a Git hook installed by you, the developer.
164
165If you have Node.js installed already, you can automatically install this hook,
166along with any additional hooks and Javascript-based tooling that we use, by
167running from within your newly-cloned repository:
Paul Beesley43f35ef2019-05-29 13:59:40 +0100168
169.. code:: shell
170
Chris Kaya4371d12021-05-17 11:18:56 +0100171 npm install --no-save
Chris Kayba393622020-12-09 12:56:27 +0000172
173If you have opted **not** to install Node.js, you can install the Gerrit hook
174manually by running:
175
176.. code:: shell
177
178 curl -Lo $(git rev-parse --git-dir)/hooks/commit-msg https://review.trustedfirmware.org/tools/hooks/commit-msg
179 chmod +x $(git rev-parse --git-dir)/hooks/commit-msg
180
181You can read more about Git hooks in the *githooks* page of the Git
182documentation, available `here <https://git-scm.com/docs/githooks>`_.
Paul Beesley43f35ef2019-05-29 13:59:40 +0100183
184--------------
185
Tamas Banc19977b2023-06-06 13:58:21 +0200186*Copyright (c) 2021-2024, Arm Limited. All rights reserved.*
Paul Beesley43f35ef2019-05-29 13:59:40 +0100187
Sandrine Bailleux71a55432022-04-15 11:17:40 +0200188.. _Arm Developer website: https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/downloads
Chris Kayba393622020-12-09 12:56:27 +0000189.. _Gerrit Code Review: https://www.gerritcodereview.com/
Paul Beesley43f35ef2019-05-29 13:59:40 +0100190.. _Linaro Release Notes: https://community.arm.com/dev-platforms/w/docs/226/old-release-notes
191.. _Linaro instructions: https://community.arm.com/dev-platforms/w/docs/304/arm-reference-platforms-deliverables
Daniel Boulby4466cf82022-05-03 16:46:16 +0100192.. _Development Studio (Arm-DS): https://developer.arm.com/Tools%20and%20Software/Arm%20Development%20Studio
Zelalem99a99eb2021-06-01 17:05:16 -0500193.. _Linaro Release 20.01: http://releases.linaro.org/members/arm/platforms/20.01