xref: /aosp_15_r20/external/arm-trusted-firmware/docs/getting_started/prerequisites.rst (revision 54fd6939e177f8ff529b10183254802c76df6d08)
1*54fd6939SJiyong ParkPrerequisites
2*54fd6939SJiyong Park=============
3*54fd6939SJiyong Park
4*54fd6939SJiyong ParkThis document describes the software requirements for building |TF-A| for
5*54fd6939SJiyong ParkAArch32 and AArch64 target platforms.
6*54fd6939SJiyong Park
7*54fd6939SJiyong ParkIt may possible to build |TF-A| with combinations of software packages that are
8*54fd6939SJiyong Parkdifferent from those listed below, however only the software described in this
9*54fd6939SJiyong Parkdocument can be officially supported.
10*54fd6939SJiyong Park
11*54fd6939SJiyong ParkBuild Host
12*54fd6939SJiyong Park----------
13*54fd6939SJiyong Park
14*54fd6939SJiyong Park|TF-A| can be built using either a Linux or a Windows machine as the build host.
15*54fd6939SJiyong Park
16*54fd6939SJiyong ParkA relatively recent Linux distribution is recommended for building |TF-A|. We
17*54fd6939SJiyong Parkhave performed tests using Ubuntu 16.04 LTS (64-bit) but other distributions
18*54fd6939SJiyong Parkshould also work fine as a base, provided that the necessary tools and libraries
19*54fd6939SJiyong Parkcan be installed.
20*54fd6939SJiyong Park
21*54fd6939SJiyong Park.. _prerequisites_toolchain:
22*54fd6939SJiyong Park
23*54fd6939SJiyong ParkToolchain
24*54fd6939SJiyong Park---------
25*54fd6939SJiyong Park
26*54fd6939SJiyong Park|TF-A| can be built with any of the following *cross-compiler* toolchains that
27*54fd6939SJiyong Parktarget the Armv7-A or Armv8-A architectures:
28*54fd6939SJiyong Park
29*54fd6939SJiyong Park- GCC >= 10.3-2021.07 (from the `Arm Developer website`_)
30*54fd6939SJiyong Park- Clang >= 4.0
31*54fd6939SJiyong Park- Arm Compiler >= 6.0
32*54fd6939SJiyong Park
33*54fd6939SJiyong ParkIn addition, a native compiler is required to build the supporting tools.
34*54fd6939SJiyong Park
35*54fd6939SJiyong Park.. note::
36*54fd6939SJiyong Park   The software has also been built on Windows 7 Enterprise SP1, using CMD.EXE,
37*54fd6939SJiyong Park   Cygwin, and Msys (MinGW) shells, using version 5.3.1 of the GNU toolchain.
38*54fd6939SJiyong Park
39*54fd6939SJiyong Park.. note::
40*54fd6939SJiyong Park   For instructions on how to select the cross compiler refer to
41*54fd6939SJiyong Park   :ref:`Performing an Initial Build`.
42*54fd6939SJiyong Park
43*54fd6939SJiyong Park.. _prerequisites_software_and_libraries:
44*54fd6939SJiyong Park
45*54fd6939SJiyong ParkSoftware and Libraries
46*54fd6939SJiyong Park----------------------
47*54fd6939SJiyong Park
48*54fd6939SJiyong ParkThe following tools are required to obtain and build |TF-A|:
49*54fd6939SJiyong Park
50*54fd6939SJiyong Park- An appropriate toolchain (see :ref:`prerequisites_toolchain`)
51*54fd6939SJiyong Park- GNU Make
52*54fd6939SJiyong Park- Git
53*54fd6939SJiyong Park
54*54fd6939SJiyong ParkThe following libraries must be available to build one or more components or
55*54fd6939SJiyong Parksupporting tools:
56*54fd6939SJiyong Park
57*54fd6939SJiyong Park- OpenSSL >= 1.0.1
58*54fd6939SJiyong Park
59*54fd6939SJiyong Park   Required to build the cert_create tool.
60*54fd6939SJiyong Park
61*54fd6939SJiyong ParkThe following libraries are required for Trusted Board Boot support:
62*54fd6939SJiyong Park
63*54fd6939SJiyong Park- mbed TLS == 2.26.0 (tag: ``mbedtls-2.26.0``)
64*54fd6939SJiyong Park
65*54fd6939SJiyong ParkThese tools are optional:
66*54fd6939SJiyong Park
67*54fd6939SJiyong Park- Device Tree Compiler (DTC) >= 1.4.6
68*54fd6939SJiyong Park
69*54fd6939SJiyong Park   Needed if you want to rebuild the provided Flattened Device Tree (FDT)
70*54fd6939SJiyong Park   source files (``.dts`` files). DTC is available for Linux through the package
71*54fd6939SJiyong Park   repositories of most distributions.
72*54fd6939SJiyong Park
73*54fd6939SJiyong Park- Arm `Development Studio 5 (DS-5)`_
74*54fd6939SJiyong Park
75*54fd6939SJiyong Park   The standard software package used for debugging software on Arm development
76*54fd6939SJiyong Park   platforms and |FVP| models.
77*54fd6939SJiyong Park
78*54fd6939SJiyong Park- Node.js >= 16
79*54fd6939SJiyong Park
80*54fd6939SJiyong Park   Highly recommended, and necessary in order to install and use the packaged
81*54fd6939SJiyong Park   Git hooks and helper tools. Without these tools you will need to rely on the
82*54fd6939SJiyong Park   CI for feedback on commit message conformance.
83*54fd6939SJiyong Park
84*54fd6939SJiyong ParkPackage Installation (Linux)
85*54fd6939SJiyong Park^^^^^^^^^^^^^^^^^^^^^^^^^^^^
86*54fd6939SJiyong Park
87*54fd6939SJiyong ParkIf you are using the recommended Ubuntu distribution then you can install the
88*54fd6939SJiyong Parkrequired packages with the following command:
89*54fd6939SJiyong Park
90*54fd6939SJiyong Park.. code:: shell
91*54fd6939SJiyong Park
92*54fd6939SJiyong Park    sudo apt install build-essential git libssl-dev
93*54fd6939SJiyong Park
94*54fd6939SJiyong ParkThe optional packages can be installed using:
95*54fd6939SJiyong Park
96*54fd6939SJiyong Park.. code:: shell
97*54fd6939SJiyong Park
98*54fd6939SJiyong Park    sudo apt install device-tree-compiler
99*54fd6939SJiyong Park
100*54fd6939SJiyong ParkAdditionally, to install an up-to-date version of Node.js, you can use the `Node
101*54fd6939SJiyong ParkVersion Manager`_ to install a version of your choosing (we recommend 16, but
102*54fd6939SJiyong Parklater LTS versions might offer a more stable experience):
103*54fd6939SJiyong Park
104*54fd6939SJiyong Park.. code:: shell
105*54fd6939SJiyong Park
106*54fd6939SJiyong Park    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | "$SHELL"
107*54fd6939SJiyong Park    exec "$SHELL" -ic "nvm install 16; exec $SHELL"
108*54fd6939SJiyong Park
109*54fd6939SJiyong Park.. _Node Version Manager: https://github.com/nvm-sh/nvm#install--update-script
110*54fd6939SJiyong Park
111*54fd6939SJiyong ParkSupporting Files
112*54fd6939SJiyong Park----------------
113*54fd6939SJiyong Park
114*54fd6939SJiyong ParkTF-A has been tested with pre-built binaries and file systems from `Linaro
115*54fd6939SJiyong ParkRelease 20.01`_. Alternatively, you can build the binaries from source using
116*54fd6939SJiyong Parkinstructions in :ref:`Performing an Initial Build`.
117*54fd6939SJiyong Park
118*54fd6939SJiyong Park.. _prerequisites_get_source:
119*54fd6939SJiyong Park
120*54fd6939SJiyong ParkGetting the TF-A Source
121*54fd6939SJiyong Park-----------------------
122*54fd6939SJiyong Park
123*54fd6939SJiyong ParkSource code for |TF-A| is maintained in a Git repository hosted on
124*54fd6939SJiyong ParkTrustedFirmware.org. To clone this repository from the server, run the following
125*54fd6939SJiyong Parkin your shell:
126*54fd6939SJiyong Park
127*54fd6939SJiyong Park.. code:: shell
128*54fd6939SJiyong Park
129*54fd6939SJiyong Park    git clone "https://review.trustedfirmware.org/TF-A/trusted-firmware-a"
130*54fd6939SJiyong Park
131*54fd6939SJiyong ParkAdditional Steps for Contributors
132*54fd6939SJiyong Park^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
133*54fd6939SJiyong Park
134*54fd6939SJiyong ParkIf you are planning on contributing back to TF-A, there are some things you'll
135*54fd6939SJiyong Parkwant to know.
136*54fd6939SJiyong Park
137*54fd6939SJiyong ParkTF-A is hosted by a `Gerrit Code Review`_ server. Gerrit requires that all
138*54fd6939SJiyong Parkcommits include a ``Change-Id`` footer, and this footer is typically
139*54fd6939SJiyong Parkautomatically generated by a Git hook installed by you, the developer.
140*54fd6939SJiyong Park
141*54fd6939SJiyong ParkIf you have Node.js installed already, you can automatically install this hook,
142*54fd6939SJiyong Parkalong with any additional hooks and Javascript-based tooling that we use, by
143*54fd6939SJiyong Parkrunning from within your newly-cloned repository:
144*54fd6939SJiyong Park
145*54fd6939SJiyong Park.. code:: shell
146*54fd6939SJiyong Park
147*54fd6939SJiyong Park    npm install --no-save
148*54fd6939SJiyong Park
149*54fd6939SJiyong ParkIf you have opted **not** to install Node.js, you can install the Gerrit hook
150*54fd6939SJiyong Parkmanually by running:
151*54fd6939SJiyong Park
152*54fd6939SJiyong Park.. code:: shell
153*54fd6939SJiyong Park
154*54fd6939SJiyong Park    curl -Lo $(git rev-parse --git-dir)/hooks/commit-msg https://review.trustedfirmware.org/tools/hooks/commit-msg
155*54fd6939SJiyong Park    chmod +x $(git rev-parse --git-dir)/hooks/commit-msg
156*54fd6939SJiyong Park
157*54fd6939SJiyong ParkYou can read more about Git hooks in the *githooks* page of the Git
158*54fd6939SJiyong Parkdocumentation, available `here <https://git-scm.com/docs/githooks>`_.
159*54fd6939SJiyong Park
160*54fd6939SJiyong Park--------------
161*54fd6939SJiyong Park
162*54fd6939SJiyong Park*Copyright (c) 2021, Arm Limited. All rights reserved.*
163*54fd6939SJiyong Park
164*54fd6939SJiyong Park.. _Arm Developer website: https://developer.arm.com/open-source/gnu-toolchain/gnu-a/downloads
165*54fd6939SJiyong Park.. _Gerrit Code Review: https://www.gerritcodereview.com/
166*54fd6939SJiyong Park.. _Linaro Release Notes: https://community.arm.com/dev-platforms/w/docs/226/old-release-notes
167*54fd6939SJiyong Park.. _Linaro instructions: https://community.arm.com/dev-platforms/w/docs/304/arm-reference-platforms-deliverables
168*54fd6939SJiyong Park.. _Development Studio 5 (DS-5): https://developer.arm.com/products/software-development-tools/ds-5-development-studio
169*54fd6939SJiyong Park.. _Linaro Release 20.01: http://releases.linaro.org/members/arm/platforms/20.01
170