14f6ad66aSAchin Gupta# 2c3273703SChris Kay# Copyright (c) 2013-2025, Arm Limited and Contributors. All rights reserved. 34f6ad66aSAchin Gupta# 482cb2c1aSdp-arm# SPDX-License-Identifier: BSD-3-Clause 54f6ad66aSAchin Gupta# 64f6ad66aSAchin Gupta 7e35c4045SJeenu Viswambharan# 8aaa3e722SJuan Castillo# Trusted Firmware Version 9aaa3e722SJuan Castillo# 101a0f1121SSoby MathewVERSION_MAJOR := 2 1197a6de9eSGovindraj RajaVERSION_MINOR := 13 12c25d1ccfSYann Gautier# VERSION_PATCH is only used for LTS releases 13c25d1ccfSYann GautierVERSION_PATCH := 0 14055ebecaSYann GautierVERSION := ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH} 15aaa3e722SJuan Castillo 1688154678SJuan Castillo# Default goal is build all images 1788154678SJuan Castillo.DEFAULT_GOAL := all 1888154678SJuan Castillo 1972fc70edSDouglas Raillard# Avoid any implicit propagation of command line variable definitions to 2072fc70edSDouglas Raillard# sub-Makefiles, like CFLAGS that we reserved for the firmware images' 2172fc70edSDouglas Raillard# usage. Other command line options like "-s" are still propagated as usual. 2272fc70edSDouglas RaillardMAKEOVERRIDES = 2372fc70edSDouglas Raillard 24231c1470SEvan LloydMAKE_HELPERS_DIRECTORY := make_helpers/ 25231c1470SEvan Lloydinclude ${MAKE_HELPERS_DIRECTORY}build_macros.mk 26f4dd18c2SChris Kayinclude ${MAKE_HELPERS_DIRECTORY}build-rules.mk 277c4e1eeaSChris Kayinclude ${MAKE_HELPERS_DIRECTORY}common.mk 2873c99d4eSJuan Castillo 2973c99d4eSJuan Castillo################################################################################ 302fae4b1eSJeenu Viswambharan# Default values for build configurations, and their dependencies 3173c99d4eSJuan Castillo################################################################################ 32e35c4045SJeenu Viswambharan 332fae4b1eSJeenu Viswambharaninclude ${MAKE_HELPERS_DIRECTORY}defaults.mk 3428973741SBoyan Karatotev# Include the CPU specific operations makefile, which provides default 3528973741SBoyan Karatotev# values for all CPU errata workarounds and CPU specific optimisations. 3628973741SBoyan Karatotev# This can be overridden by the platform. 3728973741SBoyan Karatotevinclude lib/cpus/cpu-ops.mk 3828973741SBoyan Karatotev 39422b181fSYann GautierPLAT := ${DEFAULT_PLAT} 401b2fb6adSAndrey Skvortsovinclude ${MAKE_HELPERS_DIRECTORY}plat_helpers.mk 411b2fb6adSAndrey Skvortsov 421b2fb6adSAndrey Skvortsov# To be able to set platform specific defaults 431b2fb6adSAndrey Skvortsovifneq ($(PLAT_DEFAULTS_MAKEFILE_FULL),) 441b2fb6adSAndrey Skvortsovinclude ${PLAT_DEFAULTS_MAKEFILE_FULL} 451b2fb6adSAndrey Skvortsovendif 46872be88aSdp-arm 47cc277de8SChris Kay################################################################################ 48cc277de8SChris Kay# Configure the toolchains used to build TF-A and its tools 49cc277de8SChris Kay################################################################################ 50cc277de8SChris Kay 51cc277de8SChris Kayinclude ${MAKE_HELPERS_DIRECTORY}toolchain.mk 52cc277de8SChris Kay 53cc8b5632SAntonio Nino Diaz# Assertions enabled for DEBUG builds by default 54cc8b5632SAntonio Nino DiazENABLE_ASSERTIONS := ${DEBUG} 552fae4b1eSJeenu ViswambharanENABLE_PMF := ${ENABLE_RUNTIME_INSTRUMENTATION} 5673c99d4eSJuan Castillo 5773c99d4eSJuan Castillo################################################################################ 5873c99d4eSJuan Castillo# Checkpatch script options 5973c99d4eSJuan Castillo################################################################################ 6073c99d4eSJuan Castillo 61f607739cSSandrine BailleuxCHECKCODE_ARGS := --no-patch 62f0b489c1SDan Handley# Do not check the coding style on imported library files or documentation files 634501843fSGilad Ben-YossefINC_DRV_DIRS_TO_CHECK := $(sort $(filter-out \ 644501843fSGilad Ben-Yossef include/drivers/arm, \ 654501843fSGilad Ben-Yossef $(wildcard include/drivers/*))) 66f0b489c1SDan HandleyINC_LIB_DIRS_TO_CHECK := $(sort $(filter-out \ 671a41e8c1SDan Handley include/lib/libfdt \ 6861f72a34SRoberto Vargas include/lib/libc, \ 69f0b489c1SDan Handley $(wildcard include/lib/*))) 70f0b489c1SDan HandleyINC_DIRS_TO_CHECK := $(sort $(filter-out \ 714501843fSGilad Ben-Yossef include/lib \ 724501843fSGilad Ben-Yossef include/drivers, \ 73f0b489c1SDan Handley $(wildcard include/*))) 74f0b489c1SDan HandleyLIB_DIRS_TO_CHECK := $(sort $(filter-out \ 75d801fbb0Sdp-arm lib/compiler-rt \ 7655cdcf75SAntonio Nino Diaz lib/libfdt% \ 7761f72a34SRoberto Vargas lib/libc, \ 78a194255dSDaniel Boulby lib/zlib \ 79f0b489c1SDan Handley $(wildcard lib/*))) 80f0b489c1SDan HandleyROOT_DIRS_TO_CHECK := $(sort $(filter-out \ 81f0b489c1SDan Handley lib \ 82f0b489c1SDan Handley include \ 83f0b489c1SDan Handley docs \ 841ef35512SPaul Beesley %.rst, \ 85f0b489c1SDan Handley $(wildcard *))) 86f0b489c1SDan HandleyCHECK_PATHS := ${ROOT_DIRS_TO_CHECK} \ 87f0b489c1SDan Handley ${INC_DIRS_TO_CHECK} \ 88f0b489c1SDan Handley ${INC_LIB_DIRS_TO_CHECK} \ 894501843fSGilad Ben-Yossef ${LIB_DIRS_TO_CHECK} \ 904501843fSGilad Ben-Yossef ${INC_DRV_DIRS_TO_CHECK} \ 914501843fSGilad Ben-Yossef ${INC_ARM_DIRS_TO_CHECK} 9236eaaf37SIan Spray 9373c99d4eSJuan Castillo################################################################################ 9473c99d4eSJuan Castillo# Process build options 9573c99d4eSJuan Castillo################################################################################ 9673c99d4eSJuan Castillo 977c4e1eeaSChris Kayifeq ($(verbose),) 9836eaaf37SIan Spray CHECKCODE_ARGS += --no-summary --terse 994f6ad66aSAchin Guptaendif 100ee1ba6d4SAndre Przywara 10173c99d4eSJuan Castillo################################################################################ 102c5e1da83SJayanth Dodderi Chidanand# Auxiliary tools (fiptool, cert_create, etc) 103c5e1da83SJayanth Dodderi Chidanand################################################################################ 104c5e1da83SJayanth Dodderi Chidanand 105c5e1da83SJayanth Dodderi Chidanand# Variables for use with Certificate Generation Tool 106c5e1da83SJayanth Dodderi ChidanandCRTTOOLPATH ?= tools/cert_create 107f4595e6eSBoyan KaratotevCRTTOOL ?= ${BUILD_PLAT}/${CRTTOOLPATH}/cert_create$(.exe) 108c5e1da83SJayanth Dodderi Chidanand 109c5e1da83SJayanth Dodderi Chidanand# Variables for use with Firmware Encryption Tool 110c5e1da83SJayanth Dodderi ChidanandENCTOOLPATH ?= tools/encrypt_fw 11196fbe884SBoyan KaratotevENCTOOL ?= ${BUILD_PLAT}/${ENCTOOLPATH}/encrypt_fw$(.exe) 112c5e1da83SJayanth Dodderi Chidanand 113c5e1da83SJayanth Dodderi Chidanand# Variables for use with Firmware Image Package 114c5e1da83SJayanth Dodderi ChidanandFIPTOOLPATH ?= tools/fiptool 115cbd6cec3SBoyan KaratotevFIPTOOL ?= ${BUILD_PLAT}/${FIPTOOLPATH}/fiptool$(.exe) 116c5e1da83SJayanth Dodderi Chidanand 117c5e1da83SJayanth Dodderi Chidanand# Variables for use with sptool 118c5e1da83SJayanth Dodderi ChidanandSPTOOLPATH ?= tools/sptool 119c5e1da83SJayanth Dodderi ChidanandSPTOOL ?= ${SPTOOLPATH}/sptool.py 120c5e1da83SJayanth Dodderi ChidanandSP_MK_GEN ?= ${SPTOOLPATH}/sp_mk_generator.py 12120629b31SKarl MeakinSP_DTS_LIST_FRAGMENT ?= ${BUILD_PLAT}/sp_list_fragment.dts 122c5e1da83SJayanth Dodderi Chidanand 1230fe374efSJ-Alves# Variables for use with sptool 1240fe374efSJ-AlvesTLCTOOL ?= poetry run tlc 1250fe374efSJ-Alves 126c5e1da83SJayanth Dodderi Chidanand# Variables for use with ROMLIB 127c5e1da83SJayanth Dodderi ChidanandROMLIBPATH ?= lib/romlib 128c5e1da83SJayanth Dodderi Chidanand 129c5e1da83SJayanth Dodderi Chidanand# Variable for use with Python 130c5e1da83SJayanth Dodderi ChidanandPYTHON ?= python3 131c5e1da83SJayanth Dodderi Chidanand 132c5e1da83SJayanth Dodderi Chidanand# Variables for use with documentation build using Sphinx tool 133c5e1da83SJayanth Dodderi ChidanandDOCS_PATH ?= docs 134c5e1da83SJayanth Dodderi Chidanand 13532b209bfSAhmad Fatoum# Process Debug flag 13632b209bfSAhmad Fatoumifneq (${DEBUG}, 0) 13732b209bfSAhmad Fatoum BUILD_TYPE := debug 13832b209bfSAhmad Fatoum # Use LOG_LEVEL_INFO by default for debug builds 13932b209bfSAhmad Fatoum LOG_LEVEL := 40 14032b209bfSAhmad Fatoumelse 14132b209bfSAhmad Fatoum BUILD_TYPE := release 14232b209bfSAhmad Fatoum # Use LOG_LEVEL_NOTICE by default for release builds 14332b209bfSAhmad Fatoum LOG_LEVEL := 20 144c5e1da83SJayanth Dodderi Chidanandendif #(Debug) 14532b209bfSAhmad Fatoum 146f1de4c8fSPeiyuan Song# Default build string (git branch and commit) 147f1de4c8fSPeiyuan Songifeq (${BUILD_STRING},) 148f1de4c8fSPeiyuan Song BUILD_STRING := $(shell git describe --always --dirty --tags 2> /dev/null) 149f1de4c8fSPeiyuan Songendif 150dddf4283Slaurenw-armVERSION_STRING := v${VERSION}(${BUILD_TYPE}):${BUILD_STRING} 151f1de4c8fSPeiyuan Song 152d75a9ecdSBoyan Karatotev# Setting W is quite verbose and most warnings will be pre-existing issues 153d75a9ecdSBoyan Karatotev# outside of the contributor's control. Don't fail the build on them so warnings 154d75a9ecdSBoyan Karatotev# can be seen and hopefully addressed 155d75a9ecdSBoyan Karatotevifdef W 156d75a9ecdSBoyan Karatotev ifneq (${W},0) 157d75a9ecdSBoyan Karatotev E ?= 0 158d75a9ecdSBoyan Karatotev endif 159d75a9ecdSBoyan Karatotevendif 160d75a9ecdSBoyan Karatotev 16173c99d4eSJuan Castillo################################################################################ 162f5211420SGovindraj Raja# Setup ARCH_MAJOR/MINOR before parsing arch_features. 163f5211420SGovindraj Raja################################################################################ 164f5211420SGovindraj Rajaifeq (${ENABLE_RME},1) 1657d5fc98fSAlexeiFedorov ARM_ARCH_MAJOR := 9 1667d5fc98fSAlexeiFedorov ARM_ARCH_MINOR := 2 167f5211420SGovindraj Rajaendif 168f5211420SGovindraj Raja 169f5211420SGovindraj Raja################################################################################ 17073c99d4eSJuan Castillo# Common sources and include directories 17173c99d4eSJuan Castillo################################################################################ 172d801fbb0Sdp-arminclude lib/compiler-rt/compiler-rt.mk 17373c99d4eSJuan Castillo 174758ccb80SChris Kay# Allow overriding the timestamp, for example for reproducible builds, or to 175758ccb80SChris Kay# synchronize timestamps across multiple projects. 176758ccb80SChris Kay# This must be set to a C string (including quotes where applicable). 177758ccb80SChris KayBUILD_MESSAGE_TIMESTAMP ?= __TIME__", "__DATE__ 178758ccb80SChris Kay 179758ccb80SChris KayDEFINES += -DBUILD_MESSAGE_TIMESTAMP='$(BUILD_MESSAGE_TIMESTAMP)' 180758ccb80SChris KayDEFINES += -DBUILD_MESSAGE_VERSION_STRING='"$(VERSION_STRING)"' 181758ccb80SChris KayDEFINES += -DBUILD_MESSAGE_VERSION='"$(VERSION)"' 182758ccb80SChris Kay 18373c99d4eSJuan CastilloBL_COMMON_SOURCES += common/bl_common.c \ 1847f56e9a3SSoby Mathew common/tf_log.c \ 1859d29c227SSoby Mathew common/${ARCH}/debug.S \ 18691b48c9fSJulius Werner drivers/console/multi_console.c \ 1879d29c227SSoby Mathew lib/${ARCH}/cache_helpers.S \ 1889d29c227SSoby Mathew lib/${ARCH}/misc_helpers.S \ 189c73686a1SBoyan Karatotev lib/extensions/pmuv3/${ARCH}/pmuv3.c \ 190566034fcSSoby Mathew plat/common/plat_bl_common.c \ 1917f56e9a3SSoby Mathew plat/common/plat_log_common.c \ 19275311203Sdp-arm plat/common/${ARCH}/plat_common.c \ 1939d29c227SSoby Mathew plat/common/${ARCH}/platform_helpers.S \ 19461f72a34SRoberto Vargas ${COMPILER_RT_SRCS} 195d7a6b0f8SRyan Harkin 1968620bd0bSChris Kayifeq ($($(ARCH)-cc-id),arm-clang) 1978422a840SAntonio Nino Diaz BL_COMMON_SOURCES += lib/${ARCH}/armclang_printf.S 1988422a840SAntonio Nino Diazendif 1998422a840SAntonio Nino Diaz 2001f461979SJustin Chadwellifeq (${SANITIZE_UB},on) 2011f461979SJustin Chadwell BL_COMMON_SOURCES += plat/common/ubsan.c 2021f461979SJustin Chadwellendif 2031f461979SJustin Chadwell 20401d237cbSYann GautierINCLUDES += -Iinclude \ 205f5478dedSAntonio Nino Diaz -Iinclude/arch/${ARCH} \ 20609d40e0eSAntonio Nino Diaz -Iinclude/lib/cpus/${ARCH} \ 20709d40e0eSAntonio Nino Diaz -Iinclude/lib/el3_runtime/${ARCH} \ 20809d40e0eSAntonio Nino Diaz ${PLAT_INCLUDES} \ 20909d40e0eSAntonio Nino Diaz ${SPD_INCLUDES} 21009d40e0eSAntonio Nino Diaz 2119c6d1c50SAntonio Nino Diazinclude common/backtrace/backtrace.mk 2129c6d1c50SAntonio Nino Diaz 21373c99d4eSJuan Castillo################################################################################ 2143547270fSGovindraj Raja# Generic definitions 2153547270fSGovindraj Raja################################################################################ 2163547270fSGovindraj Raja 2173547270fSGovindraj Rajaifeq (${BUILD_BASE},) 2183547270fSGovindraj Raja BUILD_BASE := ./build 2193547270fSGovindraj Rajaendif 2203547270fSGovindraj RajaBUILD_PLAT := $(abspath ${BUILD_BASE})/${PLAT}/${BUILD_TYPE} 2213547270fSGovindraj Raja 2223547270fSGovindraj RajaSPDS := $(sort $(filter-out none, $(patsubst services/spd/%,%,$(wildcard services/spd/*)))) 2233547270fSGovindraj Raja 2243547270fSGovindraj Raja# Platforms providing their own TBB makefile may override this value 2253547270fSGovindraj RajaINCLUDE_TBBR_MK := 1 2263547270fSGovindraj Raja 2273547270fSGovindraj Raja################################################################################ 2283547270fSGovindraj Raja# Include SPD Makefile if one has been specified 2293547270fSGovindraj Raja################################################################################ 2303547270fSGovindraj Raja 2313547270fSGovindraj Rajaifneq (${SPD},none) 2323547270fSGovindraj Raja ifeq (${SPD},spmd) 2333547270fSGovindraj Raja # SPMD is located in std_svc directory 2343547270fSGovindraj Raja SPD_DIR := std_svc 2353547270fSGovindraj Raja 2363547270fSGovindraj Raja ifeq ($(SPMD_SPM_AT_SEL2),1) 2373547270fSGovindraj Raja CTX_INCLUDE_EL2_REGS := 1 2383547270fSGovindraj Raja endif 2393547270fSGovindraj Raja 2403547270fSGovindraj Raja ifneq ($(SP_LAYOUT_FILE),) 2413547270fSGovindraj Raja BL2_ENABLE_SP_LOAD := 1 2423547270fSGovindraj Raja endif 2433547270fSGovindraj Raja else 2443547270fSGovindraj Raja # All other SPDs in spd directory 2453547270fSGovindraj Raja SPD_DIR := spd 2463547270fSGovindraj Raja endif #(SPD) 2473547270fSGovindraj Raja 2483547270fSGovindraj Raja # We expect to locate an spd.mk under the specified SPD directory 2493547270fSGovindraj Raja SPD_MAKE := $(wildcard services/${SPD_DIR}/${SPD}/${SPD}.mk) 2503547270fSGovindraj Raja 2513547270fSGovindraj Raja ifeq (${SPD_MAKE},) 2523547270fSGovindraj Raja $(error Error: No services/${SPD_DIR}/${SPD}/${SPD}.mk located) 2533547270fSGovindraj Raja endif 2543547270fSGovindraj Raja $(info Including ${SPD_MAKE}) 2553547270fSGovindraj Raja include ${SPD_MAKE} 2563547270fSGovindraj Raja 2573547270fSGovindraj Raja # If there's BL32 companion for the chosen SPD, we expect that the SPD's 2583547270fSGovindraj Raja # Makefile would set NEED_BL32 to "yes". In this case, the build system 2593547270fSGovindraj Raja # supports two mutually exclusive options: 2603547270fSGovindraj Raja # * BL32 is built from source: then BL32_SOURCES must contain the list 2613547270fSGovindraj Raja # of source files to build BL32 2623547270fSGovindraj Raja # * BL32 is a prebuilt binary: then BL32 must point to the image file 2633547270fSGovindraj Raja # that will be included in the FIP 2643547270fSGovindraj Raja # If both BL32_SOURCES and BL32 are defined, the binary takes precedence 2653547270fSGovindraj Raja # over the sources. 2663547270fSGovindraj Rajaendif #(SPD=none) 2673547270fSGovindraj Raja 2683547270fSGovindraj Raja################################################################################ 269696ed168SOlivier Deprez# Include the platform specific Makefile after the SPD Makefile (the platform 270696ed168SOlivier Deprez# makefile may use all previous definitions in this file) 271696ed168SOlivier Deprez################################################################################ 272696ed168SOlivier Deprezinclude ${PLAT_MAKEFILE_FULL} 273696ed168SOlivier Deprez 274696ed168SOlivier Deprez################################################################################ 2758d9f5f25SBoyan Karatotev# Setup arch_features based on ARM_ARCH_MAJOR, ARM_ARCH_MINOR provided from 2768d9f5f25SBoyan Karatotev# platform. 2778d9f5f25SBoyan Karatotev################################################################################ 2788d9f5f25SBoyan Karatotev 2798d9f5f25SBoyan Karatotevinclude ${MAKE_HELPERS_DIRECTORY}arch_features.mk 2808d9f5f25SBoyan Karatotev################################################################################ 281f5211420SGovindraj Raja# Process BRANCH_PROTECTION value and set 282f5211420SGovindraj Raja# Pointer Authentication and Branch Target Identification flags 283f5211420SGovindraj Raja################################################################################ 284f5211420SGovindraj Rajaifeq (${BRANCH_PROTECTION},0) 285f5211420SGovindraj Raja # Default value turns off all types of branch protection 286f5211420SGovindraj Raja BP_OPTION := none 287f5211420SGovindraj Rajaelse ifneq (${ARCH},aarch64) 288f5211420SGovindraj Raja $(error BRANCH_PROTECTION requires AArch64) 289f5211420SGovindraj Rajaelse ifeq (${BRANCH_PROTECTION},1) 290f5211420SGovindraj Raja # Enables all types of branch protection features 291f5211420SGovindraj Raja BP_OPTION := standard 292f5211420SGovindraj Raja ENABLE_BTI := 1 293f5211420SGovindraj Raja ENABLE_PAUTH := 1 294f5211420SGovindraj Rajaelse ifeq (${BRANCH_PROTECTION},2) 295f5211420SGovindraj Raja # Return address signing to its standard level 296f5211420SGovindraj Raja BP_OPTION := pac-ret 297f5211420SGovindraj Raja ENABLE_PAUTH := 1 298f5211420SGovindraj Rajaelse ifeq (${BRANCH_PROTECTION},3) 299f5211420SGovindraj Raja # Extend the signing to include leaf functions 300f5211420SGovindraj Raja BP_OPTION := pac-ret+leaf 301f5211420SGovindraj Raja ENABLE_PAUTH := 1 302f5211420SGovindraj Rajaelse ifeq (${BRANCH_PROTECTION},4) 303f5211420SGovindraj Raja # Turn on branch target identification mechanism 304f5211420SGovindraj Raja BP_OPTION := bti 305f5211420SGovindraj Raja ENABLE_BTI := 1 3068d9f5f25SBoyan Karatotevelse ifeq (${BRANCH_PROTECTION},5) 3078d9f5f25SBoyan Karatotev # Turn on branch target identification mechanism 3088d9f5f25SBoyan Karatotev BP_OPTION := standard 3098d9f5f25SBoyan Karatotev ENABLE_BTI := 2 3108d9f5f25SBoyan Karatotev ENABLE_PAUTH := 2 311f5211420SGovindraj Rajaelse 312f5211420SGovindraj Raja $(error Unknown BRANCH_PROTECTION value ${BRANCH_PROTECTION}) 313f5211420SGovindraj Rajaendif #(BRANCH_PROTECTION) 314f5211420SGovindraj Raja 3158d9f5f25SBoyan Karatotevifneq ($(ENABLE_PAUTH),0) 3168d9f5f25SBoyan Karatotev CTX_INCLUDE_PAUTH_REGS := ${ENABLE_PAUTH} 317f5211420SGovindraj Rajaendif 318f5211420SGovindraj Raja 319f5211420SGovindraj Raja# Pointer Authentication sources 3208d9f5f25SBoyan Karatotevifneq (${ENABLE_PAUTH},0) 321f5211420SGovindraj Raja# arm/common/aarch64/arm_pauth.c contains a sample platform hook to complete the 322f5211420SGovindraj Raja# Pauth support. As it's not secure, it must be reimplemented for real platforms 3238d9f5f25SBoyan Karatotev BL_COMMON_SOURCES += lib/extensions/pauth/pauth.c 324f5211420SGovindraj Rajaendif 325f5211420SGovindraj Raja 326f5211420SGovindraj Raja################################################################################ 327f5211420SGovindraj Raja# RME dependent flags configuration, Enable optional features for RME. 328f5211420SGovindraj Raja################################################################################ 329f5211420SGovindraj Raja# FEAT_RME 330f5211420SGovindraj Rajaifeq (${ENABLE_RME},1) 331f5211420SGovindraj Raja # RME requires el2 context to be saved for now. 332f5211420SGovindraj Raja CTX_INCLUDE_EL2_REGS := 1 333f5211420SGovindraj Raja CTX_INCLUDE_AARCH32_REGS := 0 334f5211420SGovindraj Raja CTX_INCLUDE_PAUTH_REGS := 1 335f5211420SGovindraj Raja 336d048af0dSJavier Almansa Sobrino ifneq ($(ENABLE_FEAT_MPAM), 0) 337d048af0dSJavier Almansa Sobrino CTX_INCLUDE_MPAM_REGS := 1 338d048af0dSJavier Almansa Sobrino endif 339d048af0dSJavier Almansa Sobrino 340f5211420SGovindraj Raja # RME enables CSV2_2 extension by default. 341f5211420SGovindraj Raja ENABLE_FEAT_CSV2_2 = 1 342f5211420SGovindraj Rajaendif #(FEAT_RME) 343f5211420SGovindraj Raja 344f5211420SGovindraj Raja################################################################################ 3455b18de09SZelalem Aweke# Include rmmd Makefile if RME is enabled 3465b18de09SZelalem Aweke################################################################################ 3475b18de09SZelalem Awekeifneq (${ENABLE_RME},0) 3485b18de09SZelalem Awekeinclude services/std_svc/rmmd/rmmd.mk 3495b18de09SZelalem Aweke$(warning "RME is an experimental feature") 3505b18de09SZelalem Awekeendif 3515b18de09SZelalem Aweke 3527e84f3cfSTushar Khandelwal################################################################################ 35330655136SGovindraj Raja# Make 128-Bit sysreg read/writes availabe when FEAT_D128 is enabled. 35430655136SGovindraj Raja################################################################################ 35530655136SGovindraj Rajaifneq (${ENABLE_FEAT_D128}, 0) 35630655136SGovindraj Raja BL_COMMON_SOURCES += lib/extensions/sysreg128/sysreg128.S 35730655136SGovindraj Rajaendif 35830655136SGovindraj Raja 35942d4d3baSArvind Ram Prakash# This internal flag is common option which is set to 1 for scenarios 36042d4d3baSArvind Ram Prakash# when the BL2 is running in EL3 level. This occurs in two scenarios - 36142d4d3baSArvind Ram Prakash# 4 world system running BL2 at EL3 and two world system without BL1 running 36242d4d3baSArvind Ram Prakash# BL2 in EL3 36342d4d3baSArvind Ram Prakash 36442d4d3baSArvind Ram Prakashifeq (${RESET_TO_BL2},1) 36542d4d3baSArvind Ram Prakash BL2_RUNS_AT_EL3 := 1 36642d4d3baSArvind Ram Prakash ifeq (${ENABLE_RME},1) 367c5e1da83SJayanth Dodderi Chidanand $(error RESET_TO_BL2=1 and ENABLE_RME=1 configuration is not \ 368c5e1da83SJayanth Dodderi Chidanand supported at the moment.) 36942d4d3baSArvind Ram Prakash endif 37042d4d3baSArvind Ram Prakashelse ifeq (${ENABLE_RME},1) 37142d4d3baSArvind Ram Prakash BL2_RUNS_AT_EL3 := 1 37242d4d3baSArvind Ram Prakashelse 37342d4d3baSArvind Ram Prakash BL2_RUNS_AT_EL3 := 0 37442d4d3baSArvind Ram Prakashendif 37542d4d3baSArvind Ram Prakash 376f87e54f7SManish Pandey# This internal flag is set to 1 when Firmware First handling of External aborts 377f87e54f7SManish Pandey# is required by lowe ELs. Currently only NS requires this support. 378f87e54f7SManish Pandeyifeq ($(HANDLE_EA_EL3_FIRST_NS),1) 379f87e54f7SManish Pandey FFH_SUPPORT := 1 380f87e54f7SManish Pandeyelse 381f87e54f7SManish Pandey FFH_SUPPORT := 0 382f87e54f7SManish Pandeyendif 383f87e54f7SManish Pandey 384a4409008Sdp-arm################################################################################ 385a4409008Sdp-arm# Build `AARCH32_SP` as BL32 image for AArch32 386a4409008Sdp-arm################################################################################ 387c5e1da83SJayanth Dodderi Chidanandifeq (${ARCH},aarch32) 388c5e1da83SJayanth Dodderi Chidanand NEED_BL32 := yes 389c5e1da83SJayanth Dodderi Chidanand 390a4409008Sdp-arm ifneq (${AARCH32_SP},none) 391a4409008Sdp-arm # We expect to locate an sp.mk under the specified AARCH32_SP directory 392a4409008Sdp-arm AARCH32_SP_MAKE := $(wildcard bl32/${AARCH32_SP}/${AARCH32_SP}.mk) 393a4409008Sdp-arm 394a4409008Sdp-arm ifeq (${AARCH32_SP_MAKE},) 395a4409008Sdp-arm $(error Error: No bl32/${AARCH32_SP}/${AARCH32_SP}.mk located) 396a4409008Sdp-arm endif 397a4409008Sdp-arm $(info Including ${AARCH32_SP_MAKE}) 398a4409008Sdp-arm include ${AARCH32_SP_MAKE} 399a4409008Sdp-arm endif 400c5e1da83SJayanth Dodderi Chidanandendif #(ARCH=aarch32) 4014f6ad66aSAchin Gupta 40273c99d4eSJuan Castillo################################################################################ 40377f1f7a1SVarun Wadekar# Include libc if not overridden 40477f1f7a1SVarun Wadekar################################################################################ 40577f1f7a1SVarun Wadekarifeq (${OVERRIDE_LIBC},0) 40677f1f7a1SVarun Wadekarinclude lib/libc/libc.mk 40777f1f7a1SVarun Wadekarendif 40877f1f7a1SVarun Wadekar 4095d893410SBoyan Karatotevifneq (${USE_GIC_DRIVER},0) 4105d893410SBoyan Karatotevinclude drivers/arm/gic/gic.mk 4115d893410SBoyan Karatotevendif 4125d893410SBoyan Karatotev 41377f1f7a1SVarun Wadekar################################################################################ 414c5e1da83SJayanth Dodderi Chidanand# Check incompatible options and dependencies 415cf2c8a33SAntonio Nino Diaz################################################################################ 416b14987cfSBoyan Karatotevinclude ${MAKE_HELPERS_DIRECTORY}constraints.mk 417c5e1da83SJayanth Dodderi Chidanand 418c5e1da83SJayanth Dodderi Chidanand# The cert_create tool cannot generate certificates individually, so we use the 419c5e1da83SJayanth Dodderi Chidanand# target 'certificates' to create them all 420c5e1da83SJayanth Dodderi Chidanandifneq (${GENERATE_COT},0) 421c5e1da83SJayanth Dodderi Chidanand FIP_DEPS += certificates 422c5e1da83SJayanth Dodderi Chidanand FWU_FIP_DEPS += fwu_certificates 423d57362bdSXialin Liu BL2_FIP_DEPS += bl2_certificates 424c5e1da83SJayanth Dodderi Chidanandendif 425c5e1da83SJayanth Dodderi Chidanand 426c5e1da83SJayanth Dodderi Chidanandifneq (${DECRYPTION_SUPPORT},none) 427c5e1da83SJayanth Dodderi Chidanand ENC_ARGS += -f ${FW_ENC_STATUS} 428c5e1da83SJayanth Dodderi Chidanand ENC_ARGS += -k ${ENC_KEY} 429c5e1da83SJayanth Dodderi Chidanand ENC_ARGS += -n ${ENC_NONCE} 430c5e1da83SJayanth Dodderi Chidanand FIP_DEPS += enctool 431c5e1da83SJayanth Dodderi Chidanand FWU_FIP_DEPS += enctool 432d57362bdSXialin Liu BL2_FIP_DEPS += enctool 433c5e1da83SJayanth Dodderi Chidanandendif #(DECRYPTION_SUPPORT) 434c5e1da83SJayanth Dodderi Chidanand 435cf2c8a33SAntonio Nino Diaz################################################################################ 43673c99d4eSJuan Castillo# Process platform overrideable behaviour 43773c99d4eSJuan Castillo################################################################################ 4384f6ad66aSAchin Gupta 4395f24ce96SManish Pandeyifdef BL1_SOURCES 4405f24ce96SManish Pandey NEED_BL1 := yes 441c5e1da83SJayanth Dodderi Chidanandendif #(BL1_SOURCES) 4425f24ce96SManish Pandey 4435f24ce96SManish Pandeyifdef BL2_SOURCES 4445f24ce96SManish Pandey NEED_BL2 := yes 4455f24ce96SManish Pandey 446bd97f83aSJohn Tsichritzis # Using BL2 implies that a BL33 image also needs to be supplied for the FIP and 447bd97f83aSJohn Tsichritzis # Certificate generation tools. This flag can be overridden by the platform. 448cf2c8a33SAntonio Nino Diaz ifdef EL3_PAYLOAD_BASE 449cf2c8a33SAntonio Nino Diaz # If booting an EL3 payload there is no need for a BL33 image 450cf2c8a33SAntonio Nino Diaz # in the FIP file. 4514c117f6cSSandrine Bailleux NEED_BL33 := no 452cf2c8a33SAntonio Nino Diaz else 45368450a6dSAntonio Nino Diaz ifdef PRELOADED_BL33_BASE 454cf2c8a33SAntonio Nino Diaz # If booting a BL33 preloaded image there is no need of 455cf2c8a33SAntonio Nino Diaz # another one in the FIP file. 456cf2c8a33SAntonio Nino Diaz NEED_BL33 := no 457cf2c8a33SAntonio Nino Diaz else 458cf2c8a33SAntonio Nino Diaz NEED_BL33 ?= yes 459cf2c8a33SAntonio Nino Diaz endif 4604c117f6cSSandrine Bailleux endif 461c5e1da83SJayanth Dodderi Chidanandendif #(BL2_SOURCES) 4626f971622SJuan Castillo 4635f24ce96SManish Pandeyifdef BL2U_SOURCES 4645f24ce96SManish Pandey NEED_BL2U := yes 465c5e1da83SJayanth Dodderi Chidanandendif #(BL2U_SOURCES) 4665f24ce96SManish Pandey 4674d045d0eSMasahiro Yamada# If SCP_BL2 is given, we always want FIP to include it. 4684d045d0eSMasahiro Yamadaifdef SCP_BL2 4694d045d0eSMasahiro Yamada NEED_SCP_BL2 := yes 470c5e1da83SJayanth Dodderi Chidanandendif #(SCP_BL2) 4714d045d0eSMasahiro Yamada 4725744e874SSoby Mathew# For AArch32, BL31 is not currently supported. 4735744e874SSoby Mathewifneq (${ARCH},aarch32) 4745744e874SSoby Mathew ifdef BL31_SOURCES 475c5e1da83SJayanth Dodderi Chidanand # When booting an EL3 payload, there is no need to compile the BL31 476c5e1da83SJayanth Dodderi Chidanand # image nor put it in the FIP. 4775744e874SSoby Mathew ifndef EL3_PAYLOAD_BASE 4785744e874SSoby Mathew NEED_BL31 := yes 4795744e874SSoby Mathew endif 4805744e874SSoby Mathew endif 481c5e1da83SJayanth Dodderi Chidanandendif #(ARCH=aarch64) 4825744e874SSoby Mathew 48373c99d4eSJuan Castillo# Process TBB related flags 4846f971622SJuan Castilloifneq (${GENERATE_COT},0) 48573c99d4eSJuan Castillo # Common cert_create options 4866f971622SJuan Castillo ifneq (${CREATE_KEYS},0) 4876f971622SJuan Castillo $(eval CRT_ARGS += -n) 4880191262dSYatharth Kochar $(eval FWU_CRT_ARGS += -n) 489d57362bdSXialin Liu $(eval BL2_CRT_ARGS += -n) 490fd34e7baSJuan Castillo ifneq (${SAVE_KEYS},0) 491fd34e7baSJuan Castillo $(eval CRT_ARGS += -k) 4920191262dSYatharth Kochar $(eval FWU_CRT_ARGS += -k) 493d57362bdSXialin Liu $(eval BL2_CRT_ARGS += -k) 494fd34e7baSJuan Castillo endif 4956f971622SJuan Castillo endif 49673c99d4eSJuan Castillo # Include TBBR makefile (unless the platform indicates otherwise) 49773c99d4eSJuan Castillo ifeq (${INCLUDE_TBBR_MK},1) 49873c99d4eSJuan Castillo include make_helpers/tbbr/tbbr_tools.mk 49973c99d4eSJuan Castillo endif 500c5e1da83SJayanth Dodderi Chidanandendif #(GENERATE_COT) 5016f971622SJuan Castillo 5021c75d5dfSMasahiro Yamadaifneq (${FIP_ALIGN},0) 5031c75d5dfSMasahiro Yamada FIP_ARGS += --align ${FIP_ALIGN} 504c5e1da83SJayanth Dodderi Chidanandendif #(FIP_ALIGN) 5051c75d5dfSMasahiro Yamada 5065f24ce96SManish Pandeyifdef FDT_SOURCES 5075f24ce96SManish Pandey NEED_FDT := yes 508c5e1da83SJayanth Dodderi Chidanandendif #(FDT_SOURCES) 5095f24ce96SManish Pandey 51073c99d4eSJuan Castillo################################################################################ 51146e5e035SMichalis Pappas# Include libraries' Makefile that are used in all BL 51246e5e035SMichalis Pappas################################################################################ 51346e5e035SMichalis Pappas 51446e5e035SMichalis Pappasinclude lib/stack_protector/stack_protector.mk 51546e5e035SMichalis Pappas 51646e5e035SMichalis Pappas################################################################################ 5178a86052dSSoby Mathew# Include BL specific makefiles 5188a86052dSSoby Mathew################################################################################ 5195f24ce96SManish Pandey 5205f24ce96SManish Pandeyifeq (${NEED_BL1},yes) 5218a86052dSSoby Mathewinclude bl1/bl1.mk 5228a86052dSSoby Mathewendif 5238a86052dSSoby Mathew 5245f24ce96SManish Pandeyifeq (${NEED_BL2},yes) 5258a86052dSSoby Mathewinclude bl2/bl2.mk 5268a86052dSSoby Mathewendif 5278a86052dSSoby Mathew 5285f24ce96SManish Pandeyifeq (${NEED_BL2U},yes) 5298a86052dSSoby Mathewinclude bl2u/bl2u.mk 5308a86052dSSoby Mathewendif 5318a86052dSSoby Mathew 5325744e874SSoby Mathewifeq (${NEED_BL31},yes) 5338a86052dSSoby Mathewinclude bl31/bl31.mk 5348a86052dSSoby Mathewendif 53503b397a8SNishanth Menon 53673c99d4eSJuan Castillo################################################################################ 53773c99d4eSJuan Castillo# Build options checks 53873c99d4eSJuan Castillo################################################################################ 53973c99d4eSJuan Castillo 540c5e1da83SJayanth Dodderi Chidanand# Boolean_Flags 541327131c4SLeonardo Sandoval$(eval $(call assert_booleans,\ 542327131c4SLeonardo Sandoval $(sort \ 543327131c4SLeonardo Sandoval ALLOW_RO_XLAT_TABLES \ 54446789a7cSBalint Dobszay BL2_ENABLE_SP_LOAD \ 545327131c4SLeonardo Sandoval COLD_BOOT_SINGLE_CPU \ 54628973741SBoyan Karatotev $(CPU_FLAG_LIST) \ 547327131c4SLeonardo Sandoval CREATE_KEYS \ 548327131c4SLeonardo Sandoval CTX_INCLUDE_AARCH32_REGS \ 549327131c4SLeonardo Sandoval CTX_INCLUDE_FPREGS \ 55042422622SMadhukar Pappireddy CTX_INCLUDE_SVE_REGS \ 551327131c4SLeonardo Sandoval CTX_INCLUDE_EL2_REGS \ 5529acff28aSArvind Ram Prakash CTX_INCLUDE_MPAM_REGS \ 553327131c4SLeonardo Sandoval DEBUG \ 554327131c4SLeonardo Sandoval DYN_DISABLE_AUTH \ 555327131c4SLeonardo Sandoval EL3_EXCEPTION_HANDLING \ 5561fd685a7SChris Kay ENABLE_AMU_AUXILIARY_COUNTERS \ 557873d4241Sjohpow01 AMU_RESTRICT_COUNTERS \ 558327131c4SLeonardo Sandoval ENABLE_ASSERTIONS \ 559327131c4SLeonardo Sandoval ENABLE_PIE \ 560327131c4SLeonardo Sandoval ENABLE_PMF \ 561327131c4SLeonardo Sandoval ENABLE_PSCI_STAT \ 562327131c4SLeonardo Sandoval ENABLE_RUNTIME_INSTRUMENTATION \ 563dc78e62dSjohpow01 ENABLE_SME_FOR_SWD \ 5640c5e7d1cSMax Shvetsov ENABLE_SVE_FOR_SWD \ 5658cef63d6SBoyan Karatotev ENABLE_FEAT_GCIE \ 566970a4a8dSManish Pandey ENABLE_FEAT_RAS \ 567f87e54f7SManish Pandey FFH_SUPPORT \ 568327131c4SLeonardo Sandoval ERROR_DEPRECATED \ 569327131c4SLeonardo Sandoval FAULT_INJECTION_SUPPORT \ 570327131c4SLeonardo Sandoval GENERATE_COT \ 571327131c4SLeonardo Sandoval GICV2_G0_FOR_EL3 \ 57246cc41d5SManish Pandey HANDLE_EA_EL3_FIRST_NS \ 573538516f5SBipin Ravi HARDEN_SLS \ 574327131c4SLeonardo Sandoval HW_ASSISTED_COHERENCY \ 575327131c4SLeonardo Sandoval MEASURED_BOOT \ 57636e3d877SAbhi.Singh DISCRETE_TPM \ 577e7f1181fSTamas Ban DICE_PROTECTION_ENVIRONMENT \ 5786a88ec8bSRaghu Krishnamurthy RMMD_ENABLE_EL3_TOKEN_SIGN \ 5792132c707SSona Mathew RMMD_ENABLE_IDE_KEY_PROG \ 58000e28874SManish V Badarkhe DRTM_SUPPORT \ 581327131c4SLeonardo Sandoval NS_TIMER_SWITCH \ 582327131c4SLeonardo Sandoval OVERRIDE_LIBC \ 583327131c4SLeonardo Sandoval PL011_GENERIC_UART \ 5845be66449SBoyan Karatotev PLAT_EXTRA_LD_SCRIPT \ 585327131c4SLeonardo Sandoval PROGRAMMABLE_RESET_ADDRESS \ 586327131c4SLeonardo Sandoval PSCI_EXTENDED_STATE_ID \ 58764b4710bSWing Li PSCI_OS_INIT_MODE \ 5888db17052SBoyan Karatotev ARCH_FEATURE_AVAILABILITY \ 589327131c4SLeonardo Sandoval RESET_TO_BL31 \ 590327131c4SLeonardo Sandoval SAVE_KEYS \ 591327131c4SLeonardo Sandoval SEPARATE_CODE_AND_RODATA \ 59296a8ed14SJiafei Pan SEPARATE_BL2_NOLOAD_REGION \ 593327131c4SLeonardo Sandoval SEPARATE_NOBITS_REGION \ 59486acbbe2SYe Li SEPARATE_RWDATA_REGION \ 595308ebfa1SMadhukar Pappireddy SEPARATE_SIMD_SECTION \ 596327131c4SLeonardo Sandoval SPIN_ON_BL1_EXIT \ 597327131c4SLeonardo Sandoval SPM_MM \ 5981d63ae4dSMarc Bonnici SPMC_AT_EL3 \ 599801cd3c8SNishant Sharma SPMC_AT_EL3_SEL0_SP \ 600327131c4SLeonardo Sandoval SPMD_SPM_AT_SEL2 \ 601890b5088SRaghu Krishnamurthy ENABLE_SPMD_LP \ 6023ba2c151SRaymond Mao TRANSFER_LIST \ 603327131c4SLeonardo Sandoval TRUSTED_BOARD_BOOT \ 604327131c4SLeonardo Sandoval USE_COHERENT_MEM \ 605327131c4SLeonardo Sandoval USE_DEBUGFS \ 606291e493dSHarrison Mutai USE_KERNEL_DT_CONVENTION \ 607327131c4SLeonardo Sandoval ARM_IO_IN_DTB \ 608327131c4SLeonardo Sandoval SDEI_IN_FCONF \ 609327131c4SLeonardo Sandoval SEC_INT_DESC_IN_FCONF \ 610327131c4SLeonardo Sandoval USE_ROMLIB \ 611327131c4SLeonardo Sandoval USE_TBBR_DEFS \ 612327131c4SLeonardo Sandoval WARMBOOT_ENABLE_DCACHE_EARLY \ 61342d4d3baSArvind Ram Prakash RESET_TO_BL2 \ 614327131c4SLeonardo Sandoval BL2_IN_XIP_MEM \ 615327131c4SLeonardo Sandoval BL2_INV_DCACHE \ 616327131c4SLeonardo Sandoval USE_SPINLOCK_CAS \ 617327131c4SLeonardo Sandoval ENCRYPT_BL31 \ 618327131c4SLeonardo Sandoval ENCRYPT_BL32 \ 619327131c4SLeonardo Sandoval ERRATA_SPECULATIVE_AT \ 62045c7328cSBoyan Karatotev ERRATA_SME_POWER_DOWN \ 62100e8f79cSManish Pandey RAS_TRAP_NS_ERR_REC_ACCESS \ 622327131c4SLeonardo Sandoval COT_DESC_IN_DTB \ 623327131c4SLeonardo Sandoval USE_SP804_TIMER \ 624396b339dSManish V Badarkhe PSA_FWU_SUPPORT \ 62511d05a77SSughosh Ganu PSA_FWU_METADATA_FW_STORE_DESC \ 62668120783SChris Kay ENABLE_MPMM \ 6276a0da736SJayanth Dodderi Chidanand FEATURE_DETECTION \ 6280b22e591SJayanth Dodderi Chidanand TRNG_SUPPORT \ 629593ae354SBoyan Karatotev ENABLE_ERRATA_ALL \ 630ffea3844SSona Mathew ERRATA_ABI_SUPPORT \ 631ef63f5beSSona Mathew ERRATA_NON_ARM_INTERCONNECT \ 63204c7303bSOkash Khawaja CONDITIONAL_CMO \ 6335782b890SManish V Badarkhe PSA_CRYPTO \ 63485bebe18SSandrine Bailleux ENABLE_CONSOLE_GETC \ 635183329a5SArvind Ram Prakash INIT_UNUSED_NS_EL2 \ 636bfef8b90SJuan Pablo Conde PLATFORM_REPORT_CTX_MEM_USE \ 637ae770fedSYann Gautier EARLY_CONSOLE \ 638f99a69c3SArvind Ram Prakash PRESERVE_DSU_PMU_REGS \ 6398953568aSLevi Yun HOB_LIST \ 640cf48f49fSManish V Badarkhe LFA_SUPPORT \ 641327131c4SLeonardo Sandoval))) 64273c99d4eSJuan Castillo 643c5e1da83SJayanth Dodderi Chidanand# Numeric_Flags 644327131c4SLeonardo Sandoval$(eval $(call assert_numerics,\ 645327131c4SLeonardo Sandoval $(sort \ 646327131c4SLeonardo Sandoval ARM_ARCH_MAJOR \ 647327131c4SLeonardo Sandoval ARM_ARCH_MINOR \ 648327131c4SLeonardo Sandoval BRANCH_PROTECTION \ 6496a0da736SJayanth Dodderi Chidanand CTX_INCLUDE_PAUTH_REGS \ 6506a0da736SJayanth Dodderi Chidanand CTX_INCLUDE_NEVE_REGS \ 65183a4dae1SBoyan Karatotev DISABLE_MTPMU \ 6521298f2f1SJayanth Dodderi Chidanand ENABLE_BRBE_FOR_NS \ 65347c681b7SJayanth Dodderi Chidanand ENABLE_TRBE_FOR_NS \ 6546a0da736SJayanth Dodderi Chidanand ENABLE_BTI \ 6556a0da736SJayanth Dodderi Chidanand ENABLE_PAUTH \ 656025b1b81SJohn Powell ENABLE_FEAT_PAUTH_LR \ 657cc2523bbSAndre Przywara ENABLE_FEAT_AIE \ 658d23acc9eSAndre Przywara ENABLE_FEAT_AMU \ 6596a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_AMUv1p1 \ 660a1032bebSJohn Powell ENABLE_FEAT_CPA2 \ 6616a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_CSV2_2 \ 66230019d86SSona Mathew ENABLE_FEAT_CSV2_3 \ 66383271d5aSArvind Ram Prakash ENABLE_FEAT_DEBUGV8P9 \ 6646a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_DIT \ 6656a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_ECV \ 6666a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_FGT \ 66733e6aaacSArvind Ram Prakash ENABLE_FEAT_FGT2 \ 6684274b526SArvind Ram Prakash ENABLE_FEAT_FGWTE3 \ 669a57e18e4SArvind Ram Prakash ENABLE_FEAT_FPMR \ 6706a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_HCX \ 67119d52a83SAndre Przywara ENABLE_FEAT_LS64_ACCDATA \ 6727e84f3cfSTushar Khandelwal ENABLE_FEAT_MEC \ 6736b8df7b9SArvind Ram Prakash ENABLE_FEAT_MOPS \ 6748e397889SGovindraj Raja ENABLE_FEAT_MTE2 \ 6756a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_PAN \ 676b3bcfd12SAndre Przywara ENABLE_FEAT_PFAR \ 6776a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_RNG \ 678ff86e0b4SJuan Pablo Conde ENABLE_FEAT_RNG_TRAP \ 6796a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_SEL2 \ 680d3331603SMark Brown ENABLE_FEAT_TCR2 \ 6816d0433f0SJayanth Dodderi Chidanand ENABLE_FEAT_THE \ 6820e4daed2SGovindraj Raja ENABLE_FEAT_SB \ 683062b6c6bSMark Brown ENABLE_FEAT_S2PIE \ 684062b6c6bSMark Brown ENABLE_FEAT_S1PIE \ 685062b6c6bSMark Brown ENABLE_FEAT_S2POE \ 686062b6c6bSMark Brown ENABLE_FEAT_S1POE \ 6874ec4e545SJayanth Dodderi Chidanand ENABLE_FEAT_SCTLR2 \ 68830655136SGovindraj Raja ENABLE_FEAT_D128 \ 689688ab57bSMark Brown ENABLE_FEAT_GCS \ 6906a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_VHE \ 691edebefbcSArvind Ram Prakash ENABLE_FEAT_MPAM \ 692c42aefd3SArvind Ram Prakash ENABLE_FEAT_MPAM_PE_BW_CTRL \ 6936a0da736SJayanth Dodderi Chidanand ENABLE_RME \ 6946437a09aSAndre Przywara ENABLE_SPE_FOR_NS \ 695603a0c6fSAndre Przywara ENABLE_SYS_REG_TRACE_FOR_NS \ 69645007acdSJayanth Dodderi Chidanand ENABLE_SME_FOR_NS \ 69703d3c0d7SJayanth Dodderi Chidanand ENABLE_SME2_FOR_NS \ 6982b0bc4e0SJayanth Dodderi Chidanand ENABLE_SVE_FOR_NS \ 6996a0da736SJayanth Dodderi Chidanand ENABLE_TRF_FOR_NS \ 700327131c4SLeonardo Sandoval FW_ENC_STATUS \ 7015357f83dSManish V Badarkhe NR_OF_FW_BANKS \ 7025357f83dSManish V Badarkhe NR_OF_IMAGES_IN_FW_BANK \ 703781d07a4SJayanth Dodderi Chidanand TWED_DELAY \ 704781d07a4SJayanth Dodderi Chidanand ENABLE_FEAT_TWED \ 705bebcf27fSMark Brown SVE_VECTOR_LEN \ 7060ed3be6fSVarun Wadekar IMPDEF_SYSREG_TRAP \ 707ee580c2dSBoyan Karatotev W \ 708327131c4SLeonardo Sandoval))) 709c877b414SJeenu Viswambharan 710aacff749SJustin Chadwellifdef KEY_SIZE 711aacff749SJustin Chadwell $(eval $(call assert_numeric,KEY_SIZE)) 712aacff749SJustin Chadwellendif 713aacff749SJustin Chadwell 7141f461979SJustin Chadwellifeq ($(filter $(SANITIZE_UB), on off trap),) 7151f461979SJustin Chadwell $(error "Invalid value for SANITIZE_UB: can be one of on, off, trap") 7161f461979SJustin Chadwellendif 7171f461979SJustin Chadwell 71873c99d4eSJuan Castillo################################################################################ 71973c99d4eSJuan Castillo# Add definitions to the cpp preprocessor based on the current build options. 72073c99d4eSJuan Castillo# This is done after including the platform specific makefile to allow the 72173c99d4eSJuan Castillo# platform to overwrite the default options 72273c99d4eSJuan Castillo################################################################################ 72373c99d4eSJuan Castillo 724327131c4SLeonardo Sandoval$(eval $(call add_defines,\ 725327131c4SLeonardo Sandoval $(sort \ 726327131c4SLeonardo Sandoval ALLOW_RO_XLAT_TABLES \ 727327131c4SLeonardo Sandoval ARM_ARCH_MAJOR \ 728327131c4SLeonardo Sandoval ARM_ARCH_MINOR \ 72946789a7cSBalint Dobszay BL2_ENABLE_SP_LOAD \ 730327131c4SLeonardo Sandoval COLD_BOOT_SINGLE_CPU \ 73128973741SBoyan Karatotev $(CPU_FLAG_LIST) \ 732327131c4SLeonardo Sandoval CTX_INCLUDE_AARCH32_REGS \ 733327131c4SLeonardo Sandoval CTX_INCLUDE_FPREGS \ 73442422622SMadhukar Pappireddy CTX_INCLUDE_SVE_REGS \ 735327131c4SLeonardo Sandoval CTX_INCLUDE_PAUTH_REGS \ 7369acff28aSArvind Ram Prakash CTX_INCLUDE_MPAM_REGS \ 737327131c4SLeonardo Sandoval EL3_EXCEPTION_HANDLING \ 738327131c4SLeonardo Sandoval CTX_INCLUDE_EL2_REGS \ 739062f8aafSArunachalam Ganapathy CTX_INCLUDE_NEVE_REGS \ 740ee580c2dSBoyan Karatotev DEBUG \ 741327131c4SLeonardo Sandoval DECRYPTION_SUPPORT_${DECRYPTION_SUPPORT} \ 7420063dd17SJavier Almansa Sobrino DISABLE_MTPMU \ 743d23acc9eSAndre Przywara ENABLE_FEAT_AMU \ 7441fd685a7SChris Kay ENABLE_AMU_AUXILIARY_COUNTERS \ 745873d4241Sjohpow01 AMU_RESTRICT_COUNTERS \ 746327131c4SLeonardo Sandoval ENABLE_ASSERTIONS \ 747327131c4SLeonardo Sandoval ENABLE_BTI \ 74883271d5aSArvind Ram Prakash ENABLE_FEAT_DEBUGV8P9 \ 749edebefbcSArvind Ram Prakash ENABLE_FEAT_MPAM \ 750c42aefd3SArvind Ram Prakash ENABLE_FEAT_MPAM_PE_BW_CTRL \ 751327131c4SLeonardo Sandoval ENABLE_PAUTH \ 752025b1b81SJohn Powell ENABLE_FEAT_PAUTH_LR \ 753327131c4SLeonardo Sandoval ENABLE_PIE \ 754327131c4SLeonardo Sandoval ENABLE_PMF \ 755327131c4SLeonardo Sandoval ENABLE_PSCI_STAT \ 7565b18de09SZelalem Aweke ENABLE_RME \ 7576a88ec8bSRaghu Krishnamurthy RMMD_ENABLE_EL3_TOKEN_SIGN \ 7582132c707SSona Mathew RMMD_ENABLE_IDE_KEY_PROG \ 759327131c4SLeonardo Sandoval ENABLE_RUNTIME_INSTRUMENTATION \ 760dc78e62dSjohpow01 ENABLE_SME_FOR_NS \ 76103d3c0d7SJayanth Dodderi Chidanand ENABLE_SME2_FOR_NS \ 762dc78e62dSjohpow01 ENABLE_SME_FOR_SWD \ 76390118bb5SAndre Przywara ENABLE_SPE_FOR_NS \ 764327131c4SLeonardo Sandoval ENABLE_SVE_FOR_NS \ 7650c5e7d1cSMax Shvetsov ENABLE_SVE_FOR_SWD \ 766970a4a8dSManish Pandey ENABLE_FEAT_RAS \ 767f87e54f7SManish Pandey FFH_SUPPORT \ 768327131c4SLeonardo Sandoval ENCRYPT_BL31 \ 769327131c4SLeonardo Sandoval ENCRYPT_BL32 \ 770327131c4SLeonardo Sandoval ERROR_DEPRECATED \ 771327131c4SLeonardo Sandoval FAULT_INJECTION_SUPPORT \ 772327131c4SLeonardo Sandoval GICV2_G0_FOR_EL3 \ 77346cc41d5SManish Pandey HANDLE_EA_EL3_FIRST_NS \ 774327131c4SLeonardo Sandoval HW_ASSISTED_COHERENCY \ 775327131c4SLeonardo Sandoval LOG_LEVEL \ 776327131c4SLeonardo Sandoval MEASURED_BOOT \ 77736e3d877SAbhi.Singh DISCRETE_TPM \ 778e7f1181fSTamas Ban DICE_PROTECTION_ENVIRONMENT \ 77900e28874SManish V Badarkhe DRTM_SUPPORT \ 780327131c4SLeonardo Sandoval NS_TIMER_SWITCH \ 781327131c4SLeonardo Sandoval PL011_GENERIC_UART \ 7825be66449SBoyan Karatotev PLAT_EXTRA_LD_SCRIPT \ 783327131c4SLeonardo Sandoval PLAT_${PLAT} \ 784327131c4SLeonardo Sandoval PROGRAMMABLE_RESET_ADDRESS \ 785327131c4SLeonardo Sandoval PSCI_EXTENDED_STATE_ID \ 78664b4710bSWing Li PSCI_OS_INIT_MODE \ 7878db17052SBoyan Karatotev ARCH_FEATURE_AVAILABILITY \ 788327131c4SLeonardo Sandoval RESET_TO_BL31 \ 789d766084fSAlexeiFedorov RME_GPT_BITLOCK_BLOCK \ 790ec0088bbSAlexeiFedorov RME_GPT_MAX_BLOCK \ 791327131c4SLeonardo Sandoval SEPARATE_CODE_AND_RODATA \ 7925ce4ee1aSXialin Liu SEPARATE_BL2_FIP \ 79396a8ed14SJiafei Pan SEPARATE_BL2_NOLOAD_REGION \ 794327131c4SLeonardo Sandoval SEPARATE_NOBITS_REGION \ 79586acbbe2SYe Li SEPARATE_RWDATA_REGION \ 796308ebfa1SMadhukar Pappireddy SEPARATE_SIMD_SECTION \ 797327131c4SLeonardo Sandoval RECLAIM_INIT_CODE \ 798327131c4SLeonardo Sandoval SPD_${SPD} \ 799327131c4SLeonardo Sandoval SPIN_ON_BL1_EXIT \ 800327131c4SLeonardo Sandoval SPM_MM \ 8011d63ae4dSMarc Bonnici SPMC_AT_EL3 \ 802801cd3c8SNishant Sharma SPMC_AT_EL3_SEL0_SP \ 803327131c4SLeonardo Sandoval SPMD_SPM_AT_SEL2 \ 8043ba2c151SRaymond Mao TRANSFER_LIST \ 805327131c4SLeonardo Sandoval TRUSTED_BOARD_BOOT \ 8067dfb9911SJimmy Brisson TRNG_SUPPORT \ 807ffea3844SSona Mathew ERRATA_ABI_SUPPORT \ 808ef63f5beSSona Mathew ERRATA_NON_ARM_INTERCONNECT \ 809327131c4SLeonardo Sandoval USE_COHERENT_MEM \ 810327131c4SLeonardo Sandoval USE_DEBUGFS \ 811327131c4SLeonardo Sandoval ARM_IO_IN_DTB \ 812327131c4SLeonardo Sandoval SDEI_IN_FCONF \ 813327131c4SLeonardo Sandoval SEC_INT_DESC_IN_FCONF \ 814327131c4SLeonardo Sandoval USE_ROMLIB \ 815327131c4SLeonardo Sandoval USE_TBBR_DEFS \ 816291e493dSHarrison Mutai USE_KERNEL_DT_CONVENTION \ 817327131c4SLeonardo Sandoval WARMBOOT_ENABLE_DCACHE_EARLY \ 81842d4d3baSArvind Ram Prakash RESET_TO_BL2 \ 81942d4d3baSArvind Ram Prakash BL2_RUNS_AT_EL3 \ 820327131c4SLeonardo Sandoval BL2_IN_XIP_MEM \ 821327131c4SLeonardo Sandoval BL2_INV_DCACHE \ 822327131c4SLeonardo Sandoval USE_SPINLOCK_CAS \ 823327131c4SLeonardo Sandoval ERRATA_SPECULATIVE_AT \ 82445c7328cSBoyan Karatotev ERRATA_SME_POWER_DOWN \ 82500e8f79cSManish Pandey RAS_TRAP_NS_ERR_REC_ACCESS \ 826327131c4SLeonardo Sandoval COT_DESC_IN_DTB \ 827327131c4SLeonardo Sandoval USE_SP804_TIMER \ 82812cd65e0STomas Pilar ENABLE_FEAT_RNG \ 829ff86e0b4SJuan Pablo Conde ENABLE_FEAT_RNG_TRAP \ 8304e04478aSChris Kay ENABLE_FEAT_SB \ 8317d33ffe4SDaniel Boulby ENABLE_FEAT_DIT \ 8325357f83dSManish V Badarkhe NR_OF_FW_BANKS \ 8335357f83dSManish V Badarkhe NR_OF_IMAGES_IN_FW_BANK \ 834396b339dSManish V Badarkhe PSA_FWU_SUPPORT \ 83511d05a77SSughosh Ganu PSA_FWU_METADATA_FW_STORE_DESC \ 836744ad974Sjohpow01 ENABLE_BRBE_FOR_NS \ 837813524eaSManish V Badarkhe ENABLE_TRBE_FOR_NS \ 838d4582d30SManish V Badarkhe ENABLE_SYS_REG_TRACE_FOR_NS \ 8398fcd3d96SManish V Badarkhe ENABLE_TRF_FOR_NS \ 840cc2523bbSAndre Przywara ENABLE_FEAT_AIE \ 841cb4ec47bSjohpow01 ENABLE_FEAT_HCX \ 84268120783SChris Kay ENABLE_MPMM \ 843f74cb0beSJayanth Dodderi Chidanand ENABLE_FEAT_FGT \ 84433e6aaacSArvind Ram Prakash ENABLE_FEAT_FGT2 \ 8454274b526SArvind Ram Prakash ENABLE_FEAT_FGWTE3 \ 846a57e18e4SArvind Ram Prakash ENABLE_FEAT_FPMR \ 847f74cb0beSJayanth Dodderi Chidanand ENABLE_FEAT_ECV \ 8486a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_AMUv1p1 \ 8496a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_SEL2 \ 8506a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_VHE \ 851a1032bebSJohn Powell ENABLE_FEAT_CPA2 \ 8526a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_CSV2_2 \ 85330019d86SSona Mathew ENABLE_FEAT_CSV2_3 \ 85419d52a83SAndre Przywara ENABLE_FEAT_LS64_ACCDATA \ 8557e84f3cfSTushar Khandelwal ENABLE_FEAT_MEC \ 8566a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_PAN \ 857d3331603SMark Brown ENABLE_FEAT_TCR2 \ 8586d0433f0SJayanth Dodderi Chidanand ENABLE_FEAT_THE \ 859062b6c6bSMark Brown ENABLE_FEAT_S2PIE \ 860062b6c6bSMark Brown ENABLE_FEAT_S1PIE \ 861062b6c6bSMark Brown ENABLE_FEAT_S2POE \ 862062b6c6bSMark Brown ENABLE_FEAT_S1POE \ 8634ec4e545SJayanth Dodderi Chidanand ENABLE_FEAT_SCTLR2 \ 86430655136SGovindraj Raja ENABLE_FEAT_D128 \ 865688ab57bSMark Brown ENABLE_FEAT_GCS \ 8666b8df7b9SArvind Ram Prakash ENABLE_FEAT_MOPS \ 8678cef63d6SBoyan Karatotev ENABLE_FEAT_GCIE \ 8688e397889SGovindraj Raja ENABLE_FEAT_MTE2 \ 869b3bcfd12SAndre Przywara ENABLE_FEAT_PFAR \ 8706a0da736SJayanth Dodderi Chidanand FEATURE_DETECTION \ 871781d07a4SJayanth Dodderi Chidanand TWED_DELAY \ 872781d07a4SJayanth Dodderi Chidanand ENABLE_FEAT_TWED \ 87304c7303bSOkash Khawaja CONDITIONAL_CMO \ 8740ed3be6fSVarun Wadekar IMPDEF_SYSREG_TRAP \ 875a8cf6faeSJayanth Dodderi Chidanand SVE_VECTOR_LEN \ 876890b5088SRaghu Krishnamurthy ENABLE_SPMD_LP \ 8775782b890SManish V Badarkhe PSA_CRYPTO \ 87885bebe18SSandrine Bailleux ENABLE_CONSOLE_GETC \ 879183329a5SArvind Ram Prakash INIT_UNUSED_NS_EL2 \ 880bfef8b90SJuan Pablo Conde PLATFORM_REPORT_CTX_MEM_USE \ 881ae770fedSYann Gautier EARLY_CONSOLE \ 882f99a69c3SArvind Ram Prakash PRESERVE_DSU_PMU_REGS \ 8838953568aSLevi Yun HOB_LIST \ 8842f5fd826SHarrison Mutai HW_CONFIG_BASE \ 885cf48f49fSManish V Badarkhe LFA_SUPPORT \ 886327131c4SLeonardo Sandoval))) 8872fae4b1eSJeenu Viswambharan 888bfef8b90SJuan Pablo Condeifeq (${PLATFORM_REPORT_CTX_MEM_USE}, 1) 889bfef8b90SJuan Pablo Condeifeq (${DEBUG}, 0) 890bfef8b90SJuan Pablo Conde $(warning "PLATFORM_REPORT_CTX_MEM_USE can be applied when DEBUG=1 only") 891bfef8b90SJuan Pablo Conde override PLATFORM_REPORT_CTX_MEM_USE := 0 892bfef8b90SJuan Pablo Condeendif 893bfef8b90SJuan Pablo Condeendif 894bfef8b90SJuan Pablo Conde 8951f461979SJustin Chadwellifeq (${SANITIZE_UB},trap) 8961f461979SJustin Chadwell $(eval $(call add_define,MONITOR_TRAPS)) 897c5e1da83SJayanth Dodderi Chidanandendif #(SANITIZE_UB) 8981f461979SJustin Chadwell 8994c117f6cSSandrine Bailleux# Define the EL3_PAYLOAD_BASE flag only if it is provided. 9004c117f6cSSandrine Bailleuxifdef EL3_PAYLOAD_BASE 9014c117f6cSSandrine Bailleux $(eval $(call add_define,EL3_PAYLOAD_BASE)) 902cf2c8a33SAntonio Nino Diazelse 90368450a6dSAntonio Nino Diaz# Define the PRELOADED_BL33_BASE flag only if it is provided and 90468450a6dSAntonio Nino Diaz# EL3_PAYLOAD_BASE is not defined, as it has priority. 90568450a6dSAntonio Nino Diaz ifdef PRELOADED_BL33_BASE 90668450a6dSAntonio Nino Diaz $(eval $(call add_define,PRELOADED_BL33_BASE)) 9074c117f6cSSandrine Bailleux endif 908c5e1da83SJayanth Dodderi Chidanandendif #(EL3_PAYLOAD_BASE) 90973c99d4eSJuan Castillo 910209a60ccSSoby Mathew# Define the DYN_DISABLE_AUTH flag only if set. 911209a60ccSSoby Mathewifeq (${DYN_DISABLE_AUTH},1) 912209a60ccSSoby Mathew $(eval $(call add_define,DYN_DISABLE_AUTH)) 913209a60ccSSoby Mathewendif 914209a60ccSSoby Mathew 9158620bd0bSChris Kayifeq ($($(ARCH)-ld-id),arm-link) 916c2ad38ceSVarun Wadekar $(eval $(call add_define,USE_ARM_LINK)) 917c2ad38ceSVarun Wadekarendif 918c2ad38ceSVarun Wadekar 919ce2b1ec6SManish Pandey# Generate and include sp_gen.mk if SPD is spmd and SP_LAYOUT_FILE is defined 920ce2b1ec6SManish Pandeyifeq (${SPD},spmd) 921c33ff198SOlivier Deprezifdef SP_LAYOUT_FILE 922ce2b1ec6SManish Pandey -include $(BUILD_PLAT)/sp_gen.mk 923ce2b1ec6SManish Pandey FIP_DEPS += sp 92407c44475SManish Pandey CRT_DEPS += sp 925ce2b1ec6SManish Pandey NEED_SP_PKG := yes 926ce2b1ec6SManish Pandeyelse 927c33ff198SOlivier Deprez ifeq (${SPMD_SPM_AT_SEL2},1) 928c33ff198SOlivier Deprez $(error "SPMD with SPM at S-EL2 require SP_LAYOUT_FILE") 929c33ff198SOlivier Deprez endif 930c5e1da83SJayanth Dodderi Chidanandendif #(SP_LAYOUT_FILE) 931c5e1da83SJayanth Dodderi Chidanandendif #(SPD) 932ce2b1ec6SManish Pandey 93373c99d4eSJuan Castillo################################################################################ 9343df79ae7SBoyan Karatotev# Configure the flags for the specified compiler and linker 9353df79ae7SBoyan Karatotev################################################################################ 9363df79ae7SBoyan Karatotevinclude ${MAKE_HELPERS_DIRECTORY}cflags.mk 9373df79ae7SBoyan Karatotev 9383df79ae7SBoyan Karatotev################################################################################ 93973c99d4eSJuan Castillo# Build targets 94073c99d4eSJuan Castillo################################################################################ 94173c99d4eSJuan Castillo 9422329e22bSHarrison Mutai.PHONY: all msg_start clean realclean distclean cscope locate-checkpatch checkcodebase checkpatch fiptool sptool fip sp tl fwu_fip certtool dtbs memmap doc enctool 94373c99d4eSJuan Castillo 94473c99d4eSJuan Castilloall: msg_start 94573c99d4eSJuan Castillo 94673c99d4eSJuan Castillomsg_start: 9477c4e1eeaSChris Kay $(s)echo "Building ${PLAT}" 94873c99d4eSJuan Castillo 94961f72a34SRoberto Vargas$(eval $(call MAKE_LIB,c)) 9505fee0287SRoberto Vargas 95173c99d4eSJuan Castillo# Expand build macros for the different images 95273c99d4eSJuan Castilloifeq (${NEED_BL1},yes) 953b34635a0SChris KayBL1_SOURCES := $(sort ${BL1_SOURCES}) 954434d0491SZelalem Aweke$(eval $(call MAKE_BL,bl1)) 955c5e1da83SJayanth Dodderi Chidanandendif #(NEED_BL1) 95673c99d4eSJuan Castillo 95773c99d4eSJuan Castilloifeq (${NEED_BL2},yes) 958c5e1da83SJayanth Dodderi Chidanand 95942d4d3baSArvind Ram Prakashifeq (${RESET_TO_BL2}, 0) 960c9b31ae8SRoberto VargasFIP_BL2_ARGS := tb-fw 961c9b31ae8SRoberto Vargasendif 962c9b31ae8SRoberto Vargas 963eb1acfb6SChris KayBL2_SOURCES := $(sort ${BL2_SOURCES}) 964eb1acfb6SChris Kay 965d57362bdSXialin Liuifeq (${SEPARATE_BL2_FIP},1) 966d57362bdSXialin Liu$(if ${BL2}, $(eval $(call TOOL_ADD_IMG,bl2,--${FIP_BL2_ARGS},BL2_)), \ 967d57362bdSXialin Liu $(eval $(call MAKE_BL,bl2,${FIP_BL2_ARGS},BL2_))) 968d57362bdSXialin Liuelse 96933950dd8SMasahiro Yamada$(if ${BL2}, $(eval $(call TOOL_ADD_IMG,bl2,--${FIP_BL2_ARGS})), \ 970434d0491SZelalem Aweke $(eval $(call MAKE_BL,bl2,${FIP_BL2_ARGS}))) 971d57362bdSXialin Liuendif #(SEPARATE_BL2_FIP) 972c5e1da83SJayanth Dodderi Chidanand 973c5e1da83SJayanth Dodderi Chidanandendif #(NEED_BL2) 97473c99d4eSJuan Castillo 9754d045d0eSMasahiro Yamadaifeq (${NEED_SCP_BL2},yes) 97633950dd8SMasahiro Yamada$(eval $(call TOOL_ADD_IMG,scp_bl2,--scp-fw)) 977c5e1da83SJayanth Dodderi Chidanandendif #(NEED_SCP_BL2) 9784d045d0eSMasahiro Yamada 97973c99d4eSJuan Castilloifeq (${NEED_BL31},yes) 98073c99d4eSJuan CastilloBL31_SOURCES += ${SPD_SOURCES} 98126d1e0c3SMadhukar Pappireddy# Sort BL31 source files to remove duplicates 98226d1e0c3SMadhukar PappireddyBL31_SOURCES := $(sort ${BL31_SOURCES}) 983c6ba9b45SSumit Gargifneq (${DECRYPTION_SUPPORT},none) 984c6ba9b45SSumit Garg$(if ${BL31}, $(eval $(call TOOL_ADD_IMG,bl31,--soc-fw,,$(ENCRYPT_BL31))),\ 985434d0491SZelalem Aweke $(eval $(call MAKE_BL,bl31,soc-fw,,$(ENCRYPT_BL31)))) 986c6ba9b45SSumit Gargelse 98733950dd8SMasahiro Yamada$(if ${BL31}, $(eval $(call TOOL_ADD_IMG,bl31,--soc-fw)),\ 988434d0491SZelalem Aweke $(eval $(call MAKE_BL,bl31,soc-fw))) 989c5e1da83SJayanth Dodderi Chidanandendif #(DECRYPTION_SUPPORT) 990c5e1da83SJayanth Dodderi Chidanandendif #(NEED_BL31) 99173c99d4eSJuan Castillo 99270d1fc53SJuan Castillo# If a BL32 image is needed but neither BL32 nor BL32_SOURCES is defined, the 993c939d13aSMasahiro Yamada# build system will call TOOL_ADD_IMG to print a warning message and abort the 99470d1fc53SJuan Castillo# process. Note that the dependency on BL32 applies to the FIP only. 99573c99d4eSJuan Castilloifeq (${NEED_BL32},yes) 99626d1e0c3SMadhukar Pappireddy# Sort BL32 source files to remove duplicates 99726d1e0c3SMadhukar PappireddyBL32_SOURCES := $(sort ${BL32_SOURCES}) 9989cd15239SMasahiro YamadaBUILD_BL32 := $(if $(BL32),,$(if $(BL32_SOURCES),1)) 9999cd15239SMasahiro Yamada 1000c6ba9b45SSumit Gargifneq (${DECRYPTION_SUPPORT},none) 1001434d0491SZelalem Aweke$(if ${BUILD_BL32}, $(eval $(call MAKE_BL,bl32,tos-fw,,$(ENCRYPT_BL32))),\ 1002c6ba9b45SSumit Garg $(eval $(call TOOL_ADD_IMG,bl32,--tos-fw,,$(ENCRYPT_BL32)))) 1003c6ba9b45SSumit Gargelse 1004434d0491SZelalem Aweke$(if ${BUILD_BL32}, $(eval $(call MAKE_BL,bl32,tos-fw)),\ 100533950dd8SMasahiro Yamada $(eval $(call TOOL_ADD_IMG,bl32,--tos-fw))) 1006c5e1da83SJayanth Dodderi Chidanandendif #(DECRYPTION_SUPPORT) 1007c5e1da83SJayanth Dodderi Chidanandendif #(NEED_BL32) 100873c99d4eSJuan Castillo 10095b18de09SZelalem Aweke# If RMM image is needed but RMM is not defined, Test Realm Payload (TRP) 10105b18de09SZelalem Aweke# needs to be built from RMM_SOURCES. 10115b18de09SZelalem Awekeifeq (${NEED_RMM},yes) 10125b18de09SZelalem Aweke# Sort RMM source files to remove duplicates 10135b18de09SZelalem AwekeRMM_SOURCES := $(sort ${RMM_SOURCES}) 10145b18de09SZelalem AwekeBUILD_RMM := $(if $(RMM),,$(if $(RMM_SOURCES),1)) 10155b18de09SZelalem Aweke 10165b18de09SZelalem Aweke$(if ${BUILD_RMM}, $(eval $(call MAKE_BL,rmm,rmm-fw)),\ 10175b18de09SZelalem Aweke $(eval $(call TOOL_ADD_IMG,rmm,--rmm-fw))) 1018c5e1da83SJayanth Dodderi Chidanandendif #(NEED_RMM) 10195b18de09SZelalem Aweke 102073c99d4eSJuan Castillo# Add the BL33 image if required by the platform 102173c99d4eSJuan Castilloifeq (${NEED_BL33},yes) 102233950dd8SMasahiro Yamada$(eval $(call TOOL_ADD_IMG,bl33,--nt-fw)) 1023c5e1da83SJayanth Dodderi Chidanandendif #(NEED_BL33) 1024db6071c9SJuan Castillo 10259003fa0bSYatharth Kocharifeq (${NEED_BL2U},yes) 102633950dd8SMasahiro Yamada$(if ${BL2U}, $(eval $(call TOOL_ADD_IMG,bl2u,--ap-fwu-cfg,FWU_)),\ 1027434d0491SZelalem Aweke $(eval $(call MAKE_BL,bl2u,ap-fwu-cfg,FWU_))) 1028c5e1da83SJayanth Dodderi Chidanandendif #(NEED_BL2U) 10299003fa0bSYatharth Kochar 103003b397a8SNishanth Menon# Expand build macros for the different images 103103b397a8SNishanth Menonifeq (${NEED_FDT},yes) 103203b397a8SNishanth Menon $(eval $(call MAKE_DTBS,$(BUILD_PLAT)/fdts,$(FDT_SOURCES))) 10331c08ff32SSalman Nabi 10341c08ff32SSalman Nabi ifneq (${INITRD_SIZE}${INITRD_PATH},) 10351c08ff32SSalman Nabi ifndef INITRD_BASE 10361c08ff32SSalman Nabi $(error INITRD_BASE must be set when inserting initrd properties to the DTB.) 10371c08ff32SSalman Nabi endif 10381c08ff32SSalman Nabi 10391c08ff32SSalman Nabi INITRD_SIZE ?= $(shell printf "0x%x\n" $$(stat -Lc %s $(INITRD_PATH))) 10401c08ff32SSalman Nabi initrd_end = $(shell printf "0x%x\n" $$(expr $$(($(INITRD_BASE) + $(INITRD_SIZE))))) 10411c08ff32SSalman Nabi 10421c08ff32SSalman Nabi define $(HW_CONFIG)-after += 10431c08ff32SSalman Nabi $(s)echo " INITRD $(HW_CONFIG)" 10441c08ff32SSalman Nabi $(q)fdtput -t x $@ /chosen linux,initrd-start $(INITRD_BASE) 10451c08ff32SSalman Nabi $(q)fdtput -t x $@ /chosen linux,initrd-end $(initrd_end) 10461c08ff32SSalman Nabi endef 10471c08ff32SSalman Nabi endif 1048c5e1da83SJayanth Dodderi Chidanandendif #(NEED_FDT) 104903b397a8SNishanth Menon 1050ce2b1ec6SManish Pandey# Add Secure Partition packages 1051ce2b1ec6SManish Pandeyifeq (${NEED_SP_PKG},yes) 1052fd74ca0dSChris Kay$(BUILD_PLAT)/sp_gen.mk: ${SP_MK_GEN} ${SP_LAYOUT_FILE} | $$(@D)/ 1053679e27ceSChris Kay $(if $(host-poetry),$(q)poetry -q install --no-root) 1054dd816235SKathleen Capella $(q)$(if $(host-poetry),poetry run )${PYTHON} "$<" "$@" $(filter-out $<,$^) $(BUILD_PLAT) ${COT} ${SP_DTS_LIST_FRAGMENT} 1055822c7279SJ-Alvessp: $(DTBS) $(BUILD_PLAT)/sp_gen.mk $(SP_PKGS) 10567c4e1eeaSChris Kay $(s)echo 10577c4e1eeaSChris Kay $(s)echo "Built SP Images successfully" 10587c4e1eeaSChris Kay $(s)echo 1059c5e1da83SJayanth Dodderi Chidanandendif #(NEED_SP_PKG) 1060ce2b1ec6SManish Pandey 106136eaaf37SIan Spraylocate-checkpatch: 106236eaaf37SIan Sprayifndef CHECKPATCH 106366079b04SEtienne Carriere $(error "Please set CHECKPATCH to point to the Linux checkpatch.pl file, eg: CHECKPATCH=../linux/scripts/checkpatch.pl") 106436eaaf37SIan Sprayelse 106536eaaf37SIan Sprayifeq (,$(wildcard ${CHECKPATCH})) 106666079b04SEtienne Carriere $(error "The file CHECKPATCH points to cannot be found, use eg: CHECKPATCH=../linux/scripts/checkpatch.pl") 106736eaaf37SIan Sprayendif 1068c5e1da83SJayanth Dodderi Chidanandendif #(CHECKPATCH) 106936eaaf37SIan Spray 10704f6ad66aSAchin Guptaclean: 10717c4e1eeaSChris Kay $(s)echo " CLEAN" 1072c3273703SChris Kay $(q)rm -rf $(BUILD_PLAT) 1073cbd6cec3SBoyan Karatotev $(q)${MAKE} PLAT=${PLAT} BUILD_PLAT=${BUILD_PLAT} --no-print-directory -C ${FIPTOOLPATH} clean 1074cbd6cec3SBoyan Karatotev $(q)rm -rf ${FIPTOOLPATH}/fiptool 1075f4595e6eSBoyan Karatotev $(q)${MAKE} PLAT=${PLAT} BUILD_PLAT=${BUILD_PLAT} --no-print-directory -C ${CRTTOOLPATH} clean 1076f4595e6eSBoyan Karatotev $(q)rm -rf ${CRTTOOLPATH}/cert_create 107796fbe884SBoyan Karatotev $(q)${MAKE} PLAT=${PLAT} BUILD_PLAT=${BUILD_PLAT} --no-print-directory -C ${ENCTOOLPATH} clean 10787c4e1eeaSChris Kay $(q)${MAKE} --no-print-directory -C ${ROMLIBPATH} clean 10794f6ad66aSAchin Gupta 1080eaaeece2SJames Morrisseyrealclean distclean: 10817c4e1eeaSChris Kay $(s)echo " REALCLEAN" 1082c3273703SChris Kay $(q)rm -rf $(BUILD_BASE) 1083c3273703SChris Kay $(q)rm -rf $(CURDIR)/cscope.* 1084cbd6cec3SBoyan Karatotev $(q)${MAKE} PLAT=${PLAT} BUILD_PLAT=${BUILD_PLAT} --no-print-directory -C ${FIPTOOLPATH} clean 1085cbd6cec3SBoyan Karatotev $(q)rm -rf ${FIPTOOLPATH}/fiptool 1086f4595e6eSBoyan Karatotev $(q)${MAKE} PLAT=${PLAT} BUILD_PLAT=${BUILD_PLAT} --no-print-directory -C ${CRTTOOLPATH} clean 1087f4595e6eSBoyan Karatotev $(q)rm -rf ${CRTTOOLPATH}/cert_create 108896fbe884SBoyan Karatotev $(q)${MAKE} PLAT=${PLAT} BUILD_PLAT=${BUILD_PLAT} --no-print-directory -C ${ENCTOOLPATH} clean 10897c4e1eeaSChris Kay $(q)${MAKE} --no-print-directory -C ${ROMLIBPATH} clean 10904f6ad66aSAchin Gupta 109136eaaf37SIan Spraycheckcodebase: locate-checkpatch 10927c4e1eeaSChris Kay $(s)echo " CHECKING STYLE" 10937c4e1eeaSChris Kay $(q)if test -d .git ; then \ 10941ef35512SPaul Beesley git ls-files | grep -E -v 'libfdt|libc|docs|\.rst' | \ 10951a41e8c1SDan Handley while read GIT_FILE ; \ 10961a41e8c1SDan Handley do ${CHECKPATCH} ${CHECKCODE_ARGS} -f $$GIT_FILE ; \ 10971a41e8c1SDan Handley done ; \ 109836eaaf37SIan Spray else \ 10991a41e8c1SDan Handley find . -type f -not -iwholename "*.git*" \ 11001a41e8c1SDan Handley -not -iwholename "*build*" \ 11011a41e8c1SDan Handley -not -iwholename "*libfdt*" \ 110261f72a34SRoberto Vargas -not -iwholename "*libc*" \ 11031a41e8c1SDan Handley -not -iwholename "*docs*" \ 11041ef35512SPaul Beesley -not -iwholename "*.rst" \ 11051a41e8c1SDan Handley -exec ${CHECKPATCH} ${CHECKCODE_ARGS} -f {} \; ; \ 110636eaaf37SIan Spray fi 110736eaaf37SIan Spray 110836eaaf37SIan Spraycheckpatch: locate-checkpatch 11097c4e1eeaSChris Kay $(s)echo " CHECKING STYLE" 11107c4e1eeaSChris Kay $(q)if test -n "${CHECKPATCH_OPTS}"; then \ 111102a76d5fSYann Gautier echo " with ${CHECKPATCH_OPTS} option(s)"; \ 111202a76d5fSYann Gautier fi 11137c4e1eeaSChris Kay $(q)COMMON_COMMIT=$$(git merge-base HEAD ${BASE_COMMIT}); \ 111477a0a7f1SYann Gautier for commit in `git rev-list --no-merges $$COMMON_COMMIT..HEAD`; \ 111577a0a7f1SYann Gautier do \ 111651d28937SAntonio Nino Diaz printf "\n[*] Checking style of '$$commit'\n\n"; \ 11171a721748SYann Gautier ( git log --format=email "$$commit~..$$commit" \ 11181a721748SYann Gautier -- ${CHECK_PATHS} ; \ 111951d28937SAntonio Nino Diaz git diff --format=email "$$commit~..$$commit" \ 11201a721748SYann Gautier -- ${CHECK_PATHS}; ) | \ 112102a76d5fSYann Gautier ${CHECKPATCH} ${CHECKPATCH_OPTS} - || true; \ 112251d28937SAntonio Nino Diaz done 112336eaaf37SIan Spray 112473c99d4eSJuan Castillocerttool: ${CRTTOOL} 112573c99d4eSJuan Castillo 1126774fb379SBoyan Karatotev${CRTTOOL}: FORCE | $$(@D)/ 1127f4595e6eSBoyan Karatotev $(q)${MAKE} PLAT=${PLAT} BUILD_PLAT=$(abspath ${BUILD_PLAT}) USE_TBBR_DEFS=${USE_TBBR_DEFS} COT=${COT} OPENSSL_DIR=${OPENSSL_DIR} DEBUG=${DEBUG} --no-print-directory -C ${CRTTOOLPATH} all 1128f4595e6eSBoyan Karatotev $(q)ln -sf ${CRTTOOL} ${CRTTOOLPATH}/cert_create 11297c4e1eeaSChris Kay $(s)echo 11307c4e1eeaSChris Kay $(s)echo "Built $@ successfully" 11317c4e1eeaSChris Kay $(s)echo 11326f971622SJuan Castillo 11336f971622SJuan Castilloifneq (${GENERATE_COT},0) 1134f02135a3SFabien Lehousselcertificates: ${CRT_DEPS} ${CRTTOOL} ${DTBS} 11357c4e1eeaSChris Kay $(q)${CRTTOOL} ${CRT_ARGS} 11367c4e1eeaSChris Kay $(s)echo 11377c4e1eeaSChris Kay $(s)echo "Built $@ successfully" 11387c4e1eeaSChris Kay $(s)echo "Certificates can be found in ${BUILD_PLAT}" 11397c4e1eeaSChris Kay $(s)echo 1140c5e1da83SJayanth Dodderi Chidanandendif #(GENERATE_COT) 114127713fb4SSoby Mathew 1142d57362bdSXialin Liuifeq (${SEPARATE_BL2_FIP},1) 1143774fb379SBoyan Karatotev${BUILD_PLAT}/${BL2_FIP_NAME}: ${BL2_FIP_DEPS} ${FIPTOOL} | $$(@D)/ 1144d57362bdSXialin Liu $(eval ${CHECK_BL2_FIP_CMD}) 1145d57362bdSXialin Liu $(q)${FIPTOOL} create ${BL2_FIP_ARGS} $@ 1146d57362bdSXialin Liu $(q)${FIPTOOL} info $@ 1147d57362bdSXialin Liu $(s)echo 1148d57362bdSXialin Liu $(s)echo "Built $@ successfully" 1149d57362bdSXialin Liu $(s)echo 1150d57362bdSXialin Liuendif #(SEPARATE_BL2_FIP) 1151d57362bdSXialin Liu 1152774fb379SBoyan Karatotev${BUILD_PLAT}/${FIP_NAME}: ${FIP_DEPS} ${FIPTOOL} | $$(@D)/ 11534727fd13SPali Rohár $(eval ${CHECK_FIP_CMD}) 11547c4e1eeaSChris Kay $(q)${FIPTOOL} create ${FIP_ARGS} $@ 11557c4e1eeaSChris Kay $(q)${FIPTOOL} info $@ 11567c4e1eeaSChris Kay $(s)echo 11577c4e1eeaSChris Kay $(s)echo "Built $@ successfully" 11587c4e1eeaSChris Kay $(s)echo 1159f58ad36fSHarry Liebel 11600191262dSYatharth Kocharifneq (${GENERATE_COT},0) 11610191262dSYatharth Kocharfwu_certificates: ${FWU_CRT_DEPS} ${CRTTOOL} 11627c4e1eeaSChris Kay $(q)${CRTTOOL} ${FWU_CRT_ARGS} 11637c4e1eeaSChris Kay $(s)echo 11647c4e1eeaSChris Kay $(s)echo "Built $@ successfully" 11657c4e1eeaSChris Kay $(s)echo "FWU certificates can be found in ${BUILD_PLAT}" 11667c4e1eeaSChris Kay $(s)echo 1167c5e1da83SJayanth Dodderi Chidanandendif #(GENERATE_COT) 11680191262dSYatharth Kochar 1169d57362bdSXialin Liuifneq (${GENERATE_COT},0) 1170774fb379SBoyan Karatotevbl2_certificates: ${BUILD_PLAT}/${FIP_NAME} ${BL2_CRT_DEPS} ${CRTTOOL} | ${BUILD_PLAT}/ 1171d57362bdSXialin Liu $(q)${CRTTOOL} ${BL2_CRT_ARGS} 1172d57362bdSXialin Liu $(s)echo 1173d57362bdSXialin Liu $(s)echo "Built $@ successfully" 1174d57362bdSXialin Liu $(s)echo "BL2 certificates can be found in ${BUILD_PLAT}" 1175d57362bdSXialin Liu $(s)echo 1176d57362bdSXialin Liuendif #(GENERATE_COT) 1177d57362bdSXialin Liu 1178774fb379SBoyan Karatotev${BUILD_PLAT}/${FWU_FIP_NAME}: ${FWU_FIP_DEPS} ${FIPTOOL} | $$(@D)/ 11794727fd13SPali Rohár $(eval ${CHECK_FWU_FIP_CMD}) 11807c4e1eeaSChris Kay $(q)${FIPTOOL} create ${FWU_FIP_ARGS} $@ 11817c4e1eeaSChris Kay $(q)${FIPTOOL} info $@ 11827c4e1eeaSChris Kay $(s)echo 11837c4e1eeaSChris Kay $(s)echo "Built $@ successfully" 11847c4e1eeaSChris Kay $(s)echo 11850191262dSYatharth Kochar 118673c99d4eSJuan Castillofiptool: ${FIPTOOL} 1187d57362bdSXialin Liuifeq (${SEPARATE_BL2_FIP},1) 1188d57362bdSXialin Liubl2_fip: ${BUILD_PLAT}/${BL2_FIP_NAME} 1189d57362bdSXialin Liufip: bl2_fip 1190d57362bdSXialin Liuelse 119173c99d4eSJuan Castillofip: ${BUILD_PLAT}/${FIP_NAME} 1192d57362bdSXialin Liuendif #(SEPARATE_BL2_FIP) 11930191262dSYatharth Kocharfwu_fip: ${BUILD_PLAT}/${FWU_FIP_NAME} 119473c99d4eSJuan Castillo 1195cbd6cec3SBoyan Karatotev# symlink for compatibility before tools were in the build directory 1196774fb379SBoyan Karatotev${FIPTOOL}: FORCE | $$(@D)/ 1197cbd6cec3SBoyan Karatotev $(q)${MAKE} PLAT=${PLAT} BUILD_PLAT=$(abspath ${BUILD_PLAT}) CPPFLAGS="-DVERSION='\"${VERSION_STRING}\"'" OPENSSL_DIR=${OPENSSL_DIR} DEBUG=${DEBUG} --no-print-directory -C ${FIPTOOLPATH} all 1198cbd6cec3SBoyan Karatotev $(q)ln -sf ${FIPTOOL} ${FIPTOOLPATH}/fiptool 1199f58ad36fSHarry Liebel 1200774fb379SBoyan Karatotev$(BUILD_PLAT)/romlib/romlib.bin $(BUILD_PLAT)/lib/libwrappers.a $&: $(BUILD_PLAT)/lib/libfdt.a $(BUILD_PLAT)/lib/libc.a $(CRYPTO_LIB) | $$(@D)/ 1201*6e2fe623SLauren Wehrmeister $(q)${MAKE} PLAT_DIR=${PLAT_DIR} BUILD_PLAT=${BUILD_PLAT} ENABLE_BTI=${ENABLE_BTI} CRYPTO_LIB=$(CRYPTO_LIB) ARM_ARCH_MINOR=${ARM_ARCH_MINOR} INCLUDES=$(call escape-shell,$(INCLUDES)) DEFINES=$(call escape-shell,$(DEFINES)) --no-print-directory -C ${ROMLIBPATH} all 12025accce5bSRoberto Vargas 1203cfe83910SLouis Mayencourtmemmap: all 1204c25405d6SChris Kay $(if $(host-poetry),$(q)poetry -q install --no-root) 12054aa3f18dSChris Kay $(q)$(if $(host-poetry),poetry run )memory --root ${BUILD_PLAT} symbols 1206cfe83910SLouis Mayencourt 12072329e22bSHarrison Mutaitl: ${BUILD_PLAT}/tl.bin 1208774fb379SBoyan Karatotev${BUILD_PLAT}/tl.bin: ${HW_CONFIG} | $$(@D)/ 1209c25405d6SChris Kay $(if $(host-poetry),$(q)poetry -q install --no-root) 1210d2867397SChris Kay $(q)$(if $(host-poetry),poetry run )tlc create --fdt $< -s ${FW_HANDOFF_SIZE} $@ 12112329e22bSHarrison Mutai 12126de32378SMadhukar Pappireddydoc: 12137c4e1eeaSChris Kay $(s)echo " BUILD DOCUMENTATION" 1214c61c9a31SHarrison Mutai $(if $(host-poetry),$(q)poetry -q install --with docs --no-root) 1215725a80d7SBoyan Karatotev $(q)$(if $(host-poetry),poetry run )${MAKE} --no-print-directory -C ${DOCS_PATH} BUILDDIR=$(abspath ${BUILD_BASE}/docs) html 12166de32378SMadhukar Pappireddy 121790aa901fSSumit Gargenctool: ${ENCTOOL} 121890aa901fSSumit Garg 1219774fb379SBoyan Karatotev${ENCTOOL}: FORCE | $$(@D)/ 122096fbe884SBoyan Karatotev $(q)${MAKE} PLAT=${PLAT} BUILD_PLAT=$(abspath ${BUILD_PLAT}) BUILD_INFO=0 OPENSSL_DIR=${OPENSSL_DIR} DEBUG=${DEBUG} --no-print-directory -C ${ENCTOOLPATH} all 12217c4e1eeaSChris Kay $(s)echo 12227c4e1eeaSChris Kay $(s)echo "Built $@ successfully" 12237c4e1eeaSChris Kay $(s)echo 122490aa901fSSumit Garg 122535fab8c9SJoakim Bechcscope: 12267c4e1eeaSChris Kay $(s)echo " CSCOPE" 12277c4e1eeaSChris Kay $(q)find ${CURDIR} -name "*.[chsS]" > cscope.files 12287c4e1eeaSChris Kay $(q)cscope -b -q -k 122935fab8c9SJoakim Bech 123072ee3314SRyan Harkinhelp: 12317c4e1eeaSChris Kay $(s)echo "usage: ${MAKE} [PLAT=<platform>] [OPTIONS] [TARGET]" 12327c4e1eeaSChris Kay $(s)echo "" 12337c4e1eeaSChris Kay $(s)echo "PLAT is used to specify which platform you wish to build." 12347c4e1eeaSChris Kay $(s)echo "If no platform is specified, PLAT defaults to: ${DEFAULT_PLAT}" 12357c4e1eeaSChris Kay $(s)echo "" 12367c4e1eeaSChris Kay $(s)echo "platform = ${PLATFORM_LIST}" 12377c4e1eeaSChris Kay $(s)echo "" 12387c4e1eeaSChris Kay $(s)echo "Please refer to the User Guide for a list of all supported options." 12397c4e1eeaSChris Kay $(s)echo "Note that the build system doesn't track dependencies for build " 12407c4e1eeaSChris Kay $(s)echo "options. Therefore, if any of the build options are changed " 12417c4e1eeaSChris Kay $(s)echo "from a previous build, a clean build must be performed." 12427c4e1eeaSChris Kay $(s)echo "" 12437c4e1eeaSChris Kay $(s)echo "Supported Targets:" 12447c4e1eeaSChris Kay $(s)echo " all Build all individual bootloader binaries" 12457c4e1eeaSChris Kay $(s)echo " bl1 Build the BL1 binary" 12467c4e1eeaSChris Kay $(s)echo " bl2 Build the BL2 binary" 12477c4e1eeaSChris Kay $(s)echo " bl2u Build the BL2U binary" 12487c4e1eeaSChris Kay $(s)echo " bl31 Build the BL31 binary" 12497c4e1eeaSChris Kay $(s)echo " bl32 Build the BL32 binary. If ARCH=aarch32, then " 12507c4e1eeaSChris Kay $(s)echo " this builds secure payload specified by AARCH32_SP" 12517c4e1eeaSChris Kay $(s)echo " certificates Build the certificates (requires 'GENERATE_COT=1')" 12527c4e1eeaSChris Kay $(s)echo " fip Build the Firmware Image Package (FIP)" 12537c4e1eeaSChris Kay $(s)echo " fwu_fip Build the FWU Firmware Image Package (FIP)" 12547c4e1eeaSChris Kay $(s)echo " checkcodebase Check the coding style of the entire source tree" 12557c4e1eeaSChris Kay $(s)echo " checkpatch Check the coding style on changes in the current" 12567c4e1eeaSChris Kay $(s)echo " branch against BASE_COMMIT (default origin/master)" 12577c4e1eeaSChris Kay $(s)echo " clean Clean the build for the selected platform" 12587c4e1eeaSChris Kay $(s)echo " cscope Generate cscope index" 12597c4e1eeaSChris Kay $(s)echo " distclean Remove all build artifacts for all platforms" 12607c4e1eeaSChris Kay $(s)echo " certtool Build the Certificate generation tool" 12617c4e1eeaSChris Kay $(s)echo " enctool Build the Firmware encryption tool" 12627c4e1eeaSChris Kay $(s)echo " fiptool Build the Firmware Image Package (FIP) creation tool" 12637c4e1eeaSChris Kay $(s)echo " sp Build the Secure Partition Packages" 12647c4e1eeaSChris Kay $(s)echo " sptool Build the Secure Partition Package creation tool" 12657c4e1eeaSChris Kay $(s)echo " dtbs Build the Device Tree Blobs (if required for the platform)" 12667c4e1eeaSChris Kay $(s)echo " memmap Print the memory map of the built binaries" 12677c4e1eeaSChris Kay $(s)echo " doc Build html based documentation using Sphinx tool" 12687c4e1eeaSChris Kay $(s)echo "" 12697c4e1eeaSChris Kay $(s)echo "Note: most build targets require PLAT to be set to a specific platform." 12707c4e1eeaSChris Kay $(s)echo "" 12717c4e1eeaSChris Kay $(s)echo "example: build all targets for the FVP platform:" 12727c4e1eeaSChris Kay $(s)echo " CROSS_COMPILE=aarch64-none-elf- make PLAT=fvp all" 1273a9812206SPali Rohár 1274a9812206SPali Rohár.PHONY: FORCE 1275a9812206SPali RohárFORCE:; 1276