blob: 8a6c58c7274f3778e67634ce091582fce55975c6 [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
14|TF-A| can be built using either a Linux or a Windows machine as the build host.
15
16A relatively recent Linux distribution is recommended for building |TF-A|. We
Boyan Karatotev068d9212022-11-15 17:39:22 +000017have performed tests using Ubuntu 20.04 LTS (64-bit) but other distributions
Paul Beesley43f35ef2019-05-29 13:59:40 +010018should also work fine as a base, provided that the necessary tools and libraries
19can be installed.
20
21.. _prerequisites_toolchain:
22
23Toolchain
24---------
25
26|TF-A| can be built with any of the following *cross-compiler* toolchains that
27target the Armv7-A or Armv8-A architectures:
28
Jayanth Dodderi Chidanand49154432022-09-12 14:50:12 +010029- GCC >= 11.3.Rel1 (from the `Arm Developer website`_)
Boyan Karatotevb50838b2022-10-27 14:47:18 +010030
31 You will need the targets ``arm-none-eabi`` and ``aarch64-none-elf`` for
32 AArch32 and AArch64 builds respectively.
33
Harrison Mutaia5d36572022-02-23 11:37:12 +000034- Clang >= 14.0.0
35- Arm Compiler >= 6.18
Paul Beesley43f35ef2019-05-29 13:59:40 +010036
37In addition, a native compiler is required to build the supporting tools.
38
39.. note::
40 The software has also been built on Windows 7 Enterprise SP1, using CMD.EXE,
41 Cygwin, and Msys (MinGW) shells, using version 5.3.1 of the GNU toolchain.
42
43.. note::
44 For instructions on how to select the cross compiler refer to
45 :ref:`Performing an Initial Build`.
46
47.. _prerequisites_software_and_libraries:
48
49Software and Libraries
50----------------------
51
52The following tools are required to obtain and build |TF-A|:
53
54- An appropriate toolchain (see :ref:`prerequisites_toolchain`)
55- GNU Make
56- Git
57
58The following libraries must be available to build one or more components or
59supporting tools:
60
Harrison Mutai6c9135f2024-04-15 17:12:23 +000061- OpenSSL >= 1.0.0 (1.0.x, v3.0.0 to v3.0.6 highly discouraged due to security issues)
Paul Beesley43f35ef2019-05-29 13:59:40 +010062
Juan Pablo Condecf2dd172022-10-25 19:41:02 -040063 Required to build the cert_create, encrypt_fw, and fiptool tools.
Paul Beesley43f35ef2019-05-29 13:59:40 +010064
Juan Pablo Conde8caf10a2022-06-28 16:56:32 -040065 .. note::
66
Juan Pablo Condecf2dd172022-10-25 19:41:02 -040067 If using OpenSSL 3, older Linux versions may require it to be built from
68 source code, as it may not be available in the default package repositories.
69 Please refer to the OpenSSL project documentation for more information.
Juan Pablo Conde8caf10a2022-06-28 16:56:32 -040070
Sandrine Bailleux5cae3372022-04-22 15:47:31 +020071The following libraries are required for Trusted Board Boot and Measured Boot
72support:
Paul Beesley43f35ef2019-05-29 13:59:40 +010073
Yann Gautiera1cb5f62024-04-19 14:53:48 +020074- mbed TLS == 2.28.8 (tag: ``mbedtls-2.28.8``)
Paul Beesley43f35ef2019-05-29 13:59:40 +010075
76These tools are optional:
77
78- Device Tree Compiler (DTC) >= 1.4.6
79
80 Needed if you want to rebuild the provided Flattened Device Tree (FDT)
81 source files (``.dts`` files). DTC is available for Linux through the package
82 repositories of most distributions.
83
Daniel Boulby4466cf82022-05-03 16:46:16 +010084- Arm `Development Studio (Arm-DS)`_
Paul Beesley43f35ef2019-05-29 13:59:40 +010085
86 The standard software package used for debugging software on Arm development
87 platforms and |FVP| models.
88
Chris Kay35cc4972021-11-02 10:19:37 +000089- Node.js >= 16
Chris Kayba393622020-12-09 12:56:27 +000090
91 Highly recommended, and necessary in order to install and use the packaged
92 Git hooks and helper tools. Without these tools you will need to rely on the
93 CI for feedback on commit message conformance.
94
Harrison Mutai3921cfe2023-10-10 17:47:48 +020095- Poetry >= 1.3.2
96
97 Required for managing Python dependencies, this will allow you to reliably
98 reproduce a Python environment to build documentation and run analysis tools.
99 Most importantly, it ensures your system environment will not be affected by
100 dependencies in the Python scripts.
101
Paul Beesley43f35ef2019-05-29 13:59:40 +0100102Package Installation (Linux)
103^^^^^^^^^^^^^^^^^^^^^^^^^^^^
104
105If you are using the recommended Ubuntu distribution then you can install the
106required packages with the following command:
107
108.. code:: shell
109
Juan Pablo Conde8caf10a2022-06-28 16:56:32 -0400110 sudo apt install build-essential git
Paul Beesley43f35ef2019-05-29 13:59:40 +0100111
112The optional packages can be installed using:
113
114.. code:: shell
115
116 sudo apt install device-tree-compiler
117
Chris Kay10c969c2022-10-10 14:34:23 +0100118Additionally, to install a version of Node.js compatible with TF-A's repository
119scripts, you can use the `Node Version Manager`_. To install both NVM and an
120appropriate version of Node.js, run the following **from the root directory of
121the repository**:
Chris Kayba393622020-12-09 12:56:27 +0000122
123.. code:: shell
124
Chris Kay10c969c2022-10-10 14:34:23 +0100125 curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
126 exec "$SHELL" -ic "nvm install; exec $SHELL"
Chris Kayba393622020-12-09 12:56:27 +0000127
128.. _Node Version Manager: https://github.com/nvm-sh/nvm#install--update-script
129
Paul Beesley43f35ef2019-05-29 13:59:40 +0100130Supporting Files
131----------------
132
133TF-A has been tested with pre-built binaries and file systems from `Linaro
Zelalem99a99eb2021-06-01 17:05:16 -0500134Release 20.01`_. Alternatively, you can build the binaries from source using
Paul Beesley43f35ef2019-05-29 13:59:40 +0100135instructions in :ref:`Performing an Initial Build`.
136
137.. _prerequisites_get_source:
138
139Getting the TF-A Source
140-----------------------
141
142Source code for |TF-A| is maintained in a Git repository hosted on
143TrustedFirmware.org. To clone this repository from the server, run the following
144in your shell:
145
146.. code:: shell
147
Chris Kayba393622020-12-09 12:56:27 +0000148 git clone "https://review.trustedfirmware.org/TF-A/trusted-firmware-a"
Paul Beesley43f35ef2019-05-29 13:59:40 +0100149
Chris Kayba393622020-12-09 12:56:27 +0000150Additional Steps for Contributors
151^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Paul Beesley43f35ef2019-05-29 13:59:40 +0100152
Chris Kayba393622020-12-09 12:56:27 +0000153If you are planning on contributing back to TF-A, there are some things you'll
154want to know.
Paul Beesley43f35ef2019-05-29 13:59:40 +0100155
Chris Kayba393622020-12-09 12:56:27 +0000156TF-A is hosted by a `Gerrit Code Review`_ server. Gerrit requires that all
157commits include a ``Change-Id`` footer, and this footer is typically
158automatically generated by a Git hook installed by you, the developer.
159
160If you have Node.js installed already, you can automatically install this hook,
161along with any additional hooks and Javascript-based tooling that we use, by
162running from within your newly-cloned repository:
Paul Beesley43f35ef2019-05-29 13:59:40 +0100163
164.. code:: shell
165
Chris Kaya4371d12021-05-17 11:18:56 +0100166 npm install --no-save
Chris Kayba393622020-12-09 12:56:27 +0000167
168If you have opted **not** to install Node.js, you can install the Gerrit hook
169manually by running:
170
171.. code:: shell
172
173 curl -Lo $(git rev-parse --git-dir)/hooks/commit-msg https://review.trustedfirmware.org/tools/hooks/commit-msg
174 chmod +x $(git rev-parse --git-dir)/hooks/commit-msg
175
176You can read more about Git hooks in the *githooks* page of the Git
177documentation, available `here <https://git-scm.com/docs/githooks>`_.
Paul Beesley43f35ef2019-05-29 13:59:40 +0100178
179--------------
180
Yann Gautiera1cb5f62024-04-19 14:53:48 +0200181*Copyright (c) 2021-2024, Arm Limited. All rights reserved.*
Paul Beesley43f35ef2019-05-29 13:59:40 +0100182
Sandrine Bailleux71a55432022-04-15 11:17:40 +0200183.. _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 +0000184.. _Gerrit Code Review: https://www.gerritcodereview.com/
Paul Beesley43f35ef2019-05-29 13:59:40 +0100185.. _Linaro Release Notes: https://community.arm.com/dev-platforms/w/docs/226/old-release-notes
186.. _Linaro instructions: https://community.arm.com/dev-platforms/w/docs/304/arm-reference-platforms-deliverables
Daniel Boulby4466cf82022-05-03 16:46:16 +0100187.. _Development Studio (Arm-DS): https://developer.arm.com/Tools%20and%20Software/Arm%20Development%20Studio
Zelalem99a99eb2021-06-01 17:05:16 -0500188.. _Linaro Release 20.01: http://releases.linaro.org/members/arm/platforms/20.01