blob: 3a54e69fc4f65574baf63b3f35f344ae893d250a [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.
10
11Build 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
17have performed tests using Ubuntu 16.04 LTS (64-bit) but other distributions
18should 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
Daniel Boulby901c53c2022-04-04 16:38:55 +010029- GCC >= 11.2-2022.02 (from the `Arm Developer website`_)
Harrison Mutai38a293a2022-02-23 11:37:12 +000030- Clang >= 14.0.0
31- Arm Compiler >= 6.18
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +010032
33In addition, a native compiler is required to build the supporting tools.
34
35.. note::
36 The software has also been built on Windows 7 Enterprise SP1, using CMD.EXE,
37 Cygwin, and Msys (MinGW) shells, using version 5.3.1 of the GNU toolchain.
38
39.. note::
40 For instructions on how to select the cross compiler refer to
41 :ref:`Performing an Initial Build`.
42
43.. _prerequisites_software_and_libraries:
44
45Software and Libraries
46----------------------
47
48The following tools are required to obtain and build |TF-A|:
49
50- An appropriate toolchain (see :ref:`prerequisites_toolchain`)
51- GNU Make
52- Git
53
54The following libraries must be available to build one or more components or
55supporting tools:
56
57- OpenSSL >= 1.0.1
58
59 Required to build the cert_create tool.
60
Sandrine Bailleux878a9982022-04-22 15:47:31 +020061The following libraries are required for Trusted Board Boot and Measured Boot
62support:
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +010063
Sandrine Bailleux878a9982022-04-22 15:47:31 +020064- mbed TLS == 2.28.0 (tag: ``mbedtls-2.28.0``)
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +010065
66These tools are optional:
67
68- Device Tree Compiler (DTC) >= 1.4.6
69
70 Needed if you want to rebuild the provided Flattened Device Tree (FDT)
71 source files (``.dts`` files). DTC is available for Linux through the package
72 repositories of most distributions.
73
74- Arm `Development Studio 5 (DS-5)`_
75
76 The standard software package used for debugging software on Arm development
77 platforms and |FVP| models.
78
Chris Kay32b292d2021-11-02 10:19:37 +000079- Node.js >= 16
Chris Kay46e17f92020-12-09 12:56:27 +000080
81 Highly recommended, and necessary in order to install and use the packaged
82 Git hooks and helper tools. Without these tools you will need to rely on the
83 CI for feedback on commit message conformance.
84
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +010085Package Installation (Linux)
86^^^^^^^^^^^^^^^^^^^^^^^^^^^^
87
88If you are using the recommended Ubuntu distribution then you can install the
89required packages with the following command:
90
91.. code:: shell
92
93 sudo apt install build-essential git libssl-dev
94
95The optional packages can be installed using:
96
97.. code:: shell
98
99 sudo apt install device-tree-compiler
100
Chris Kay46e17f92020-12-09 12:56:27 +0000101Additionally, to install an up-to-date version of Node.js, you can use the `Node
Chris Kay32b292d2021-11-02 10:19:37 +0000102Version Manager`_ to install a version of your choosing (we recommend 16, but
Chris Kay46e17f92020-12-09 12:56:27 +0000103later LTS versions might offer a more stable experience):
104
105.. code:: shell
106
Chris Kay32b292d2021-11-02 10:19:37 +0000107 curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | "$SHELL"
108 exec "$SHELL" -ic "nvm install 16; exec $SHELL"
Chris Kay46e17f92020-12-09 12:56:27 +0000109
110.. _Node Version Manager: https://github.com/nvm-sh/nvm#install--update-script
111
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +0100112Supporting Files
113----------------
114
115TF-A has been tested with pre-built binaries and file systems from `Linaro
Zelalemc005fdf2021-06-01 17:05:16 -0500116Release 20.01`_. Alternatively, you can build the binaries from source using
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +0100117instructions in :ref:`Performing an Initial Build`.
118
119.. _prerequisites_get_source:
120
121Getting the TF-A Source
122-----------------------
123
124Source code for |TF-A| is maintained in a Git repository hosted on
125TrustedFirmware.org. To clone this repository from the server, run the following
126in your shell:
127
128.. code:: shell
129
Chris Kay46e17f92020-12-09 12:56:27 +0000130 git clone "https://review.trustedfirmware.org/TF-A/trusted-firmware-a"
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +0100131
Chris Kay46e17f92020-12-09 12:56:27 +0000132Additional Steps for Contributors
133^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +0100134
Chris Kay46e17f92020-12-09 12:56:27 +0000135If you are planning on contributing back to TF-A, there are some things you'll
136want to know.
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +0100137
Chris Kay46e17f92020-12-09 12:56:27 +0000138TF-A is hosted by a `Gerrit Code Review`_ server. Gerrit requires that all
139commits include a ``Change-Id`` footer, and this footer is typically
140automatically generated by a Git hook installed by you, the developer.
141
142If you have Node.js installed already, you can automatically install this hook,
143along with any additional hooks and Javascript-based tooling that we use, by
144running from within your newly-cloned repository:
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +0100145
146.. code:: shell
147
Chris Kay2ff006b2021-05-17 11:18:56 +0100148 npm install --no-save
Chris Kay46e17f92020-12-09 12:56:27 +0000149
150If you have opted **not** to install Node.js, you can install the Gerrit hook
151manually by running:
152
153.. code:: shell
154
155 curl -Lo $(git rev-parse --git-dir)/hooks/commit-msg https://review.trustedfirmware.org/tools/hooks/commit-msg
156 chmod +x $(git rev-parse --git-dir)/hooks/commit-msg
157
158You can read more about Git hooks in the *githooks* page of the Git
159documentation, available `here <https://git-scm.com/docs/githooks>`_.
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +0100160
161--------------
162
Harrison Mutai38a293a2022-02-23 11:37:12 +0000163*Copyright (c) 2021-2022, Arm Limited. All rights reserved.*
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +0100164
Sandrine Bailleuxe356a182022-04-15 11:17:40 +0200165.. _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 +0000166.. _Gerrit Code Review: https://www.gerritcodereview.com/
Paul Beesleyd2fcc4e2019-05-29 13:59:40 +0100167.. _Linaro Release Notes: https://community.arm.com/dev-platforms/w/docs/226/old-release-notes
168.. _Linaro instructions: https://community.arm.com/dev-platforms/w/docs/304/arm-reference-platforms-deliverables
169.. _Development Studio 5 (DS-5): https://developer.arm.com/products/software-development-tools/ds-5-development-studio
Zelalemc005fdf2021-06-01 17:05:16 -0500170.. _Linaro Release 20.01: http://releases.linaro.org/members/arm/platforms/20.01