xref: /rk3399_ARM-atf/docs/getting_started/prerequisites.rst (revision 822aa0b977587fa2743058cf8c922c7d8ea3c008)
143f35ef5SPaul BeesleyPrerequisites
243f35ef5SPaul Beesley=============
343f35ef5SPaul Beesley
443f35ef5SPaul BeesleyThis document describes the software requirements for building |TF-A| for
543f35ef5SPaul BeesleyAArch32 and AArch64 target platforms.
643f35ef5SPaul Beesley
743f35ef5SPaul BeesleyIt may possible to build |TF-A| with combinations of software packages that are
843f35ef5SPaul Beesleydifferent from those listed below, however only the software described in this
943f35ef5SPaul Beesleydocument can be officially supported.
104a1bcd50SSandrine Bailleux
1102cc2efbSHarrison MutaiGetting the TF-A Source
1202cc2efbSHarrison Mutai-----------------------
1343f35ef5SPaul Beesley
1402cc2efbSHarrison MutaiSource code for |TF-A| is maintained in a Git repository hosted on
1502cc2efbSHarrison Mutai`TrustedFirmware.org`_. To clone this repository from the server, run the following
1602cc2efbSHarrison Mutaiin your shell:
1743f35ef5SPaul Beesley
1802cc2efbSHarrison Mutai.. code:: shell
1943f35ef5SPaul Beesley
2002cc2efbSHarrison Mutai    git clone "https://review.trustedfirmware.org/TF-A/trusted-firmware-a"
2102cc2efbSHarrison Mutai
2202cc2efbSHarrison Mutai
2302cc2efbSHarrison MutaiRequirements
2402cc2efbSHarrison Mutai------------
2502cc2efbSHarrison Mutai
2602cc2efbSHarrison Mutai======================== =====================
2702cc2efbSHarrison Mutai        Program          Min supported version
2802cc2efbSHarrison Mutai======================== =====================
2935503bdcSBoyan KaratotevArm Compiler             6.23
304d9903bdSJayanth Dodderi ChidanandArm GNU Compiler         14.3
3140c0a64cSHarrison MutaiClang/LLVM               18.1.8
3240c0a64cSHarrison MutaiDevice Tree Compiler     1.6.1
33*dfde3494SHarrison MutaiGNU Make                 4.3
345affb6a7SSlava Andrianovmbed TLS\ [#f1]_         3.6.5
35*dfde3494SHarrison MutaiNode.js [#f2]_           20.11.1
3602cc2efbSHarrison MutaiOpenSSL                  1.0.0
370c9cd67dSChris KayPoetry                   1.3.2
3802cc2efbSHarrison MutaiQCBOR\ [#f3]_            1.2
3940c0a64cSHarrison MutaiSphinx\ [#f2]_           5.3.0
4002cc2efbSHarrison Mutai======================== =====================
4102cc2efbSHarrison Mutai
4202cc2efbSHarrison Mutai.. [#f1] Required for Trusted Board Boot and Measured Boot.
4302cc2efbSHarrison Mutai.. [#f2] Required only for building TF-A documentation.
4402cc2efbSHarrison Mutai.. [#f3] Required only when enabling DICE Protection Environment support.
4543f35ef5SPaul Beesley
4643f35ef5SPaul BeesleyToolchain
4702cc2efbSHarrison Mutai^^^^^^^^^
4843f35ef5SPaul Beesley
4902cc2efbSHarrison Mutai|TF-A| can be compiled using any cross-compiler toolchain specified in the
5002cc2efbSHarrison Mutaipreceding table that target Armv7-A or Armv8-A. For AArch32 and
5102cc2efbSHarrison MutaiAArch64 builds, the respective targets required are ``arm-none-eabi`` and
5202cc2efbSHarrison Mutai``aarch64-none-elf``.
5343f35ef5SPaul Beesley
54*dfde3494SHarrison MutaiTesting has been performed with the version of the Arm GNU compiler listed in
55*dfde3494SHarrison Mutaithe table above. This can be installed from the `Arm Developer website`_.
56b50838baSBoyan Karatotev
5702cc2efbSHarrison MutaiIn addition, a native compiler is required to build supporting tools.
5843f35ef5SPaul Beesley
5943f35ef5SPaul Beesley.. note::
60415195c0SBoyan Karatotev   Versions greater than the ones specified are likely but not guaranteed to
61415195c0SBoyan Karatotev   work. This is predominantly because TF-A carries its own copy of compiler-rt,
62415195c0SBoyan Karatotev   which may be older than the version expected by the compiler. Fixes and bug
63415195c0SBoyan Karatotev   reports are always welcome.
64415195c0SBoyan Karatotev
65415195c0SBoyan Karatotev.. note::
6643f35ef5SPaul Beesley   For instructions on how to select the cross compiler refer to
6743f35ef5SPaul Beesley   :ref:`Performing an Initial Build`.
6843f35ef5SPaul Beesley
6902cc2efbSHarrison MutaiOpenSSL
7002cc2efbSHarrison Mutai^^^^^^^
7143f35ef5SPaul Beesley
7202cc2efbSHarrison MutaiOpenSSL is required to build the cert_create, encrypt_fw, and fiptool tools.
738caf10acSJuan Pablo Conde
74cf2dd17dSJuan Pablo CondeIf using OpenSSL 3, older Linux versions may require it to be built from
75cf2dd17dSJuan Pablo Condesource code, as it may not be available in the default package repositories.
76cf2dd17dSJuan Pablo CondePlease refer to the OpenSSL project documentation for more information.
778caf10acSJuan Pablo Conde
7802cc2efbSHarrison Mutai.. warning::
7902cc2efbSHarrison Mutai    Versions 1.0.x and from v3.0.0 up to v3.0.6 are strongly advised against due
8002cc2efbSHarrison Mutai    to concerns regarding security vulnerabilities!
8143f35ef5SPaul Beesley
8202cc2efbSHarrison MutaiDevice Tree Compiler (DTC)
8302cc2efbSHarrison Mutai^^^^^^^^^^^^^^^^^^^^^^^^^^
8443f35ef5SPaul Beesley
8543f35ef5SPaul BeesleyNeeded if you want to rebuild the provided Flattened Device Tree (FDT)
8643f35ef5SPaul Beesleysource files (``.dts`` files). DTC is available for Linux through the package
8743f35ef5SPaul Beesleyrepositories of most distributions.
8843f35ef5SPaul Beesley
8902cc2efbSHarrison MutaiArm Development Studio (`Arm-DS`_)
9002cc2efbSHarrison Mutai^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9143f35ef5SPaul Beesley
9243f35ef5SPaul BeesleyThe standard software package used for debugging software on Arm development
9343f35ef5SPaul Beesleyplatforms and |FVP| models.
9443f35ef5SPaul Beesley
9502cc2efbSHarrison MutaiNode.js
9602cc2efbSHarrison Mutai^^^^^^^
97ba39362fSChris Kay
98ba39362fSChris KayHighly recommended, and necessary in order to install and use the packaged
99ba39362fSChris KayGit hooks and helper tools. Without these tools you will need to rely on the
100ba39362fSChris KayCI for feedback on commit message conformance.
101ba39362fSChris Kay
10202cc2efbSHarrison MutaiPoetry
10302cc2efbSHarrison Mutai^^^^^^
104793f72c0SHarrison Mutai
105793f72c0SHarrison MutaiRequired for managing Python dependencies, this will allow you to reliably
1060c9cd67dSChris Kayreproduce a Python environment to build documentation and run some of the
1070c9cd67dSChris Kayintegrated Python tools. Most importantly, it ensures your system environment
1080c9cd67dSChris Kaywill not be affected by dependencies in the Python scripts.
1090c9cd67dSChris Kay
1100c9cd67dSChris KayFor installation instructions, see the `official Poetry documentation`_.
111793f72c0SHarrison Mutai
11202cc2efbSHarrison Mutai.. _prerequisites_software_and_libraries:
11343f35ef5SPaul Beesley
11402cc2efbSHarrison MutaiPackage Installation (Linux)
11502cc2efbSHarrison Mutai----------------------------
11602cc2efbSHarrison Mutai
11702cc2efbSHarrison Mutai|TF-A| can be compiled on both Linux and Windows-based machines.
11802cc2efbSHarrison MutaiHowever, we strongly recommend using a UNIX-compatible build environment.
11902cc2efbSHarrison Mutai
12002cc2efbSHarrison MutaiTesting is performed using Ubuntu 22.04 LTS (64-bit), but other distributions
12102cc2efbSHarrison Mutaishould also work, provided the necessary tools and libraries are installed.
12202cc2efbSHarrison Mutai
12302cc2efbSHarrison MutaiThe following are steps to install the required packages:
12443f35ef5SPaul Beesley
12543f35ef5SPaul Beesley.. code:: shell
12643f35ef5SPaul Beesley
12702cc2efbSHarrison Mutai    sudo apt install build-essential
12843f35ef5SPaul Beesley
12943f35ef5SPaul BeesleyThe optional packages can be installed using:
13043f35ef5SPaul Beesley
13143f35ef5SPaul Beesley.. code:: shell
13243f35ef5SPaul Beesley
13343f35ef5SPaul Beesley    sudo apt install device-tree-compiler
13443f35ef5SPaul Beesley
13510c969c5SChris KayAdditionally, to install a version of Node.js compatible with TF-A's repository
13610c969c5SChris Kayscripts, you can use the `Node Version Manager`_. To install both NVM and an
13710c969c5SChris Kayappropriate version of Node.js, run the following **from the root directory of
13810c969c5SChris Kaythe repository**:
139ba39362fSChris Kay
140ba39362fSChris Kay.. code:: shell
141ba39362fSChris Kay
14210c969c5SChris Kay    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
14310c969c5SChris Kay    exec "$SHELL" -ic "nvm install; exec $SHELL"
144ba39362fSChris Kay
145ba39362fSChris Kay.. _Node Version Manager: https://github.com/nvm-sh/nvm#install--update-script
146ba39362fSChris Kay
14743f35ef5SPaul BeesleySupporting Files
14843f35ef5SPaul Beesley----------------
14943f35ef5SPaul Beesley
15043f35ef5SPaul BeesleyTF-A has been tested with pre-built binaries and file systems from `Linaro
15199a99eb4SZelalemRelease 20.01`_. Alternatively, you can build the binaries from source using
15243f35ef5SPaul Beesleyinstructions in :ref:`Performing an Initial Build`.
15343f35ef5SPaul Beesley
15443f35ef5SPaul Beesley.. _prerequisites_get_source:
15543f35ef5SPaul Beesley
156ba39362fSChris KayAdditional Steps for Contributors
157ba39362fSChris Kay^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15843f35ef5SPaul Beesley
159ba39362fSChris KayIf you are planning on contributing back to TF-A, there are some things you'll
160ba39362fSChris Kaywant to know.
16143f35ef5SPaul Beesley
162ba39362fSChris KayTF-A is hosted by a `Gerrit Code Review`_ server. Gerrit requires that all
163ba39362fSChris Kaycommits include a ``Change-Id`` footer, and this footer is typically
164ba39362fSChris Kayautomatically generated by a Git hook installed by you, the developer.
165ba39362fSChris Kay
166ba39362fSChris KayIf you have Node.js installed already, you can automatically install this hook,
167ba39362fSChris Kayalong with any additional hooks and Javascript-based tooling that we use, by
168ba39362fSChris Kayrunning from within your newly-cloned repository:
16943f35ef5SPaul Beesley
17043f35ef5SPaul Beesley.. code:: shell
17143f35ef5SPaul Beesley
172a4371d1cSChris Kay    npm install --no-save
173ba39362fSChris Kay
174ba39362fSChris KayIf you have opted **not** to install Node.js, you can install the Gerrit hook
175ba39362fSChris Kaymanually by running:
176ba39362fSChris Kay
177ba39362fSChris Kay.. code:: shell
178ba39362fSChris Kay
179ba39362fSChris Kay    curl -Lo $(git rev-parse --git-dir)/hooks/commit-msg https://review.trustedfirmware.org/tools/hooks/commit-msg
180ba39362fSChris Kay    chmod +x $(git rev-parse --git-dir)/hooks/commit-msg
181ba39362fSChris Kay
182ba39362fSChris KayYou can read more about Git hooks in the *githooks* page of the Git
183854d199bSGovindraj Rajadocumentation, available `here <https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks>`_.
18443f35ef5SPaul Beesley
18506f3c705SHarrison Mutai.. _git_submodules:
18606f3c705SHarrison Mutai
18706f3c705SHarrison MutaiCloning Additional Git Submodules
18806f3c705SHarrison Mutai^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18906f3c705SHarrison Mutai
19006f3c705SHarrison MutaiSome dependencies in TF-A, such as Transfer List Library ``libtl``, are managed
19106f3c705SHarrison Mutaiusing Git submodules. Submodules allow external repositories to be included
19206f3c705SHarrison Mutaiwithin the main project while maintaining their own commit history.
19306f3c705SHarrison Mutai
19406f3c705SHarrison MutaiInitial Clone with Submodules
19506f3c705SHarrison Mutai^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
19606f3c705SHarrison Mutai
19706f3c705SHarrison MutaiIf you're cloning the repository for the first time, run the following commands
19806f3c705SHarrison Mutaito initialize and fetch all submodules:
19906f3c705SHarrison Mutai
20006f3c705SHarrison Mutai.. code-block:: bash
20106f3c705SHarrison Mutai
20206f3c705SHarrison Mutai   git clone --recurse-submodules "https://git.trustedfirmware.org/TF-A/trusted-firmware-a"
20306f3c705SHarrison Mutai
20406f3c705SHarrison MutaiThis ensures all submodules (including ``libtl``) are correctly checked out.
20506f3c705SHarrison Mutai
20606f3c705SHarrison MutaiUpdating Submodules
20706f3c705SHarrison Mutai^^^^^^^^^^^^^^^^^^^
20806f3c705SHarrison Mutai
20906f3c705SHarrison MutaiIf the project updates the reference to a submodule (e.g., points to a new
21006f3c705SHarrison Mutaicommit of ``libtl``), you can update your local copy by running:
21106f3c705SHarrison Mutai
21206f3c705SHarrison Mutai.. code-block:: bash
21306f3c705SHarrison Mutai
21406f3c705SHarrison Mutai   git pull
21506f3c705SHarrison Mutai   git submodule update --init --recursive
21606f3c705SHarrison Mutai
21706f3c705SHarrison MutaiTo fetch the latest commits from all submodules, you can use:
21806f3c705SHarrison Mutai
21906f3c705SHarrison Mutai.. code-block:: bash
22006f3c705SHarrison Mutai
22106f3c705SHarrison Mutai   git submodule update --remote
22206f3c705SHarrison Mutai
22343f35ef5SPaul Beesley--------------
22443f35ef5SPaul Beesley
22535503bdcSBoyan Karatotev*Copyright (c) 2021-2025, Arm Limited. All rights reserved.*
22643f35ef5SPaul Beesley
22771a5543bSSandrine Bailleux.. _Arm Developer website: https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/downloads
228ba39362fSChris Kay.. _Gerrit Code Review: https://www.gerritcodereview.com/
22902cc2efbSHarrison Mutai.. _Arm-DS: https://developer.arm.com/Tools%20and%20Software/Arm%20Development%20Studio
23099a99eb4SZelalem.. _Linaro Release 20.01: http://releases.linaro.org/members/arm/platforms/20.01
23102cc2efbSHarrison Mutai.. _TrustedFirmware.org: https://www.trustedfirmware.org/
2320c9cd67dSChris Kay.. _official Poetry documentation: https://python-poetry.org/docs/#installation
233