blob: 0b8a71cbc4c43b9eadc7c006aea79a8efc671208 [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.
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +010010Build Host
11----------
12
13|TF-A| can be built using either a Linux or a Windows machine as the build host.
14
15A relatively recent Linux distribution is recommended for building |TF-A|. We
16have performed tests using Ubuntu 16.04 LTS (64-bit) but other distributions
17should also work fine as a base, provided that the necessary tools and libraries
18can be installed.
19
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
Daniel Boulby901c53c2022-04-04 16:38:55 +010028- GCC >= 11.2-2022.02 (from the `Arm Developer website`_)
Harrison Mutai38a293a2022-02-23 11:37:12 +000029- Clang >= 14.0.0
30- Arm Compiler >= 6.18
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +010031
32In addition, a native compiler is required to build the supporting tools.
33
34.. note::
35 The software has also been built on Windows 7 Enterprise SP1, using CMD.EXE,
36 Cygwin, and Msys (MinGW) shells, using version 5.3.1 of the GNU toolchain.
37
38.. note::
39 For instructions on how to select the cross compiler refer to
40 :ref:`Performing an Initial Build`.
41
42.. _prerequisites_software_and_libraries:
43
44Software and Libraries
45----------------------
46
47The following tools are required to obtain and build |TF-A|:
48
49- An appropriate toolchain (see :ref:`prerequisites_toolchain`)
50- GNU Make
51- Git
52
53The following libraries must be available to build one or more components or
54supporting tools:
55
Juan Pablo Conde7275a5a2022-03-02 18:10:08 -050056- OpenSSL >= 3.0
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +010057
58 Required to build the cert_create tool.
59
Sandrine Bailleux878a9982022-04-22 15:47:31 +020060The following libraries are required for Trusted Board Boot and Measured Boot
61support:
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +010062
Sandrine Bailleux878a9982022-04-22 15:47:31 +020063- mbed TLS == 2.28.0 (tag: ``mbedtls-2.28.0``)
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +010064
65These tools are optional:
66
67- Device Tree Compiler (DTC) >= 1.4.6
68
69 Needed if you want to rebuild the provided Flattened Device Tree (FDT)
70 source files (``.dts`` files). DTC is available for Linux through the package
71 repositories of most distributions.
72
Daniel Boulbydf83a832022-05-03 16:46:16 +010073- Arm `Development Studio (Arm-DS)`_
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +010074
75 The standard software package used for debugging software on Arm development
76 platforms and |FVP| models.
77
Chris Kay32b292d2021-11-02 10:19:37 +000078- Node.js >= 16
Chris Kay46e17f92020-12-09 12:56:27 +000079
80 Highly recommended, and necessary in order to install and use the packaged
81 Git hooks and helper tools. Without these tools you will need to rely on the
82 CI for feedback on commit message conformance.
83
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +010084Package Installation (Linux)
85^^^^^^^^^^^^^^^^^^^^^^^^^^^^
86
87If you are using the recommended Ubuntu distribution then you can install the
88required packages with the following command:
89
90.. code:: shell
91
92 sudo apt install build-essential git libssl-dev
93
94The optional packages can be installed using:
95
96.. code:: shell
97
98 sudo apt install device-tree-compiler
99
Chris Kay46e17f92020-12-09 12:56:27 +0000100Additionally, to install an up-to-date version of Node.js, you can use the `Node
Chris Kay32b292d2021-11-02 10:19:37 +0000101Version Manager`_ to install a version of your choosing (we recommend 16, but
Chris Kay46e17f92020-12-09 12:56:27 +0000102later LTS versions might offer a more stable experience):
103
104.. code:: shell
105
Chris Kay32b292d2021-11-02 10:19:37 +0000106 curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | "$SHELL"
107 exec "$SHELL" -ic "nvm install 16; exec $SHELL"
Chris Kay46e17f92020-12-09 12:56:27 +0000108
109.. _Node Version Manager: https://github.com/nvm-sh/nvm#install--update-script
110
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +0100111Supporting Files
112----------------
113
114TF-A has been tested with pre-built binaries and file systems from `Linaro
Zelalemc005fdf2021-06-01 17:05:16 -0500115Release 20.01`_. Alternatively, you can build the binaries from source using
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +0100116instructions in :ref:`Performing an Initial Build`.
117
118.. _prerequisites_get_source:
119
120Getting the TF-A Source
121-----------------------
122
123Source code for |TF-A| is maintained in a Git repository hosted on
124TrustedFirmware.org. To clone this repository from the server, run the following
125in your shell:
126
127.. code:: shell
128
Chris Kay46e17f92020-12-09 12:56:27 +0000129 git clone "https://review.trustedfirmware.org/TF-A/trusted-firmware-a"
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +0100130
Chris Kay46e17f92020-12-09 12:56:27 +0000131Additional Steps for Contributors
132^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +0100133
Chris Kay46e17f92020-12-09 12:56:27 +0000134If you are planning on contributing back to TF-A, there are some things you'll
135want to know.
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +0100136
Chris Kay46e17f92020-12-09 12:56:27 +0000137TF-A is hosted by a `Gerrit Code Review`_ server. Gerrit requires that all
138commits include a ``Change-Id`` footer, and this footer is typically
139automatically generated by a Git hook installed by you, the developer.
140
141If you have Node.js installed already, you can automatically install this hook,
142along with any additional hooks and Javascript-based tooling that we use, by
143running from within your newly-cloned repository:
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +0100144
145.. code:: shell
146
Chris Kay2ff006b2021-05-17 11:18:56 +0100147 npm install --no-save
Chris Kay46e17f92020-12-09 12:56:27 +0000148
149If you have opted **not** to install Node.js, you can install the Gerrit hook
150manually by running:
151
152.. code:: shell
153
154 curl -Lo $(git rev-parse --git-dir)/hooks/commit-msg https://review.trustedfirmware.org/tools/hooks/commit-msg
155 chmod +x $(git rev-parse --git-dir)/hooks/commit-msg
156
157You can read more about Git hooks in the *githooks* page of the Git
158documentation, available `here <https://git-scm.com/docs/githooks>`_.
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +0100159
160--------------
161
Harrison Mutai38a293a2022-02-23 11:37:12 +0000162*Copyright (c) 2021-2022, Arm Limited. All rights reserved.*
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +0100163
Sandrine Bailleuxe356a182022-04-15 11:17:40 +0200164.. _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 +0000165.. _Gerrit Code Review: https://www.gerritcodereview.com/
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +0100166.. _Linaro Release Notes: https://community.arm.com/dev-platforms/w/docs/226/old-release-notes
167.. _Linaro instructions: https://community.arm.com/dev-platforms/w/docs/304/arm-reference-platforms-deliverables
Daniel Boulbydf83a832022-05-03 16:46:16 +0100168.. _Development Studio (Arm-DS): https://developer.arm.com/Tools%20and%20Software/Arm%20Development%20Studio
Zelalemc005fdf2021-06-01 17:05:16 -0500169.. _Linaro Release 20.01: http://releases.linaro.org/members/arm/platforms/20.01