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 1143f35ef5SPaul BeesleyBuild Host 1243f35ef5SPaul Beesley---------- 1343f35ef5SPaul Beesley 1443f35ef5SPaul Beesley|TF-A| can be built using either a Linux or a Windows machine as the build host. 1543f35ef5SPaul Beesley 1643f35ef5SPaul BeesleyA relatively recent Linux distribution is recommended for building |TF-A|. We 170d7e702eSGovindraj Rajahave performed tests using Ubuntu 22.04 LTS (64-bit) but other distributions 1843f35ef5SPaul Beesleyshould also work fine as a base, provided that the necessary tools and libraries 1943f35ef5SPaul Beesleycan be installed. 2043f35ef5SPaul Beesley 2143f35ef5SPaul Beesley.. _prerequisites_toolchain: 2243f35ef5SPaul Beesley 2343f35ef5SPaul BeesleyToolchain 2443f35ef5SPaul Beesley--------- 2543f35ef5SPaul Beesley 2643f35ef5SPaul Beesley|TF-A| can be built with any of the following *cross-compiler* toolchains that 2743f35ef5SPaul Beesleytarget the Armv7-A or Armv8-A architectures: 2843f35ef5SPaul Beesley 298cf07ab3SJayanth Dodderi Chidanand- TF-A has been tested with version 12.3.Rel1 (gcc 12.3) from the `Arm Developer website`_ 30b50838baSBoyan Karatotev 31b50838baSBoyan Karatotev You will need the targets ``arm-none-eabi`` and ``aarch64-none-elf`` for 32b50838baSBoyan Karatotev AArch32 and AArch64 builds respectively. 33b50838baSBoyan Karatotev 34415195c0SBoyan Karatotev- Clang == 14.0.0 35415195c0SBoyan Karatotev- Arm Compiler == 6.18 3643f35ef5SPaul Beesley 3743f35ef5SPaul BeesleyIn addition, a native compiler is required to build the supporting tools. 3843f35ef5SPaul Beesley 3943f35ef5SPaul Beesley.. note:: 40415195c0SBoyan Karatotev Versions greater than the ones specified are likely but not guaranteed to 41415195c0SBoyan Karatotev work. This is predominantly because TF-A carries its own copy of compiler-rt, 42415195c0SBoyan Karatotev which may be older than the version expected by the compiler. Fixes and bug 43415195c0SBoyan Karatotev reports are always welcome. 44415195c0SBoyan Karatotev 45415195c0SBoyan Karatotev.. note:: 4643f35ef5SPaul Beesley The software has also been built on Windows 7 Enterprise SP1, using CMD.EXE, 4743f35ef5SPaul Beesley Cygwin, and Msys (MinGW) shells, using version 5.3.1 of the GNU toolchain. 4843f35ef5SPaul Beesley 4943f35ef5SPaul Beesley.. note:: 5043f35ef5SPaul Beesley For instructions on how to select the cross compiler refer to 5143f35ef5SPaul Beesley :ref:`Performing an Initial Build`. 5243f35ef5SPaul Beesley 5343f35ef5SPaul Beesley.. _prerequisites_software_and_libraries: 5443f35ef5SPaul Beesley 5543f35ef5SPaul BeesleySoftware and Libraries 5643f35ef5SPaul Beesley---------------------- 5743f35ef5SPaul Beesley 5843f35ef5SPaul BeesleyThe following tools are required to obtain and build |TF-A|: 5943f35ef5SPaul Beesley 6043f35ef5SPaul Beesley- An appropriate toolchain (see :ref:`prerequisites_toolchain`) 6143f35ef5SPaul Beesley- GNU Make 6243f35ef5SPaul Beesley- Git 6343f35ef5SPaul Beesley 6443f35ef5SPaul BeesleyThe following libraries must be available to build one or more components or 6543f35ef5SPaul Beesleysupporting tools: 6643f35ef5SPaul Beesley 67cf2dd17dSJuan Pablo Conde- OpenSSL >= 1.1.1 (v3.0.0 to v3.0.6 highly discouraged due to security issues) 6843f35ef5SPaul Beesley 69cf2dd17dSJuan Pablo Conde Required to build the cert_create, encrypt_fw, and fiptool tools. 7043f35ef5SPaul Beesley 718caf10acSJuan Pablo Conde .. note:: 728caf10acSJuan Pablo Conde 73cf2dd17dSJuan Pablo Conde If using OpenSSL 3, older Linux versions may require it to be built from 74cf2dd17dSJuan Pablo Conde source code, as it may not be available in the default package repositories. 75cf2dd17dSJuan Pablo Conde Please refer to the OpenSSL project documentation for more information. 768caf10acSJuan Pablo Conde 775cae3373SSandrine BailleuxThe following libraries are required for Trusted Board Boot and Measured Boot 785cae3373SSandrine Bailleuxsupport: 7943f35ef5SPaul Beesley 80e686cdb4SSandrine Bailleux- mbed TLS == 3.4.1 (tag: ``mbedtls-3.4.1``) 8143f35ef5SPaul Beesley 82*c19977beSTamas BanThe following libraries are required for DICE Protection Environment support: 83*c19977beSTamas Ban 84*c19977beSTamas Ban- QCBOR == 1.2 (tag: ``v1.2``) 85*c19977beSTamas Ban 8643f35ef5SPaul BeesleyThese tools are optional: 8743f35ef5SPaul Beesley 880d7e702eSGovindraj Raja- Device Tree Compiler (DTC) >= 1.4.7 8943f35ef5SPaul Beesley 9043f35ef5SPaul Beesley Needed if you want to rebuild the provided Flattened Device Tree (FDT) 9143f35ef5SPaul Beesley source files (``.dts`` files). DTC is available for Linux through the package 9243f35ef5SPaul Beesley repositories of most distributions. 9343f35ef5SPaul Beesley 944466cf82SDaniel Boulby- Arm `Development Studio (Arm-DS)`_ 9543f35ef5SPaul Beesley 9643f35ef5SPaul Beesley The standard software package used for debugging software on Arm development 9743f35ef5SPaul Beesley platforms and |FVP| models. 9843f35ef5SPaul Beesley 9935cc497dSChris Kay- Node.js >= 16 100ba39362fSChris Kay 101ba39362fSChris Kay Highly recommended, and necessary in order to install and use the packaged 102ba39362fSChris Kay Git hooks and helper tools. Without these tools you will need to rely on the 103ba39362fSChris Kay CI for feedback on commit message conformance. 104ba39362fSChris Kay 105793f72c0SHarrison Mutai- Poetry >= 1.3.2 106793f72c0SHarrison Mutai 107793f72c0SHarrison Mutai Required for managing Python dependencies, this will allow you to reliably 108793f72c0SHarrison Mutai reproduce a Python environment to build documentation and run analysis tools. 109793f72c0SHarrison Mutai Most importantly, it ensures your system environment will not be affected by 110793f72c0SHarrison Mutai dependencies in the Python scripts. 111793f72c0SHarrison Mutai 11243f35ef5SPaul BeesleyPackage Installation (Linux) 11343f35ef5SPaul Beesley^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 11443f35ef5SPaul Beesley 11543f35ef5SPaul BeesleyIf you are using the recommended Ubuntu distribution then you can install the 11643f35ef5SPaul Beesleyrequired packages with the following command: 11743f35ef5SPaul Beesley 11843f35ef5SPaul Beesley.. code:: shell 11943f35ef5SPaul Beesley 1208caf10acSJuan Pablo Conde sudo apt install build-essential git 12143f35ef5SPaul Beesley 12243f35ef5SPaul BeesleyThe optional packages can be installed using: 12343f35ef5SPaul Beesley 12443f35ef5SPaul Beesley.. code:: shell 12543f35ef5SPaul Beesley 12643f35ef5SPaul Beesley sudo apt install device-tree-compiler 12743f35ef5SPaul Beesley 12810c969c5SChris KayAdditionally, to install a version of Node.js compatible with TF-A's repository 12910c969c5SChris Kayscripts, you can use the `Node Version Manager`_. To install both NVM and an 13010c969c5SChris Kayappropriate version of Node.js, run the following **from the root directory of 13110c969c5SChris Kaythe repository**: 132ba39362fSChris Kay 133ba39362fSChris Kay.. code:: shell 134ba39362fSChris Kay 13510c969c5SChris Kay curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash 13610c969c5SChris Kay exec "$SHELL" -ic "nvm install; exec $SHELL" 137ba39362fSChris Kay 138ba39362fSChris Kay.. _Node Version Manager: https://github.com/nvm-sh/nvm#install--update-script 139ba39362fSChris Kay 14043f35ef5SPaul BeesleySupporting Files 14143f35ef5SPaul Beesley---------------- 14243f35ef5SPaul Beesley 14343f35ef5SPaul BeesleyTF-A has been tested with pre-built binaries and file systems from `Linaro 14499a99eb4SZelalemRelease 20.01`_. Alternatively, you can build the binaries from source using 14543f35ef5SPaul Beesleyinstructions in :ref:`Performing an Initial Build`. 14643f35ef5SPaul Beesley 14743f35ef5SPaul Beesley.. _prerequisites_get_source: 14843f35ef5SPaul Beesley 14943f35ef5SPaul BeesleyGetting the TF-A Source 15043f35ef5SPaul Beesley----------------------- 15143f35ef5SPaul Beesley 15243f35ef5SPaul BeesleySource code for |TF-A| is maintained in a Git repository hosted on 15343f35ef5SPaul BeesleyTrustedFirmware.org. To clone this repository from the server, run the following 15443f35ef5SPaul Beesleyin your shell: 15543f35ef5SPaul Beesley 15643f35ef5SPaul Beesley.. code:: shell 15743f35ef5SPaul Beesley 158ba39362fSChris Kay git clone "https://review.trustedfirmware.org/TF-A/trusted-firmware-a" 15943f35ef5SPaul Beesley 160ba39362fSChris KayAdditional Steps for Contributors 161ba39362fSChris Kay^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 16243f35ef5SPaul Beesley 163ba39362fSChris KayIf you are planning on contributing back to TF-A, there are some things you'll 164ba39362fSChris Kaywant to know. 16543f35ef5SPaul Beesley 166ba39362fSChris KayTF-A is hosted by a `Gerrit Code Review`_ server. Gerrit requires that all 167ba39362fSChris Kaycommits include a ``Change-Id`` footer, and this footer is typically 168ba39362fSChris Kayautomatically generated by a Git hook installed by you, the developer. 169ba39362fSChris Kay 170ba39362fSChris KayIf you have Node.js installed already, you can automatically install this hook, 171ba39362fSChris Kayalong with any additional hooks and Javascript-based tooling that we use, by 172ba39362fSChris Kayrunning from within your newly-cloned repository: 17343f35ef5SPaul Beesley 17443f35ef5SPaul Beesley.. code:: shell 17543f35ef5SPaul Beesley 176a4371d1cSChris Kay npm install --no-save 177ba39362fSChris Kay 178ba39362fSChris KayIf you have opted **not** to install Node.js, you can install the Gerrit hook 179ba39362fSChris Kaymanually by running: 180ba39362fSChris Kay 181ba39362fSChris Kay.. code:: shell 182ba39362fSChris Kay 183ba39362fSChris Kay curl -Lo $(git rev-parse --git-dir)/hooks/commit-msg https://review.trustedfirmware.org/tools/hooks/commit-msg 184ba39362fSChris Kay chmod +x $(git rev-parse --git-dir)/hooks/commit-msg 185ba39362fSChris Kay 186ba39362fSChris KayYou can read more about Git hooks in the *githooks* page of the Git 187ba39362fSChris Kaydocumentation, available `here <https://git-scm.com/docs/githooks>`_. 18843f35ef5SPaul Beesley 18943f35ef5SPaul Beesley-------------- 19043f35ef5SPaul Beesley 191*c19977beSTamas Ban*Copyright (c) 2021-2024, Arm Limited. All rights reserved.* 19243f35ef5SPaul Beesley 19371a5543bSSandrine Bailleux.. _Arm Developer website: https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/downloads 194ba39362fSChris Kay.. _Gerrit Code Review: https://www.gerritcodereview.com/ 19543f35ef5SPaul Beesley.. _Linaro Release Notes: https://community.arm.com/dev-platforms/w/docs/226/old-release-notes 19643f35ef5SPaul Beesley.. _Linaro instructions: https://community.arm.com/dev-platforms/w/docs/304/arm-reference-platforms-deliverables 1974466cf82SDaniel Boulby.. _Development Studio (Arm-DS): https://developer.arm.com/Tools%20and%20Software/Arm%20Development%20Studio 19899a99eb4SZelalem.. _Linaro Release 20.01: http://releases.linaro.org/members/arm/platforms/20.01 199