blob: dea18253070f1900b0ca40e444cf20f2ac90ed0b [file] [log] [blame]
Paul Beesleyd2fcc4e2019-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 Bailleuxb386f0a2022-07-11 10:53:42 +020010
Harrison Mutaid7ceb9f2024-04-16 08:35:50 +000011Getting the TF-A Source
12-----------------------
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +010013
Harrison Mutaid7ceb9f2024-04-16 08:35:50 +000014Source code for |TF-A| is maintained in a Git repository hosted on
15`TrustedFirmware.org`_. To clone this repository from the server, run the following
16in your shell:
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +010017
Harrison Mutaid7ceb9f2024-04-16 08:35:50 +000018.. code:: shell
19
20 git clone "https://review.trustedfirmware.org/TF-A/trusted-firmware-a"
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +010021
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +010022
Harrison Mutaid7ceb9f2024-04-16 08:35:50 +000023Requirements
24------------
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +010025
Harrison Mutaid7ceb9f2024-04-16 08:35:50 +000026======================== =====================
27 Program Min supported version
28======================== =====================
29Arm Compiler 6.18
Jayanth Dodderi Chidanand76dc7612024-09-30 18:18:25 +010030Arm GNU Compiler 13.3
Harrison Mutaid7ceb9f2024-04-16 08:35:50 +000031Clang/LLVM 11.0.0
32Device Tree Compiler 1.4.7
33GNU make 3.81
Ryan Everett0f103b72024-09-13 14:11:21 +010034mbed TLS\ [#f1]_ 3.6.1
Harrison Mutaid7ceb9f2024-04-16 08:35:50 +000035Node.js [#f2]_ 16
36OpenSSL 1.0.0
Chris Kaye0af9072024-11-13 15:32:10 +000037Poetry 1.3.2
Harrison Mutaid7ceb9f2024-04-16 08:35:50 +000038QCBOR\ [#f3]_ 1.2
39Sphinx\ [#f2]_ 2.4.4
40======================== =====================
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +010041
Harrison Mutaid7ceb9f2024-04-16 08:35:50 +000042.. [#f1] Required for Trusted Board Boot and Measured Boot.
43.. [#f2] Required only for building TF-A documentation.
44.. [#f3] Required only when enabling DICE Protection Environment support.
Boyan Karatotevdaf0ef62022-10-27 14:47:18 +010045
Harrison Mutaid7ceb9f2024-04-16 08:35:50 +000046Toolchain
47^^^^^^^^^
Boyan Karatotevdaf0ef62022-10-27 14:47:18 +010048
Harrison Mutaid7ceb9f2024-04-16 08:35:50 +000049|TF-A| can be compiled using any cross-compiler toolchain specified in the
50preceding table that target Armv7-A or Armv8-A. For AArch32 and
51AArch64 builds, the respective targets required are ``arm-none-eabi`` and
52``aarch64-none-elf``.
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +010053
Jayanth Dodderi Chidanand76dc7612024-09-30 18:18:25 +010054Testing has been performed with version 13.3.Rel1 (gcc 13.3) of the Arm
Harrison Mutaid7ceb9f2024-04-16 08:35:50 +000055GNU compiler, which can be installed from the `Arm Developer website`_.
56
57In addition, a native compiler is required to build supporting tools.
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +010058
59.. note::
Boyan Karatoteva4d03b72023-02-09 15:59:39 +000060 Versions greater than the ones specified are likely but not guaranteed to
61 work. This is predominantly because TF-A carries its own copy of compiler-rt,
62 which may be older than the version expected by the compiler. Fixes and bug
63 reports are always welcome.
64
65.. note::
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +010066 For instructions on how to select the cross compiler refer to
67 :ref:`Performing an Initial Build`.
68
Harrison Mutaid7ceb9f2024-04-16 08:35:50 +000069OpenSSL
70^^^^^^^
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +010071
Harrison Mutaid7ceb9f2024-04-16 08:35:50 +000072OpenSSL is required to build the cert_create, encrypt_fw, and fiptool tools.
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +010073
Harrison Mutaid7ceb9f2024-04-16 08:35:50 +000074If using OpenSSL 3, older Linux versions may require it to be built from
75source code, as it may not be available in the default package repositories.
76Please refer to the OpenSSL project documentation for more information.
Juan Pablo Conde52865522022-06-28 16:56:32 -040077
Harrison Mutaid7ceb9f2024-04-16 08:35:50 +000078.. warning::
79 Versions 1.0.x and from v3.0.0 up to v3.0.6 are strongly advised against due
80 to concerns regarding security vulnerabilities!
Juan Pablo Conde52865522022-06-28 16:56:32 -040081
Harrison Mutaid7ceb9f2024-04-16 08:35:50 +000082Device Tree Compiler (DTC)
83^^^^^^^^^^^^^^^^^^^^^^^^^^
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +010084
Harrison Mutaid7ceb9f2024-04-16 08:35:50 +000085Needed if you want to rebuild the provided Flattened Device Tree (FDT)
86source files (``.dts`` files). DTC is available for Linux through the package
87repositories of most distributions.
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +010088
Harrison Mutaid7ceb9f2024-04-16 08:35:50 +000089Arm Development Studio (`Arm-DS`_)
90^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Tamas Ban9e4a4f82023-06-06 13:58:21 +020091
Harrison Mutaid7ceb9f2024-04-16 08:35:50 +000092The standard software package used for debugging software on Arm development
93platforms and |FVP| models.
Tamas Ban9e4a4f82023-06-06 13:58:21 +020094
Harrison Mutaid7ceb9f2024-04-16 08:35:50 +000095Node.js
96^^^^^^^
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +010097
Harrison Mutaid7ceb9f2024-04-16 08:35:50 +000098Highly recommended, and necessary in order to install and use the packaged
99Git hooks and helper tools. Without these tools you will need to rely on the
100CI for feedback on commit message conformance.
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +0100101
Harrison Mutaid7ceb9f2024-04-16 08:35:50 +0000102Poetry
103^^^^^^
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +0100104
Harrison Mutaid7ceb9f2024-04-16 08:35:50 +0000105Required for managing Python dependencies, this will allow you to reliably
Chris Kaye0af9072024-11-13 15:32:10 +0000106reproduce a Python environment to build documentation and run some of the
107integrated Python tools. Most importantly, it ensures your system environment
108will not be affected by dependencies in the Python scripts.
109
110For installation instructions, see the `official Poetry documentation`_.
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +0100111
Harrison Mutaid7ceb9f2024-04-16 08:35:50 +0000112.. _prerequisites_software_and_libraries:
Chris Kay46e17f92020-12-09 12:56:27 +0000113
Harrison Mutaid7ceb9f2024-04-16 08:35:50 +0000114Package Installation (Linux)
115----------------------------
Harrison Mutaib378ad42023-02-16 10:20:48 +0000116
Harrison Mutaid7ceb9f2024-04-16 08:35:50 +0000117|TF-A| can be compiled on both Linux and Windows-based machines.
118However, we strongly recommend using a UNIX-compatible build environment.
Harrison Mutaib378ad42023-02-16 10:20:48 +0000119
Harrison Mutaid7ceb9f2024-04-16 08:35:50 +0000120Testing is performed using Ubuntu 22.04 LTS (64-bit), but other distributions
121should also work, provided the necessary tools and libraries are installed.
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +0100122
Harrison Mutaid7ceb9f2024-04-16 08:35:50 +0000123The following are steps to install the required packages:
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +0100124
125.. code:: shell
126
Harrison Mutaid7ceb9f2024-04-16 08:35:50 +0000127 sudo apt install build-essential
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +0100128
129The optional packages can be installed using:
130
131.. code:: shell
132
133 sudo apt install device-tree-compiler
134
Chris Kayd855ae22022-10-10 14:34:23 +0100135Additionally, to install a version of Node.js compatible with TF-A's repository
136scripts, you can use the `Node Version Manager`_. To install both NVM and an
137appropriate version of Node.js, run the following **from the root directory of
138the repository**:
Chris Kay46e17f92020-12-09 12:56:27 +0000139
140.. code:: shell
141
Chris Kayd855ae22022-10-10 14:34:23 +0100142 curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
143 exec "$SHELL" -ic "nvm install; exec $SHELL"
Chris Kay46e17f92020-12-09 12:56:27 +0000144
145.. _Node Version Manager: https://github.com/nvm-sh/nvm#install--update-script
146
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +0100147Supporting Files
148----------------
149
150TF-A has been tested with pre-built binaries and file systems from `Linaro
Zelalemc005fdf2021-06-01 17:05:16 -0500151Release 20.01`_. Alternatively, you can build the binaries from source using
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +0100152instructions in :ref:`Performing an Initial Build`.
153
154.. _prerequisites_get_source:
155
Chris Kay46e17f92020-12-09 12:56:27 +0000156Additional Steps for Contributors
157^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +0100158
Chris Kay46e17f92020-12-09 12:56:27 +0000159If you are planning on contributing back to TF-A, there are some things you'll
160want to know.
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +0100161
Chris Kay46e17f92020-12-09 12:56:27 +0000162TF-A is hosted by a `Gerrit Code Review`_ server. Gerrit requires that all
163commits include a ``Change-Id`` footer, and this footer is typically
164automatically generated by a Git hook installed by you, the developer.
165
166If you have Node.js installed already, you can automatically install this hook,
167along with any additional hooks and Javascript-based tooling that we use, by
168running from within your newly-cloned repository:
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +0100169
170.. code:: shell
171
Chris Kay2ff006b2021-05-17 11:18:56 +0100172 npm install --no-save
Chris Kay46e17f92020-12-09 12:56:27 +0000173
174If you have opted **not** to install Node.js, you can install the Gerrit hook
175manually by running:
176
177.. code:: shell
178
179 curl -Lo $(git rev-parse --git-dir)/hooks/commit-msg https://review.trustedfirmware.org/tools/hooks/commit-msg
180 chmod +x $(git rev-parse --git-dir)/hooks/commit-msg
181
182You can read more about Git hooks in the *githooks* page of the Git
183documentation, available `here <https://git-scm.com/docs/githooks>`_.
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +0100184
185--------------
186
Tamas Ban9e4a4f82023-06-06 13:58:21 +0200187*Copyright (c) 2021-2024, Arm Limited. All rights reserved.*
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +0100188
Sandrine Bailleuxe356a182022-04-15 11:17:40 +0200189.. _Arm Developer website: https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/downloads
Chris Kay46e17f92020-12-09 12:56:27 +0000190.. _Gerrit Code Review: https://www.gerritcodereview.com/
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +0100191.. _Linaro Release Notes: https://community.arm.com/dev-platforms/w/docs/226/old-release-notes
192.. _Linaro instructions: https://community.arm.com/dev-platforms/w/docs/304/arm-reference-platforms-deliverables
Harrison Mutaid7ceb9f2024-04-16 08:35:50 +0000193.. _Arm-DS: https://developer.arm.com/Tools%20and%20Software/Arm%20Development%20Studio
Zelalemc005fdf2021-06-01 17:05:16 -0500194.. _Linaro Release 20.01: http://releases.linaro.org/members/arm/platforms/20.01
Harrison Mutaid7ceb9f2024-04-16 08:35:50 +0000195.. _TrustedFirmware.org: https://www.trustedfirmware.org/
Chris Kaye0af9072024-11-13 15:32:10 +0000196.. _official Poetry documentation: https://python-poetry.org/docs/#installation