xref: /rk3399_ARM-atf/docs/getting_started/prerequisites.rst (revision 02cc2efb6abaa418c3342f0161804cd170f9807f)
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
11*02cc2efbSHarrison MutaiGetting the TF-A Source
12*02cc2efbSHarrison Mutai-----------------------
1343f35ef5SPaul Beesley
14*02cc2efbSHarrison MutaiSource code for |TF-A| is maintained in a Git repository hosted on
15*02cc2efbSHarrison Mutai`TrustedFirmware.org`_. To clone this repository from the server, run the following
16*02cc2efbSHarrison Mutaiin your shell:
1743f35ef5SPaul Beesley
18*02cc2efbSHarrison Mutai.. code:: shell
1943f35ef5SPaul Beesley
20*02cc2efbSHarrison Mutai    git clone "https://review.trustedfirmware.org/TF-A/trusted-firmware-a"
21*02cc2efbSHarrison Mutai
22*02cc2efbSHarrison Mutai
23*02cc2efbSHarrison MutaiRequirements
24*02cc2efbSHarrison Mutai------------
25*02cc2efbSHarrison Mutai
26*02cc2efbSHarrison Mutai======================== =====================
27*02cc2efbSHarrison Mutai        Program          Min supported version
28*02cc2efbSHarrison Mutai======================== =====================
29*02cc2efbSHarrison MutaiArm Compiler             6.18
30*02cc2efbSHarrison MutaiArm GNU Compiler         13.2
31*02cc2efbSHarrison MutaiClang/LLVM               11.0.0
32*02cc2efbSHarrison MutaiDevice Tree Compiler     1.4.7
33*02cc2efbSHarrison MutaiGNU make                 3.81
34*02cc2efbSHarrison Mutaimbed TLS\ [#f1]_         3.4.1
35*02cc2efbSHarrison MutaiNode.js [#f2]_           16
36*02cc2efbSHarrison MutaiOpenSSL                  1.0.0
37*02cc2efbSHarrison MutaiPoetry [#f2]_            1.3.2
38*02cc2efbSHarrison MutaiQCBOR\ [#f3]_            1.2
39*02cc2efbSHarrison MutaiSphinx\ [#f2]_           2.4.4
40*02cc2efbSHarrison Mutai======================== =====================
41*02cc2efbSHarrison Mutai
42*02cc2efbSHarrison Mutai.. [#f1] Required for Trusted Board Boot and Measured Boot.
43*02cc2efbSHarrison Mutai.. [#f2] Required only for building TF-A documentation.
44*02cc2efbSHarrison Mutai.. [#f3] Required only when enabling DICE Protection Environment support.
4543f35ef5SPaul Beesley
4643f35ef5SPaul BeesleyToolchain
47*02cc2efbSHarrison Mutai^^^^^^^^^
4843f35ef5SPaul Beesley
49*02cc2efbSHarrison Mutai|TF-A| can be compiled using any cross-compiler toolchain specified in the
50*02cc2efbSHarrison Mutaipreceding table that target Armv7-A or Armv8-A. For AArch32 and
51*02cc2efbSHarrison MutaiAArch64 builds, the respective targets required are ``arm-none-eabi`` and
52*02cc2efbSHarrison Mutai``aarch64-none-elf``.
5343f35ef5SPaul Beesley
54*02cc2efbSHarrison MutaiTesting has been performed with version 13.2.Rel1 (gcc 13.2) of the Arm
55*02cc2efbSHarrison MutaiGNU compiler, which can be installed from the `Arm Developer website`_.
56b50838baSBoyan Karatotev
57*02cc2efbSHarrison 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
69*02cc2efbSHarrison MutaiOpenSSL
70*02cc2efbSHarrison Mutai^^^^^^^
7143f35ef5SPaul Beesley
72*02cc2efbSHarrison 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
78*02cc2efbSHarrison Mutai.. warning::
79*02cc2efbSHarrison Mutai    Versions 1.0.x and from v3.0.0 up to v3.0.6 are strongly advised against due
80*02cc2efbSHarrison Mutai    to concerns regarding security vulnerabilities!
8143f35ef5SPaul Beesley
82*02cc2efbSHarrison MutaiDevice Tree Compiler (DTC)
83*02cc2efbSHarrison 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
89*02cc2efbSHarrison MutaiArm Development Studio (`Arm-DS`_)
90*02cc2efbSHarrison Mutai^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9143f35ef5SPaul Beesley
9243f35ef5SPaul BeesleyThe standard software package used for debugging software on Arm development
9343f35ef5SPaul Beesleyplatforms and |FVP| models.
9443f35ef5SPaul Beesley
95*02cc2efbSHarrison MutaiNode.js
96*02cc2efbSHarrison 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
102*02cc2efbSHarrison MutaiPoetry
103*02cc2efbSHarrison Mutai^^^^^^
104793f72c0SHarrison Mutai
105793f72c0SHarrison MutaiRequired for managing Python dependencies, this will allow you to reliably
106793f72c0SHarrison Mutaireproduce a Python environment to build documentation and run analysis tools.
107793f72c0SHarrison MutaiMost importantly, it ensures your system environment will not be affected by
108793f72c0SHarrison Mutaidependencies in the Python scripts.
109793f72c0SHarrison Mutai
110*02cc2efbSHarrison Mutai.. _prerequisites_software_and_libraries:
11143f35ef5SPaul Beesley
112*02cc2efbSHarrison MutaiPackage Installation (Linux)
113*02cc2efbSHarrison Mutai----------------------------
114*02cc2efbSHarrison Mutai
115*02cc2efbSHarrison Mutai|TF-A| can be compiled on both Linux and Windows-based machines.
116*02cc2efbSHarrison MutaiHowever, we strongly recommend using a UNIX-compatible build environment.
117*02cc2efbSHarrison Mutai
118*02cc2efbSHarrison MutaiTesting is performed using Ubuntu 22.04 LTS (64-bit), but other distributions
119*02cc2efbSHarrison Mutaishould also work, provided the necessary tools and libraries are installed.
120*02cc2efbSHarrison Mutai
121*02cc2efbSHarrison MutaiThe following are steps to install the required packages:
12243f35ef5SPaul Beesley
12343f35ef5SPaul Beesley.. code:: shell
12443f35ef5SPaul Beesley
125*02cc2efbSHarrison Mutai    sudo apt install build-essential
12643f35ef5SPaul Beesley
12743f35ef5SPaul BeesleyThe optional packages can be installed using:
12843f35ef5SPaul Beesley
12943f35ef5SPaul Beesley.. code:: shell
13043f35ef5SPaul Beesley
13143f35ef5SPaul Beesley    sudo apt install device-tree-compiler
13243f35ef5SPaul Beesley
13310c969c5SChris KayAdditionally, to install a version of Node.js compatible with TF-A's repository
13410c969c5SChris Kayscripts, you can use the `Node Version Manager`_. To install both NVM and an
13510c969c5SChris Kayappropriate version of Node.js, run the following **from the root directory of
13610c969c5SChris Kaythe repository**:
137ba39362fSChris Kay
138ba39362fSChris Kay.. code:: shell
139ba39362fSChris Kay
14010c969c5SChris Kay    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
14110c969c5SChris Kay    exec "$SHELL" -ic "nvm install; exec $SHELL"
142ba39362fSChris Kay
143ba39362fSChris Kay.. _Node Version Manager: https://github.com/nvm-sh/nvm#install--update-script
144ba39362fSChris Kay
14543f35ef5SPaul BeesleySupporting Files
14643f35ef5SPaul Beesley----------------
14743f35ef5SPaul Beesley
14843f35ef5SPaul BeesleyTF-A has been tested with pre-built binaries and file systems from `Linaro
14999a99eb4SZelalemRelease 20.01`_. Alternatively, you can build the binaries from source using
15043f35ef5SPaul Beesleyinstructions in :ref:`Performing an Initial Build`.
15143f35ef5SPaul Beesley
15243f35ef5SPaul Beesley.. _prerequisites_get_source:
15343f35ef5SPaul Beesley
154ba39362fSChris KayAdditional Steps for Contributors
155ba39362fSChris Kay^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15643f35ef5SPaul Beesley
157ba39362fSChris KayIf you are planning on contributing back to TF-A, there are some things you'll
158ba39362fSChris Kaywant to know.
15943f35ef5SPaul Beesley
160ba39362fSChris KayTF-A is hosted by a `Gerrit Code Review`_ server. Gerrit requires that all
161ba39362fSChris Kaycommits include a ``Change-Id`` footer, and this footer is typically
162ba39362fSChris Kayautomatically generated by a Git hook installed by you, the developer.
163ba39362fSChris Kay
164ba39362fSChris KayIf you have Node.js installed already, you can automatically install this hook,
165ba39362fSChris Kayalong with any additional hooks and Javascript-based tooling that we use, by
166ba39362fSChris Kayrunning from within your newly-cloned repository:
16743f35ef5SPaul Beesley
16843f35ef5SPaul Beesley.. code:: shell
16943f35ef5SPaul Beesley
170a4371d1cSChris Kay    npm install --no-save
171ba39362fSChris Kay
172ba39362fSChris KayIf you have opted **not** to install Node.js, you can install the Gerrit hook
173ba39362fSChris Kaymanually by running:
174ba39362fSChris Kay
175ba39362fSChris Kay.. code:: shell
176ba39362fSChris Kay
177ba39362fSChris Kay    curl -Lo $(git rev-parse --git-dir)/hooks/commit-msg https://review.trustedfirmware.org/tools/hooks/commit-msg
178ba39362fSChris Kay    chmod +x $(git rev-parse --git-dir)/hooks/commit-msg
179ba39362fSChris Kay
180ba39362fSChris KayYou can read more about Git hooks in the *githooks* page of the Git
181ba39362fSChris Kaydocumentation, available `here <https://git-scm.com/docs/githooks>`_.
18243f35ef5SPaul Beesley
18343f35ef5SPaul Beesley--------------
18443f35ef5SPaul Beesley
185c19977beSTamas Ban*Copyright (c) 2021-2024, Arm Limited. All rights reserved.*
18643f35ef5SPaul Beesley
18771a5543bSSandrine Bailleux.. _Arm Developer website: https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/downloads
188ba39362fSChris Kay.. _Gerrit Code Review: https://www.gerritcodereview.com/
18943f35ef5SPaul Beesley.. _Linaro Release Notes: https://community.arm.com/dev-platforms/w/docs/226/old-release-notes
19043f35ef5SPaul Beesley.. _Linaro instructions: https://community.arm.com/dev-platforms/w/docs/304/arm-reference-platforms-deliverables
191*02cc2efbSHarrison Mutai.. _Arm-DS: https://developer.arm.com/Tools%20and%20Software/Arm%20Development%20Studio
19299a99eb4SZelalem.. _Linaro Release 20.01: http://releases.linaro.org/members/arm/platforms/20.01
193*02cc2efbSHarrison Mutai.. _TrustedFirmware.org: https://www.trustedfirmware.org/
194