xref: /rk3399_ARM-atf/docs/getting_started/prerequisites.rst (revision b8ce71e2300a44a02ef495eb35c7425ecf8c33cc)
1Prerequisites
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
11Getting the TF-A Source
12-----------------------
13
14Source 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:
17
18.. code:: shell
19
20    git clone "https://review.trustedfirmware.org/TF-A/trusted-firmware-a"
21
22
23Requirements
24------------
25
26======================== =====================
27        Program          Min supported version
28======================== =====================
29Arm Compiler             6.23
30Arm GNU Compiler         14.3
31Clang/LLVM               18.1.8
32Device Tree Compiler     1.6.1
33GNU Make                 4.3
34Node.js [#f2]_           20.11.1
35OpenSSL                  1.0.0
36Poetry                   1.3.2
37QCBOR\ [#f2]_            1.2
38Sphinx\ [#f1]_           5.3.0
39======================== =====================
40
41.. [#f1] Required only for building TF-A documentation.
42.. [#f2] Required only when enabling DICE Protection Environment support.
43
44Toolchain
45^^^^^^^^^
46
47|TF-A| can be compiled using any cross-compiler toolchain specified in the
48preceding table that target Armv7-A or Armv8-A. For AArch32 and
49AArch64 builds, the respective targets required are ``arm-none-eabi`` and
50``aarch64-none-elf``.
51
52Testing has been performed with the version of the Arm GNU compiler listed in
53the table above. This can be installed from the `Arm Developer website`_.
54
55In addition, a native compiler is required to build supporting tools.
56
57.. note::
58   Versions greater than the ones specified are likely but not guaranteed to
59   work. This is predominantly because TF-A carries its own copy of compiler-rt,
60   which may be older than the version expected by the compiler. Fixes and bug
61   reports are always welcome.
62
63.. note::
64   For instructions on how to select the cross compiler refer to
65   :ref:`Performing an Initial Build`.
66
67OpenSSL
68^^^^^^^
69
70OpenSSL is required to build the cert_create, encrypt_fw, and fiptool tools.
71
72If using OpenSSL 3, older Linux versions may require it to be built from
73source code, as it may not be available in the default package repositories.
74Please refer to the OpenSSL project documentation for more information.
75
76.. warning::
77    Versions 1.0.x and from v3.0.0 up to v3.0.6 are strongly advised against due
78    to concerns regarding security vulnerabilities!
79
80Device Tree Compiler (DTC)
81^^^^^^^^^^^^^^^^^^^^^^^^^^
82
83Needed if you want to rebuild the provided Flattened Device Tree (FDT)
84source files (``.dts`` files). DTC is available for Linux through the package
85repositories of most distributions.
86
87Arm Development Studio (`Arm-DS`_)
88^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
89
90The standard software package used for debugging software on Arm development
91platforms and |FVP| models.
92
93Node.js
94^^^^^^^
95
96Highly recommended, and necessary in order to install and use the packaged
97Git hooks and helper tools. Without these tools you will need to rely on the
98CI for feedback on commit message conformance.
99
100Poetry
101^^^^^^
102
103Required for managing Python dependencies, this will allow you to reliably
104reproduce a Python environment to build documentation and run some of the
105integrated Python tools. Most importantly, it ensures your system environment
106will not be affected by dependencies in the Python scripts.
107
108For installation instructions, see the `official Poetry documentation`_.
109
110.. _prerequisites_software_and_libraries:
111
112Package Installation (Linux)
113----------------------------
114
115|TF-A| can be compiled on both Linux and Windows-based machines.
116However, we strongly recommend using a UNIX-compatible build environment.
117
118Testing is performed using Ubuntu 22.04 LTS (64-bit), but other distributions
119should also work, provided the necessary tools and libraries are installed.
120
121The following are steps to install the required packages:
122
123.. code:: shell
124
125    sudo apt install build-essential
126
127The optional packages can be installed using:
128
129.. code:: shell
130
131    sudo apt install device-tree-compiler
132
133Additionally, to install a version of Node.js compatible with TF-A's repository
134scripts, you can use the `Node Version Manager`_. To install both NVM and an
135appropriate version of Node.js, run the following **from the root directory of
136the repository**:
137
138.. code:: shell
139
140    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
141    exec "$SHELL" -ic "nvm install; exec $SHELL"
142
143.. _Node Version Manager: https://github.com/nvm-sh/nvm#install--update-script
144
145Supporting Files
146----------------
147
148TF-A has been tested with pre-built binaries and file systems from `Linaro
149Release 20.01`_. Alternatively, you can build the binaries from source using
150instructions in :ref:`Performing an Initial Build`.
151
152.. _prerequisites_get_source:
153
154Additional Steps for Contributors
155^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
156
157If you are planning on contributing back to TF-A, there are some things you'll
158want to know.
159
160TF-A is hosted by a `Gerrit Code Review`_ server. Gerrit requires that all
161commits include a ``Change-Id`` footer, and this footer is typically
162automatically generated by a Git hook installed by you, the developer.
163
164If you have Node.js installed already, you can automatically install this hook,
165along with any additional hooks and Javascript-based tooling that we use, by
166running from within your newly-cloned repository:
167
168.. code:: shell
169
170    npm install --no-save
171
172If you have opted **not** to install Node.js, you can install the Gerrit hook
173manually by running:
174
175.. code:: shell
176
177    curl -Lo $(git rev-parse --git-dir)/hooks/commit-msg https://review.trustedfirmware.org/tools/hooks/commit-msg
178    chmod +x $(git rev-parse --git-dir)/hooks/commit-msg
179
180You can read more about Git hooks in the *githooks* page of the Git
181documentation, available `here <https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks>`_.
182
183.. _git_submodules:
184
185Cloning Additional Git Submodules
186^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
187
188Some dependencies in TF-A, such as Transfer List Library ``libtl``, are managed
189using Git submodules. Submodules allow external repositories to be included
190within the main project while maintaining their own commit history.
191
192Initial Clone with Submodules
193^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
194
195If you're cloning the repository for the first time, run the following commands
196to initialize and fetch all submodules:
197
198.. code-block:: bash
199
200   git clone --recurse-submodules "https://git.trustedfirmware.org/TF-A/trusted-firmware-a"
201
202This ensures all submodules (including ``libtl``) are correctly checked out.
203
204Updating Submodules
205^^^^^^^^^^^^^^^^^^^
206
207If the project updates the reference to a submodule (e.g., points to a new
208commit of ``libtl``), you can update your local copy by running:
209
210.. code-block:: bash
211
212   git pull
213   git submodule update --init --recursive
214
215To fetch the latest commits from all submodules, you can use:
216
217.. code-block:: bash
218
219   git submodule update --remote
220
221--------------
222
223*Copyright (c) 2021-2025, Arm Limited. All rights reserved.*
224
225.. _Arm Developer website: https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/downloads
226.. _Gerrit Code Review: https://www.gerritcodereview.com/
227.. _Arm-DS: https://developer.arm.com/Tools%20and%20Software/Arm%20Development%20Studio
228.. _Linaro Release 20.01: http://releases.linaro.org/members/arm/platforms/20.01
229.. _TrustedFirmware.org: https://www.trustedfirmware.org/
230.. _official Poetry documentation: https://python-poetry.org/docs/#installation
231