Paul Beesley | d2fcc4e | 2019-05-29 13:59:40 +0100 | [diff] [blame] | 1 | Prerequisites |
| 2 | ============= |
| 3 | |
| 4 | This document describes the software requirements for building |TF-A| for |
| 5 | AArch32 and AArch64 target platforms. |
| 6 | |
| 7 | It may possible to build |TF-A| with combinations of software packages that are |
| 8 | different from those listed below, however only the software described in this |
| 9 | document can be officially supported. |
Sandrine Bailleux | b386f0a | 2022-07-11 10:53:42 +0200 | [diff] [blame] | 10 | |
Paul Beesley | d2fcc4e | 2019-05-29 13:59:40 +0100 | [diff] [blame] | 11 | Build Host |
| 12 | ---------- |
| 13 | |
| 14 | |TF-A| can be built using either a Linux or a Windows machine as the build host. |
| 15 | |
| 16 | A relatively recent Linux distribution is recommended for building |TF-A|. We |
Govindraj Raja | 2fc760e | 2023-05-12 14:56:42 -0500 | [diff] [blame] | 17 | have performed tests using Ubuntu 22.04 LTS (64-bit) but other distributions |
Paul Beesley | d2fcc4e | 2019-05-29 13:59:40 +0100 | [diff] [blame] | 18 | should also work fine as a base, provided that the necessary tools and libraries |
| 19 | can be installed. |
| 20 | |
| 21 | .. _prerequisites_toolchain: |
| 22 | |
| 23 | Toolchain |
| 24 | --------- |
| 25 | |
| 26 | |TF-A| can be built with any of the following *cross-compiler* toolchains that |
| 27 | target the Armv7-A or Armv8-A architectures: |
| 28 | |
Jayanth Dodderi Chidanand | 334bc48 | 2023-09-07 11:14:30 +0100 | [diff] [blame] | 29 | - TF-A has been tested with version 12.3.Rel1 (gcc 12.3) from the `Arm Developer website`_ |
Boyan Karatotev | daf0ef6 | 2022-10-27 14:47:18 +0100 | [diff] [blame] | 30 | |
| 31 | You will need the targets ``arm-none-eabi`` and ``aarch64-none-elf`` for |
| 32 | AArch32 and AArch64 builds respectively. |
| 33 | |
Boyan Karatotev | a4d03b7 | 2023-02-09 15:59:39 +0000 | [diff] [blame] | 34 | - Clang == 14.0.0 |
| 35 | - Arm Compiler == 6.18 |
Paul Beesley | d2fcc4e | 2019-05-29 13:59:40 +0100 | [diff] [blame] | 36 | |
| 37 | In addition, a native compiler is required to build the supporting tools. |
| 38 | |
| 39 | .. note:: |
Boyan Karatotev | a4d03b7 | 2023-02-09 15:59:39 +0000 | [diff] [blame] | 40 | Versions greater than the ones specified are likely but not guaranteed to |
| 41 | work. This is predominantly because TF-A carries its own copy of compiler-rt, |
| 42 | which may be older than the version expected by the compiler. Fixes and bug |
| 43 | reports are always welcome. |
| 44 | |
| 45 | .. note:: |
Paul Beesley | d2fcc4e | 2019-05-29 13:59:40 +0100 | [diff] [blame] | 46 | The software has also been built on Windows 7 Enterprise SP1, using CMD.EXE, |
| 47 | Cygwin, and Msys (MinGW) shells, using version 5.3.1 of the GNU toolchain. |
| 48 | |
| 49 | .. note:: |
| 50 | For instructions on how to select the cross compiler refer to |
| 51 | :ref:`Performing an Initial Build`. |
| 52 | |
| 53 | .. _prerequisites_software_and_libraries: |
| 54 | |
| 55 | Software and Libraries |
| 56 | ---------------------- |
| 57 | |
| 58 | The following tools are required to obtain and build |TF-A|: |
| 59 | |
| 60 | - An appropriate toolchain (see :ref:`prerequisites_toolchain`) |
| 61 | - GNU Make |
| 62 | - Git |
| 63 | |
| 64 | The following libraries must be available to build one or more components or |
| 65 | supporting tools: |
| 66 | |
Juan Pablo Conde | 3539c74 | 2022-10-25 19:41:02 -0400 | [diff] [blame] | 67 | - OpenSSL >= 1.1.1 (v3.0.0 to v3.0.6 highly discouraged due to security issues) |
Paul Beesley | d2fcc4e | 2019-05-29 13:59:40 +0100 | [diff] [blame] | 68 | |
Juan Pablo Conde | 3539c74 | 2022-10-25 19:41:02 -0400 | [diff] [blame] | 69 | Required to build the cert_create, encrypt_fw, and fiptool tools. |
Paul Beesley | d2fcc4e | 2019-05-29 13:59:40 +0100 | [diff] [blame] | 70 | |
Juan Pablo Conde | 5286552 | 2022-06-28 16:56:32 -0400 | [diff] [blame] | 71 | .. note:: |
| 72 | |
Juan Pablo Conde | 3539c74 | 2022-10-25 19:41:02 -0400 | [diff] [blame] | 73 | If using OpenSSL 3, older Linux versions may require it to be built from |
| 74 | source code, as it may not be available in the default package repositories. |
| 75 | Please refer to the OpenSSL project documentation for more information. |
Juan Pablo Conde | 5286552 | 2022-06-28 16:56:32 -0400 | [diff] [blame] | 76 | |
Sandrine Bailleux | 878a998 | 2022-04-22 15:47:31 +0200 | [diff] [blame] | 77 | The following libraries are required for Trusted Board Boot and Measured Boot |
| 78 | support: |
Paul Beesley | d2fcc4e | 2019-05-29 13:59:40 +0100 | [diff] [blame] | 79 | |
Sandrine Bailleux | 259fffe | 2023-09-11 17:02:22 +0200 | [diff] [blame] | 80 | - mbed TLS == 3.4.1 (tag: ``mbedtls-3.4.1``) |
Paul Beesley | d2fcc4e | 2019-05-29 13:59:40 +0100 | [diff] [blame] | 81 | |
Tamas Ban | 9e4a4f8 | 2023-06-06 13:58:21 +0200 | [diff] [blame] | 82 | The following libraries are required for DICE Protection Environment support: |
| 83 | |
| 84 | - QCBOR == 1.2 (tag: ``v1.2``) |
| 85 | |
Paul Beesley | d2fcc4e | 2019-05-29 13:59:40 +0100 | [diff] [blame] | 86 | These tools are optional: |
| 87 | |
Govindraj Raja | 2fc760e | 2023-05-12 14:56:42 -0500 | [diff] [blame] | 88 | - Device Tree Compiler (DTC) >= 1.4.7 |
Paul Beesley | d2fcc4e | 2019-05-29 13:59:40 +0100 | [diff] [blame] | 89 | |
| 90 | Needed if you want to rebuild the provided Flattened Device Tree (FDT) |
| 91 | source files (``.dts`` files). DTC is available for Linux through the package |
| 92 | repositories of most distributions. |
| 93 | |
Daniel Boulby | df83a83 | 2022-05-03 16:46:16 +0100 | [diff] [blame] | 94 | - Arm `Development Studio (Arm-DS)`_ |
Paul Beesley | d2fcc4e | 2019-05-29 13:59:40 +0100 | [diff] [blame] | 95 | |
| 96 | The standard software package used for debugging software on Arm development |
| 97 | platforms and |FVP| models. |
| 98 | |
Chris Kay | 32b292d | 2021-11-02 10:19:37 +0000 | [diff] [blame] | 99 | - Node.js >= 16 |
Chris Kay | 46e17f9 | 2020-12-09 12:56:27 +0000 | [diff] [blame] | 100 | |
| 101 | Highly recommended, and necessary in order to install and use the packaged |
| 102 | Git hooks and helper tools. Without these tools you will need to rely on the |
| 103 | CI for feedback on commit message conformance. |
| 104 | |
Harrison Mutai | b378ad4 | 2023-02-16 10:20:48 +0000 | [diff] [blame] | 105 | - Poetry >= 1.3.2 |
| 106 | |
Harrison Mutai | 342f468 | 2023-04-24 09:58:17 +0100 | [diff] [blame] | 107 | Required for managing Python dependencies, this will allow you to reliably |
| 108 | reproduce a Python environment to build documentation and run analysis tools. |
| 109 | Most importantly, it ensures your system environment will not be affected by |
| 110 | dependencies in the Python scripts. |
Harrison Mutai | b378ad4 | 2023-02-16 10:20:48 +0000 | [diff] [blame] | 111 | |
Paul Beesley | d2fcc4e | 2019-05-29 13:59:40 +0100 | [diff] [blame] | 112 | Package Installation (Linux) |
| 113 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 114 | |
| 115 | If you are using the recommended Ubuntu distribution then you can install the |
| 116 | required packages with the following command: |
| 117 | |
| 118 | .. code:: shell |
| 119 | |
Juan Pablo Conde | 5286552 | 2022-06-28 16:56:32 -0400 | [diff] [blame] | 120 | sudo apt install build-essential git |
Paul Beesley | d2fcc4e | 2019-05-29 13:59:40 +0100 | [diff] [blame] | 121 | |
| 122 | The optional packages can be installed using: |
| 123 | |
| 124 | .. code:: shell |
| 125 | |
| 126 | sudo apt install device-tree-compiler |
| 127 | |
Chris Kay | d855ae2 | 2022-10-10 14:34:23 +0100 | [diff] [blame] | 128 | Additionally, to install a version of Node.js compatible with TF-A's repository |
| 129 | scripts, you can use the `Node Version Manager`_. To install both NVM and an |
| 130 | appropriate version of Node.js, run the following **from the root directory of |
| 131 | the repository**: |
Chris Kay | 46e17f9 | 2020-12-09 12:56:27 +0000 | [diff] [blame] | 132 | |
| 133 | .. code:: shell |
| 134 | |
Chris Kay | d855ae2 | 2022-10-10 14:34:23 +0100 | [diff] [blame] | 135 | curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash |
| 136 | exec "$SHELL" -ic "nvm install; exec $SHELL" |
Chris Kay | 46e17f9 | 2020-12-09 12:56:27 +0000 | [diff] [blame] | 137 | |
| 138 | .. _Node Version Manager: https://github.com/nvm-sh/nvm#install--update-script |
| 139 | |
Paul Beesley | d2fcc4e | 2019-05-29 13:59:40 +0100 | [diff] [blame] | 140 | Supporting Files |
| 141 | ---------------- |
| 142 | |
| 143 | TF-A has been tested with pre-built binaries and file systems from `Linaro |
Zelalem | c005fdf | 2021-06-01 17:05:16 -0500 | [diff] [blame] | 144 | Release 20.01`_. Alternatively, you can build the binaries from source using |
Paul Beesley | d2fcc4e | 2019-05-29 13:59:40 +0100 | [diff] [blame] | 145 | instructions in :ref:`Performing an Initial Build`. |
| 146 | |
| 147 | .. _prerequisites_get_source: |
| 148 | |
| 149 | Getting the TF-A Source |
| 150 | ----------------------- |
| 151 | |
| 152 | Source code for |TF-A| is maintained in a Git repository hosted on |
| 153 | TrustedFirmware.org. To clone this repository from the server, run the following |
| 154 | in your shell: |
| 155 | |
| 156 | .. code:: shell |
| 157 | |
Chris Kay | 46e17f9 | 2020-12-09 12:56:27 +0000 | [diff] [blame] | 158 | git clone "https://review.trustedfirmware.org/TF-A/trusted-firmware-a" |
Paul Beesley | d2fcc4e | 2019-05-29 13:59:40 +0100 | [diff] [blame] | 159 | |
Chris Kay | 46e17f9 | 2020-12-09 12:56:27 +0000 | [diff] [blame] | 160 | Additional Steps for Contributors |
| 161 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
Paul Beesley | d2fcc4e | 2019-05-29 13:59:40 +0100 | [diff] [blame] | 162 | |
Chris Kay | 46e17f9 | 2020-12-09 12:56:27 +0000 | [diff] [blame] | 163 | If you are planning on contributing back to TF-A, there are some things you'll |
| 164 | want to know. |
Paul Beesley | d2fcc4e | 2019-05-29 13:59:40 +0100 | [diff] [blame] | 165 | |
Chris Kay | 46e17f9 | 2020-12-09 12:56:27 +0000 | [diff] [blame] | 166 | TF-A is hosted by a `Gerrit Code Review`_ server. Gerrit requires that all |
| 167 | commits include a ``Change-Id`` footer, and this footer is typically |
| 168 | automatically generated by a Git hook installed by you, the developer. |
| 169 | |
| 170 | If you have Node.js installed already, you can automatically install this hook, |
| 171 | along with any additional hooks and Javascript-based tooling that we use, by |
| 172 | running from within your newly-cloned repository: |
Paul Beesley | d2fcc4e | 2019-05-29 13:59:40 +0100 | [diff] [blame] | 173 | |
| 174 | .. code:: shell |
| 175 | |
Chris Kay | 2ff006b | 2021-05-17 11:18:56 +0100 | [diff] [blame] | 176 | npm install --no-save |
Chris Kay | 46e17f9 | 2020-12-09 12:56:27 +0000 | [diff] [blame] | 177 | |
| 178 | If you have opted **not** to install Node.js, you can install the Gerrit hook |
| 179 | manually by running: |
| 180 | |
| 181 | .. code:: shell |
| 182 | |
| 183 | curl -Lo $(git rev-parse --git-dir)/hooks/commit-msg https://review.trustedfirmware.org/tools/hooks/commit-msg |
| 184 | chmod +x $(git rev-parse --git-dir)/hooks/commit-msg |
| 185 | |
| 186 | You can read more about Git hooks in the *githooks* page of the Git |
| 187 | documentation, available `here <https://git-scm.com/docs/githooks>`_. |
Paul Beesley | d2fcc4e | 2019-05-29 13:59:40 +0100 | [diff] [blame] | 188 | |
| 189 | -------------- |
| 190 | |
Tamas Ban | 9e4a4f8 | 2023-06-06 13:58:21 +0200 | [diff] [blame] | 191 | *Copyright (c) 2021-2024, Arm Limited. All rights reserved.* |
Paul Beesley | d2fcc4e | 2019-05-29 13:59:40 +0100 | [diff] [blame] | 192 | |
Sandrine Bailleux | e356a18 | 2022-04-15 11:17:40 +0200 | [diff] [blame] | 193 | .. _Arm Developer website: https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/downloads |
Chris Kay | 46e17f9 | 2020-12-09 12:56:27 +0000 | [diff] [blame] | 194 | .. _Gerrit Code Review: https://www.gerritcodereview.com/ |
Paul Beesley | d2fcc4e | 2019-05-29 13:59:40 +0100 | [diff] [blame] | 195 | .. _Linaro Release Notes: https://community.arm.com/dev-platforms/w/docs/226/old-release-notes |
| 196 | .. _Linaro instructions: https://community.arm.com/dev-platforms/w/docs/304/arm-reference-platforms-deliverables |
Daniel Boulby | df83a83 | 2022-05-03 16:46:16 +0100 | [diff] [blame] | 197 | .. _Development Studio (Arm-DS): https://developer.arm.com/Tools%20and%20Software/Arm%20Development%20Studio |
Zelalem | c005fdf | 2021-06-01 17:05:16 -0500 | [diff] [blame] | 198 | .. _Linaro Release 20.01: http://releases.linaro.org/members/arm/platforms/20.01 |