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 34422b181fSYann GautierPLAT := ${DEFAULT_PLAT} 351b2fb6adSAndrey Skvortsovinclude ${MAKE_HELPERS_DIRECTORY}plat_helpers.mk 361b2fb6adSAndrey Skvortsov 371b2fb6adSAndrey Skvortsov# To be able to set platform specific defaults 381b2fb6adSAndrey Skvortsovifneq ($(PLAT_DEFAULTS_MAKEFILE_FULL),) 391b2fb6adSAndrey Skvortsovinclude ${PLAT_DEFAULTS_MAKEFILE_FULL} 401b2fb6adSAndrey Skvortsovendif 41872be88aSdp-arm 42cc277de8SChris Kay################################################################################ 43cc277de8SChris Kay# Configure the toolchains used to build TF-A and its tools 44cc277de8SChris Kay################################################################################ 45cc277de8SChris Kay 46cc277de8SChris Kayinclude ${MAKE_HELPERS_DIRECTORY}toolchain.mk 47cc277de8SChris Kay 48cc8b5632SAntonio Nino Diaz# Assertions enabled for DEBUG builds by default 49cc8b5632SAntonio Nino DiazENABLE_ASSERTIONS := ${DEBUG} 502fae4b1eSJeenu ViswambharanENABLE_PMF := ${ENABLE_RUNTIME_INSTRUMENTATION} 5173c99d4eSJuan Castillo 5273c99d4eSJuan Castillo################################################################################ 5373c99d4eSJuan Castillo# Checkpatch script options 5473c99d4eSJuan Castillo################################################################################ 5573c99d4eSJuan Castillo 56f607739cSSandrine BailleuxCHECKCODE_ARGS := --no-patch 57f0b489c1SDan Handley# Do not check the coding style on imported library files or documentation files 584501843fSGilad Ben-YossefINC_DRV_DIRS_TO_CHECK := $(sort $(filter-out \ 594501843fSGilad Ben-Yossef include/drivers/arm, \ 604501843fSGilad Ben-Yossef $(wildcard include/drivers/*))) 61f0b489c1SDan HandleyINC_LIB_DIRS_TO_CHECK := $(sort $(filter-out \ 621a41e8c1SDan Handley include/lib/libfdt \ 6361f72a34SRoberto Vargas include/lib/libc, \ 64f0b489c1SDan Handley $(wildcard include/lib/*))) 65f0b489c1SDan HandleyINC_DIRS_TO_CHECK := $(sort $(filter-out \ 664501843fSGilad Ben-Yossef include/lib \ 674501843fSGilad Ben-Yossef include/drivers, \ 68f0b489c1SDan Handley $(wildcard include/*))) 69f0b489c1SDan HandleyLIB_DIRS_TO_CHECK := $(sort $(filter-out \ 70d801fbb0Sdp-arm lib/compiler-rt \ 7155cdcf75SAntonio Nino Diaz lib/libfdt% \ 7261f72a34SRoberto Vargas lib/libc, \ 73a194255dSDaniel Boulby lib/zlib \ 74f0b489c1SDan Handley $(wildcard lib/*))) 75f0b489c1SDan HandleyROOT_DIRS_TO_CHECK := $(sort $(filter-out \ 76f0b489c1SDan Handley lib \ 77f0b489c1SDan Handley include \ 78f0b489c1SDan Handley docs \ 791ef35512SPaul Beesley %.rst, \ 80f0b489c1SDan Handley $(wildcard *))) 81f0b489c1SDan HandleyCHECK_PATHS := ${ROOT_DIRS_TO_CHECK} \ 82f0b489c1SDan Handley ${INC_DIRS_TO_CHECK} \ 83f0b489c1SDan Handley ${INC_LIB_DIRS_TO_CHECK} \ 844501843fSGilad Ben-Yossef ${LIB_DIRS_TO_CHECK} \ 854501843fSGilad Ben-Yossef ${INC_DRV_DIRS_TO_CHECK} \ 864501843fSGilad Ben-Yossef ${INC_ARM_DIRS_TO_CHECK} 8736eaaf37SIan Spray 8873c99d4eSJuan Castillo################################################################################ 8973c99d4eSJuan Castillo# Process build options 9073c99d4eSJuan Castillo################################################################################ 9173c99d4eSJuan Castillo 927c4e1eeaSChris Kayifeq ($(verbose),) 9336eaaf37SIan Spray CHECKCODE_ARGS += --no-summary --terse 944f6ad66aSAchin Guptaendif 95ee1ba6d4SAndre Przywara 9673c99d4eSJuan Castillo################################################################################ 97c5e1da83SJayanth Dodderi Chidanand# Auxiliary tools (fiptool, cert_create, etc) 98c5e1da83SJayanth Dodderi Chidanand################################################################################ 99c5e1da83SJayanth Dodderi Chidanand 100c5e1da83SJayanth Dodderi Chidanand# Variables for use with Certificate Generation Tool 101c5e1da83SJayanth Dodderi ChidanandCRTTOOLPATH ?= tools/cert_create 102*f4595e6eSBoyan KaratotevCRTTOOL ?= ${BUILD_PLAT}/${CRTTOOLPATH}/cert_create$(.exe) 103c5e1da83SJayanth Dodderi Chidanand 104c5e1da83SJayanth Dodderi Chidanand# Variables for use with Firmware Encryption Tool 105c5e1da83SJayanth Dodderi ChidanandENCTOOLPATH ?= tools/encrypt_fw 10696fbe884SBoyan KaratotevENCTOOL ?= ${BUILD_PLAT}/${ENCTOOLPATH}/encrypt_fw$(.exe) 107c5e1da83SJayanth Dodderi Chidanand 108c5e1da83SJayanth Dodderi Chidanand# Variables for use with Firmware Image Package 109c5e1da83SJayanth Dodderi ChidanandFIPTOOLPATH ?= tools/fiptool 110cbd6cec3SBoyan KaratotevFIPTOOL ?= ${BUILD_PLAT}/${FIPTOOLPATH}/fiptool$(.exe) 111c5e1da83SJayanth Dodderi Chidanand 112c5e1da83SJayanth Dodderi Chidanand# Variables for use with sptool 113c5e1da83SJayanth Dodderi ChidanandSPTOOLPATH ?= tools/sptool 114c5e1da83SJayanth Dodderi ChidanandSPTOOL ?= ${SPTOOLPATH}/sptool.py 115c5e1da83SJayanth Dodderi ChidanandSP_MK_GEN ?= ${SPTOOLPATH}/sp_mk_generator.py 11620629b31SKarl MeakinSP_DTS_LIST_FRAGMENT ?= ${BUILD_PLAT}/sp_list_fragment.dts 117c5e1da83SJayanth Dodderi Chidanand 1180fe374efSJ-Alves# Variables for use with sptool 1190fe374efSJ-AlvesTLCTOOL ?= poetry run tlc 1200fe374efSJ-Alves 121c5e1da83SJayanth Dodderi Chidanand# Variables for use with ROMLIB 122c5e1da83SJayanth Dodderi ChidanandROMLIBPATH ?= lib/romlib 123c5e1da83SJayanth Dodderi Chidanand 124c5e1da83SJayanth Dodderi Chidanand# Variable for use with Python 125c5e1da83SJayanth Dodderi ChidanandPYTHON ?= python3 126c5e1da83SJayanth Dodderi Chidanand 127c5e1da83SJayanth Dodderi Chidanand# Variables for use with documentation build using Sphinx tool 128c5e1da83SJayanth Dodderi ChidanandDOCS_PATH ?= docs 129c5e1da83SJayanth Dodderi Chidanand 130c5e1da83SJayanth Dodderi Chidanand################################################################################ 131c5e1da83SJayanth Dodderi Chidanand# Compiler Configuration based on ARCH_MAJOR and ARCH_MINOR flags 132c5e1da83SJayanth Dodderi Chidanand################################################################################ 13326e63c44SEtienne Carriereifeq (${ARM_ARCH_MAJOR},7) 13426e63c44SEtienne Carriere target32-directive = -target arm-none-eabi 135d4089fb8SGovindraj Raja# Will set march-directive from platform configuration 13626e63c44SEtienne Carriereelse 13726e63c44SEtienne Carriere target32-directive = -target armv8a-none-eabi 138c5e1da83SJayanth Dodderi Chidanandendif #(ARM_ARCH_MAJOR) 139c5e1da83SJayanth Dodderi Chidanand 1408620bd0bSChris Kayifneq ($(filter %-clang,$($(ARCH)-cc-id)),) 1418620bd0bSChris Kay ifeq ($($(ARCH)-cc-id),arm-clang) 1427794d6c8SGovindraj Raja TF_CFLAGS_aarch32 := -target arm-arm-none-eabi 1437794d6c8SGovindraj Raja TF_CFLAGS_aarch64 := -target aarch64-arm-none-eabi 144c8a992fdSorigin else 1457794d6c8SGovindraj Raja TF_CFLAGS_aarch32 = $(target32-directive) 146af8947feSYann Gautier TF_CFLAGS_aarch64 := -target aarch64-unknown-none-elf 147641f16e7SAmbroise Vincent endif 148c8a992fdSorigin 1498620bd0bSChris Kayelse ifeq ($($(ARCH)-cc-id),gnu-gcc) 150edbce9aaSzelalem-aweke # Enable LTO only for aarch64 151edbce9aaSzelalem-aweke ifeq (${ARCH},aarch64) 152fa402f38SChris Kay LTO_CFLAGS = $(if $(filter-out 0,$(ENABLE_LTO)),-flto) 153edbce9aaSzelalem-aweke endif 154c5e1da83SJayanth Dodderi Chidanandendif #(clang) 155d5461857Sdp-arm 15632b209bfSAhmad Fatoum# Process Debug flag 15732b209bfSAhmad Fatoumifneq (${DEBUG}, 0) 15832b209bfSAhmad Fatoum BUILD_TYPE := debug 1594466cf82SDaniel Boulby TF_CFLAGS += -g -gdwarf-4 1604466cf82SDaniel Boulby ASFLAGS += -g -Wa,-gdwarf-4 16132b209bfSAhmad Fatoum 16232b209bfSAhmad Fatoum # Use LOG_LEVEL_INFO by default for debug builds 16332b209bfSAhmad Fatoum LOG_LEVEL := 40 16432b209bfSAhmad Fatoumelse 16532b209bfSAhmad Fatoum BUILD_TYPE := release 16632b209bfSAhmad Fatoum # Use LOG_LEVEL_NOTICE by default for release builds 16732b209bfSAhmad Fatoum LOG_LEVEL := 20 168c5e1da83SJayanth Dodderi Chidanandendif #(Debug) 16932b209bfSAhmad Fatoum 170f1de4c8fSPeiyuan Song# Default build string (git branch and commit) 171f1de4c8fSPeiyuan Songifeq (${BUILD_STRING},) 172f1de4c8fSPeiyuan Song BUILD_STRING := $(shell git describe --always --dirty --tags 2> /dev/null) 173f1de4c8fSPeiyuan Songendif 174dddf4283Slaurenw-armVERSION_STRING := v${VERSION}(${BUILD_TYPE}):${BUILD_STRING} 175f1de4c8fSPeiyuan Song 1768fd9d4d5SAntonio Nino Diazifeq (${AARCH32_INSTRUCTION_SET},A32) 1778fd9d4d5SAntonio Nino Diaz TF_CFLAGS_aarch32 += -marm 1788fd9d4d5SAntonio Nino Diazelse ifeq (${AARCH32_INSTRUCTION_SET},T32) 1798fd9d4d5SAntonio Nino Diaz TF_CFLAGS_aarch32 += -mthumb 180c5e1da83SJayanth Dodderi Chidanandendif #(AARCH32_INSTRUCTION_SET) 1818fd9d4d5SAntonio Nino Diaz 182a9c4dde3SSandrine BailleuxTF_CFLAGS_aarch32 += -mno-unaligned-access 183d5461857Sdp-armTF_CFLAGS_aarch64 += -mgeneral-regs-only -mstrict-align 1849d29c227SSoby Mathew 185c5e1da83SJayanth Dodderi Chidanand############################################################################## 186c5e1da83SJayanth Dodderi Chidanand# WARNINGS Configuration 187c5e1da83SJayanth Dodderi Chidanand############################################################################### 1889ab81b5eSJustin Chadwell# General warnings 1899ab81b5eSJustin ChadwellWARNINGS := -Wall -Wmissing-include-dirs -Wunused \ 190b7f6525dSJustin Chadwell -Wdisabled-optimization -Wvla -Wshadow \ 191d75a9ecdSBoyan Karatotev -Wredundant-decls 192d75a9ecdSBoyan Karatotev# stricter warnings 193d75a9ecdSBoyan KaratotevWARNINGS += -Wextra -Wno-trigraphs 194d75a9ecdSBoyan Karatotev# too verbose for generic build 195d75a9ecdSBoyan KaratotevWARNINGS += -Wno-missing-field-initializers \ 196d75a9ecdSBoyan Karatotev -Wno-type-limits -Wno-sign-compare \ 197d75a9ecdSBoyan Karatotev# on clang this flag gets reset if -Wextra is set after it. No difference on gcc 198d75a9ecdSBoyan KaratotevWARNINGS += -Wno-unused-parameter 1999ab81b5eSJustin Chadwell 2009ab81b5eSJustin Chadwell# Additional warnings 201d75a9ecdSBoyan Karatotev# Level 1 - infrequent warnings we should have none of 202d75a9ecdSBoyan Karatotev# full -Wextra 203d75a9ecdSBoyan KaratotevWARNING1 += -Wsign-compare 204d75a9ecdSBoyan KaratotevWARNING1 += -Wtype-limits 205d75a9ecdSBoyan KaratotevWARNING1 += -Wmissing-field-initializers 206e7c645b5SYann Gautier 207d75a9ecdSBoyan Karatotev# Level 2 - problematic warnings that we want 208d75a9ecdSBoyan Karatotev# zlib, compiler-rt, coreboot, and mbdedtls blow up with these 209d75a9ecdSBoyan Karatotev# TODO: disable just for them and move into default build 210d75a9ecdSBoyan KaratotevWARNING2 += -Wold-style-definition 211d75a9ecdSBoyan KaratotevWARNING2 += -Wmissing-prototypes 212d75a9ecdSBoyan KaratotevWARNING2 += -Wmissing-format-attribute 213d75a9ecdSBoyan Karatotev# TF-A aims to comply with this eventually. Effort too large at present 214d75a9ecdSBoyan KaratotevWARNING2 += -Wundef 215d141e638SBoyan Karatotev# currently very involved and many platforms set this off 216d141e638SBoyan KaratotevWARNING2 += -Wunused-const-variable=2 217e7c645b5SYann Gautier 218d75a9ecdSBoyan Karatotev# Level 3 - very pedantic, frequently ignored 219e7c645b5SYann GautierWARNING3 := -Wbad-function-cast 220d75a9ecdSBoyan KaratotevWARNING3 += -Waggregate-return 221d75a9ecdSBoyan KaratotevWARNING3 += -Wnested-externs 222d75a9ecdSBoyan KaratotevWARNING3 += -Wcast-align 223e7c645b5SYann GautierWARNING3 += -Wcast-qual 224e7c645b5SYann GautierWARNING3 += -Wconversion 225e7c645b5SYann GautierWARNING3 += -Wpacked 226e7c645b5SYann GautierWARNING3 += -Wpointer-arith 227e7c645b5SYann GautierWARNING3 += -Wswitch-default 228e7c645b5SYann Gautier 229d75a9ecdSBoyan Karatotev# Setting W is quite verbose and most warnings will be pre-existing issues 230d75a9ecdSBoyan Karatotev# outside of the contributor's control. Don't fail the build on them so warnings 231d75a9ecdSBoyan Karatotev# can be seen and hopefully addressed 232d75a9ecdSBoyan Karatotevifdef W 233d75a9ecdSBoyan Karatotev ifneq (${W},0) 234d75a9ecdSBoyan Karatotev E ?= 0 235d75a9ecdSBoyan Karatotev endif 236d75a9ecdSBoyan Karatotevendif 237d75a9ecdSBoyan Karatotev 238e7c645b5SYann Gautierifeq (${W},1) 2399ab81b5eSJustin Chadwell WARNINGS += $(WARNING1) 240e7c645b5SYann Gautierelse ifeq (${W},2) 2419ab81b5eSJustin Chadwell WARNINGS += $(WARNING1) $(WARNING2) 242e7c645b5SYann Gautierelse ifeq (${W},3) 2439ab81b5eSJustin Chadwell WARNINGS += $(WARNING1) $(WARNING2) $(WARNING3) 244c5e1da83SJayanth Dodderi Chidanandendif #(W) 245e7c645b5SYann Gautier 2469ab81b5eSJustin Chadwell# Compiler specific warnings 2478620bd0bSChris Kayifeq ($(filter %-clang,$($(ARCH)-cc-id)),) 24893c690ebSJustin Chadwell# not using clang 249d7b4cd41SJustin ChadwellWARNINGS += -Wunused-but-set-variable -Wmaybe-uninitialized \ 250d7b4cd41SJustin Chadwell -Wpacked-bitfield-compat -Wshift-overflow=2 \ 251d7b4cd41SJustin Chadwell -Wlogical-op 252dea23e24SGovindraj Raja 253dea23e24SGovindraj Raja# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523 254316f5c97SBoyan KaratotevTF_CFLAGS_MIN_PAGE_SIZE := $(call cc_option, --param=min-pagesize=0) 255316f5c97SBoyan KaratotevTF_CFLAGS += $(TF_CFLAGS_MIN_PAGE_SIZE) 256dea23e24SGovindraj Raja 257538516f5SBipin Raviifeq ($(HARDEN_SLS), 1) 258316f5c97SBoyan Karatotev TF_CFLAGS_MHARDEN_SLS := $(call cc_option, -mharden-sls=all) 259316f5c97SBoyan Karatotev TF_CFLAGS_aarch64 += $(TF_CFLAGS_MHARDEN_SLS) 260538516f5SBipin Raviendif 261538516f5SBipin Ravi 26293c690ebSJustin Chadwellelse 26393c690ebSJustin Chadwell# using clang 264d7b4cd41SJustin ChadwellWARNINGS += -Wshift-overflow -Wshift-sign-overflow \ 265d7b4cd41SJustin Chadwell -Wlogical-op-parentheses 266c5e1da83SJayanth Dodderi Chidanandendif #(Clang Warning) 26700296576SAmbroise Vincent 2686336b07aSYann Gautierifneq (${E},0) 2696336b07aSYann Gautier ERRORS := -Werror 270c5e1da83SJayanth Dodderi Chidanandendif #(E) 2716336b07aSYann Gautier 272c5e1da83SJayanth Dodderi Chidanand################################################################################ 273c5e1da83SJayanth Dodderi Chidanand# Compiler and Linker Directives 274c5e1da83SJayanth Dodderi Chidanand################################################################################ 275ea7a57a3SRoberto VargasCPPFLAGS = ${DEFINES} ${INCLUDES} ${MBEDTLS_INC} -nostdinc \ 2769ab81b5eSJustin Chadwell $(ERRORS) $(WARNINGS) 277d4089fb8SGovindraj RajaASFLAGS += $(CPPFLAGS) \ 278d5dfdeb6SJulius Werner -ffreestanding -Wa,--fatal-warnings 27959de5096SMasahiro YamadaTF_CFLAGS += $(CPPFLAGS) $(TF_CFLAGS_$(ARCH)) \ 280ebd6efaeSSamuel Holland -ffunction-sections -fdata-sections \ 281ee0c5b8cSBoyan Karatotev -ffreestanding -fno-common \ 282ebd6efaeSSamuel Holland -Os -std=gnu99 28373c99d4eSJuan Castillo 2841f461979SJustin Chadwellifeq (${SANITIZE_UB},on) 2851f461979SJustin Chadwell TF_CFLAGS += -fsanitize=undefined -fno-sanitize-recover 286c5e1da83SJayanth Dodderi Chidanandendif #(${SANITIZE_UB},on) 287c5e1da83SJayanth Dodderi Chidanand 2881f461979SJustin Chadwellifeq (${SANITIZE_UB},trap) 2891f461979SJustin Chadwell TF_CFLAGS += -fsanitize=undefined -fno-sanitize-recover \ 2901f461979SJustin Chadwell -fsanitize-undefined-trap-on-error 291c5e1da83SJayanth Dodderi Chidanandendif #(${SANITIZE_UB},trap) 2921f461979SJustin Chadwell 293291e7182SChris KayGCC_V_OUTPUT := $(if $($(ARCH)-cc),$(shell $($(ARCH)-cc) -v 2>&1)) 294f7ec31dbSdavid cunado 2951f49db5fSMarco FelschTF_LDFLAGS += -z noexecstack 2961f49db5fSMarco Felsch 297641f16e7SAmbroise Vincent# LD = armlink 2988620bd0bSChris Kayifeq ($($(ARCH)-ld-id),arm-link) 299c2ad38ceSVarun Wadekar TF_LDFLAGS += --diag_error=warning --lto_level=O1 300c2ad38ceSVarun Wadekar TF_LDFLAGS += --remove --info=unused,unusedsymbols 301edbce9aaSzelalem-aweke TF_LDFLAGS += $(TF_LDFLAGS_$(ARCH)) 302641f16e7SAmbroise Vincent 303641f16e7SAmbroise Vincent# LD = gcc (used when GCC LTO is enabled) 3048620bd0bSChris Kayelse ifeq ($($(ARCH)-ld-id),gnu-gcc) 305edbce9aaSzelalem-aweke # Pass ld options with Wl or Xlinker switches 30686e489c1SChris Kay TF_LDFLAGS += $(call ld_option,-Xlinker --no-warn-rwx-segments) 307edbce9aaSzelalem-aweke TF_LDFLAGS += -Wl,--fatal-warnings -O1 308edbce9aaSzelalem-aweke TF_LDFLAGS += -Wl,--gc-sections 309ac98b82aSChris Kay 310ac98b82aSChris Kay TF_LDFLAGS += -Wl,-z,common-page-size=4096 #Configure page size constants 311ac98b82aSChris Kay TF_LDFLAGS += -Wl,-z,max-page-size=4096 312304ad94bSAndrey Skvortsov TF_LDFLAGS += -Wl,--build-id=none 313ac98b82aSChris Kay 314edbce9aaSzelalem-aweke ifeq ($(ENABLE_LTO),1) 315edbce9aaSzelalem-aweke ifeq (${ARCH},aarch64) 316edbce9aaSzelalem-aweke TF_LDFLAGS += -flto -fuse-linker-plugin 31731f80efeSAndrey Skvortsov TF_LDFLAGS += -flto-partition=one 318edbce9aaSzelalem-aweke endif 319c5e1da83SJayanth Dodderi Chidanand endif #(ENABLE_LTO) 320c5e1da83SJayanth Dodderi Chidanand 321edbce9aaSzelalem-aweke# GCC automatically adds fix-cortex-a53-843419 flag when used to link 322edbce9aaSzelalem-aweke# which breaks some builds, so disable if errata fix is not explicitly enabled 323cfe6767fSYann Gautier ifeq (${ARCH},aarch64) 324edbce9aaSzelalem-aweke ifneq (${ERRATA_A53_843419},1) 325edbce9aaSzelalem-aweke TF_LDFLAGS += -mno-fix-cortex-a53-843419 326edbce9aaSzelalem-aweke endif 327cfe6767fSYann Gautier endif 328edbce9aaSzelalem-aweke TF_LDFLAGS += -nostdlib 329edbce9aaSzelalem-aweke TF_LDFLAGS += $(subst --,-Xlinker --,$(TF_LDFLAGS_$(ARCH))) 330641f16e7SAmbroise Vincent 331641f16e7SAmbroise Vincent# LD = gcc-ld (ld) or llvm-ld (ld.lld) or other 332c2ad38ceSVarun Wadekarelse 3331f49db5fSMarco Felsch# With ld.bfd version 2.39 and newer new warnings are added. Skip those since we 3341f49db5fSMarco Felsch# are not loaded by a elf loader. 3351f49db5fSMarco Felsch TF_LDFLAGS += $(call ld_option, --no-warn-rwx-segments) 336ebac6922SYabin Cui TF_LDFLAGS += -O1 337c2b8806fSDouglas Raillard TF_LDFLAGS += --gc-sections 338ac98b82aSChris Kay 339ac98b82aSChris Kay TF_LDFLAGS += -z common-page-size=4096 # Configure page size constants 340ac98b82aSChris Kay TF_LDFLAGS += -z max-page-size=4096 341304ad94bSAndrey Skvortsov TF_LDFLAGS += --build-id=none 342ac98b82aSChris Kay 343641f16e7SAmbroise Vincent# ld.lld doesn't recognize the errata flags, 344ebac6922SYabin Cui# therefore don't add those in that case. 345ebac6922SYabin Cui# ld.lld reports section type mismatch warnings, 346ebac6922SYabin Cui# therefore don't add --fatal-warnings to it. 3478620bd0bSChris Kay ifneq ($($(ARCH)-ld-id),llvm-lld) 348ebac6922SYabin Cui TF_LDFLAGS += $(TF_LDFLAGS_$(ARCH)) --fatal-warnings 349edbce9aaSzelalem-aweke endif 350c5e1da83SJayanth Dodderi Chidanand 351c5e1da83SJayanth Dodderi Chidanandendif #(LD = armlink) 35273c99d4eSJuan Castillo 35373c99d4eSJuan Castillo################################################################################ 354f5211420SGovindraj Raja# Setup ARCH_MAJOR/MINOR before parsing arch_features. 355f5211420SGovindraj Raja################################################################################ 356f5211420SGovindraj Rajaifeq (${ENABLE_RME},1) 3577d5fc98fSAlexeiFedorov ARM_ARCH_MAJOR := 9 3587d5fc98fSAlexeiFedorov ARM_ARCH_MINOR := 2 359f5211420SGovindraj Rajaendif 360f5211420SGovindraj Raja 361f5211420SGovindraj Raja################################################################################ 36273c99d4eSJuan Castillo# Common sources and include directories 36373c99d4eSJuan Castillo################################################################################ 364d801fbb0Sdp-arminclude lib/compiler-rt/compiler-rt.mk 36573c99d4eSJuan Castillo 366758ccb80SChris Kay# Allow overriding the timestamp, for example for reproducible builds, or to 367758ccb80SChris Kay# synchronize timestamps across multiple projects. 368758ccb80SChris Kay# This must be set to a C string (including quotes where applicable). 369758ccb80SChris KayBUILD_MESSAGE_TIMESTAMP ?= __TIME__", "__DATE__ 370758ccb80SChris Kay 371758ccb80SChris KayDEFINES += -DBUILD_MESSAGE_TIMESTAMP='$(BUILD_MESSAGE_TIMESTAMP)' 372758ccb80SChris KayDEFINES += -DBUILD_MESSAGE_VERSION_STRING='"$(VERSION_STRING)"' 373758ccb80SChris KayDEFINES += -DBUILD_MESSAGE_VERSION='"$(VERSION)"' 374758ccb80SChris Kay 37573c99d4eSJuan CastilloBL_COMMON_SOURCES += common/bl_common.c \ 3767f56e9a3SSoby Mathew common/tf_log.c \ 3779d29c227SSoby Mathew common/${ARCH}/debug.S \ 37891b48c9fSJulius Werner drivers/console/multi_console.c \ 3799d29c227SSoby Mathew lib/${ARCH}/cache_helpers.S \ 3809d29c227SSoby Mathew lib/${ARCH}/misc_helpers.S \ 381c73686a1SBoyan Karatotev lib/extensions/pmuv3/${ARCH}/pmuv3.c \ 382566034fcSSoby Mathew plat/common/plat_bl_common.c \ 3837f56e9a3SSoby Mathew plat/common/plat_log_common.c \ 38475311203Sdp-arm plat/common/${ARCH}/plat_common.c \ 3859d29c227SSoby Mathew plat/common/${ARCH}/platform_helpers.S \ 38661f72a34SRoberto Vargas ${COMPILER_RT_SRCS} 387d7a6b0f8SRyan Harkin 3888620bd0bSChris Kayifeq ($($(ARCH)-cc-id),arm-clang) 3898422a840SAntonio Nino Diaz BL_COMMON_SOURCES += lib/${ARCH}/armclang_printf.S 3908422a840SAntonio Nino Diazendif 3918422a840SAntonio Nino Diaz 3921f461979SJustin Chadwellifeq (${SANITIZE_UB},on) 3931f461979SJustin Chadwell BL_COMMON_SOURCES += plat/common/ubsan.c 3941f461979SJustin Chadwellendif 3951f461979SJustin Chadwell 39601d237cbSYann GautierINCLUDES += -Iinclude \ 397f5478dedSAntonio Nino Diaz -Iinclude/arch/${ARCH} \ 39809d40e0eSAntonio Nino Diaz -Iinclude/lib/cpus/${ARCH} \ 39909d40e0eSAntonio Nino Diaz -Iinclude/lib/el3_runtime/${ARCH} \ 40009d40e0eSAntonio Nino Diaz ${PLAT_INCLUDES} \ 40109d40e0eSAntonio Nino Diaz ${SPD_INCLUDES} 40209d40e0eSAntonio Nino Diaz 403e03dcc8fSNishant SharmaDTC_FLAGS += -I dts -O dtb 404e03dcc8fSNishant SharmaDTC_CPPFLAGS += -P -nostdinc $(INCLUDES) -Ifdts -undef \ 405e03dcc8fSNishant Sharma -x assembler-with-cpp $(DEFINES) 406e03dcc8fSNishant Sharma 4079c6d1c50SAntonio Nino Diazinclude common/backtrace/backtrace.mk 4089c6d1c50SAntonio Nino Diaz 40973c99d4eSJuan Castillo################################################################################ 4103547270fSGovindraj Raja# Generic definitions 4113547270fSGovindraj Raja################################################################################ 4123547270fSGovindraj Raja 4133547270fSGovindraj Rajaifeq (${BUILD_BASE},) 4143547270fSGovindraj Raja BUILD_BASE := ./build 4153547270fSGovindraj Rajaendif 4163547270fSGovindraj RajaBUILD_PLAT := $(abspath ${BUILD_BASE})/${PLAT}/${BUILD_TYPE} 4173547270fSGovindraj Raja 4183547270fSGovindraj RajaSPDS := $(sort $(filter-out none, $(patsubst services/spd/%,%,$(wildcard services/spd/*)))) 4193547270fSGovindraj Raja 4203547270fSGovindraj Raja# Platforms providing their own TBB makefile may override this value 4213547270fSGovindraj RajaINCLUDE_TBBR_MK := 1 4223547270fSGovindraj Raja 4233547270fSGovindraj Raja################################################################################ 4243547270fSGovindraj Raja# Include SPD Makefile if one has been specified 4253547270fSGovindraj Raja################################################################################ 4263547270fSGovindraj Raja 4273547270fSGovindraj Rajaifneq (${SPD},none) 4283547270fSGovindraj Raja ifeq (${SPD},spmd) 4293547270fSGovindraj Raja # SPMD is located in std_svc directory 4303547270fSGovindraj Raja SPD_DIR := std_svc 4313547270fSGovindraj Raja 4323547270fSGovindraj Raja ifeq ($(SPMD_SPM_AT_SEL2),1) 4333547270fSGovindraj Raja CTX_INCLUDE_EL2_REGS := 1 4343547270fSGovindraj Raja endif 4353547270fSGovindraj Raja 4363547270fSGovindraj Raja ifeq ($(findstring optee_sp,$(ARM_SPMC_MANIFEST_DTS)),optee_sp) 4373547270fSGovindraj Raja DTC_CPPFLAGS += -DOPTEE_SP_FW_CONFIG 4383547270fSGovindraj Raja endif 4393547270fSGovindraj Raja 4400686a01bSArunachalam Ganapathy ifeq ($(findstring trusty_sp,$(ARM_SPMC_MANIFEST_DTS)),trusty_sp) 4410686a01bSArunachalam Ganapathy DTC_CPPFLAGS += -DTRUSTY_SP_FW_CONFIG 4420686a01bSArunachalam Ganapathy endif 4430686a01bSArunachalam Ganapathy 4443547270fSGovindraj Raja ifeq ($(TS_SP_FW_CONFIG),1) 4453547270fSGovindraj Raja DTC_CPPFLAGS += -DTS_SP_FW_CONFIG 4463547270fSGovindraj Raja endif 4473547270fSGovindraj Raja 4483547270fSGovindraj Raja ifneq ($(ARM_BL2_SP_LIST_DTS),) 4493547270fSGovindraj Raja DTC_CPPFLAGS += -DARM_BL2_SP_LIST_DTS=$(ARM_BL2_SP_LIST_DTS) 4503547270fSGovindraj Raja endif 4513547270fSGovindraj Raja 4523547270fSGovindraj Raja ifneq ($(SP_LAYOUT_FILE),) 4533547270fSGovindraj Raja BL2_ENABLE_SP_LOAD := 1 4543547270fSGovindraj Raja endif 4553547270fSGovindraj Raja else 4563547270fSGovindraj Raja # All other SPDs in spd directory 4573547270fSGovindraj Raja SPD_DIR := spd 4583547270fSGovindraj Raja endif #(SPD) 4593547270fSGovindraj Raja 4603547270fSGovindraj Raja # We expect to locate an spd.mk under the specified SPD directory 4613547270fSGovindraj Raja SPD_MAKE := $(wildcard services/${SPD_DIR}/${SPD}/${SPD}.mk) 4623547270fSGovindraj Raja 4633547270fSGovindraj Raja ifeq (${SPD_MAKE},) 4643547270fSGovindraj Raja $(error Error: No services/${SPD_DIR}/${SPD}/${SPD}.mk located) 4653547270fSGovindraj Raja endif 4663547270fSGovindraj Raja $(info Including ${SPD_MAKE}) 4673547270fSGovindraj Raja include ${SPD_MAKE} 4683547270fSGovindraj Raja 4693547270fSGovindraj Raja # If there's BL32 companion for the chosen SPD, we expect that the SPD's 4703547270fSGovindraj Raja # Makefile would set NEED_BL32 to "yes". In this case, the build system 4713547270fSGovindraj Raja # supports two mutually exclusive options: 4723547270fSGovindraj Raja # * BL32 is built from source: then BL32_SOURCES must contain the list 4733547270fSGovindraj Raja # of source files to build BL32 4743547270fSGovindraj Raja # * BL32 is a prebuilt binary: then BL32 must point to the image file 4753547270fSGovindraj Raja # that will be included in the FIP 4763547270fSGovindraj Raja # If both BL32_SOURCES and BL32 are defined, the binary takes precedence 4773547270fSGovindraj Raja # over the sources. 4783547270fSGovindraj Rajaendif #(SPD=none) 4793547270fSGovindraj Raja 4803547270fSGovindraj Raja################################################################################ 481696ed168SOlivier Deprez# Include the platform specific Makefile after the SPD Makefile (the platform 482696ed168SOlivier Deprez# makefile may use all previous definitions in this file) 483696ed168SOlivier Deprez################################################################################ 484696ed168SOlivier Deprezinclude ${PLAT_MAKEFILE_FULL} 485696ed168SOlivier Deprez 486696ed168SOlivier Deprez################################################################################ 4878d9f5f25SBoyan Karatotev# Setup arch_features based on ARM_ARCH_MAJOR, ARM_ARCH_MINOR provided from 4888d9f5f25SBoyan Karatotev# platform. 4898d9f5f25SBoyan Karatotev################################################################################ 4908d9f5f25SBoyan Karatotev 4918d9f5f25SBoyan Karatotevinclude ${MAKE_HELPERS_DIRECTORY}arch_features.mk 4928d9f5f25SBoyan Karatotev################################################################################ 493f5211420SGovindraj Raja# Process BRANCH_PROTECTION value and set 494f5211420SGovindraj Raja# Pointer Authentication and Branch Target Identification flags 495f5211420SGovindraj Raja################################################################################ 496f5211420SGovindraj Rajaifeq (${BRANCH_PROTECTION},0) 497f5211420SGovindraj Raja # Default value turns off all types of branch protection 498f5211420SGovindraj Raja BP_OPTION := none 499f5211420SGovindraj Rajaelse ifneq (${ARCH},aarch64) 500f5211420SGovindraj Raja $(error BRANCH_PROTECTION requires AArch64) 501f5211420SGovindraj Rajaelse ifeq (${BRANCH_PROTECTION},1) 502f5211420SGovindraj Raja # Enables all types of branch protection features 503f5211420SGovindraj Raja BP_OPTION := standard 504f5211420SGovindraj Raja ENABLE_BTI := 1 505f5211420SGovindraj Raja ENABLE_PAUTH := 1 506f5211420SGovindraj Rajaelse ifeq (${BRANCH_PROTECTION},2) 507f5211420SGovindraj Raja # Return address signing to its standard level 508f5211420SGovindraj Raja BP_OPTION := pac-ret 509f5211420SGovindraj Raja ENABLE_PAUTH := 1 510f5211420SGovindraj Rajaelse ifeq (${BRANCH_PROTECTION},3) 511f5211420SGovindraj Raja # Extend the signing to include leaf functions 512f5211420SGovindraj Raja BP_OPTION := pac-ret+leaf 513f5211420SGovindraj Raja ENABLE_PAUTH := 1 514f5211420SGovindraj Rajaelse ifeq (${BRANCH_PROTECTION},4) 515f5211420SGovindraj Raja # Turn on branch target identification mechanism 516f5211420SGovindraj Raja BP_OPTION := bti 517f5211420SGovindraj Raja ENABLE_BTI := 1 5188d9f5f25SBoyan Karatotevelse ifeq (${BRANCH_PROTECTION},5) 5198d9f5f25SBoyan Karatotev # Turn on branch target identification mechanism 5208d9f5f25SBoyan Karatotev BP_OPTION := standard 5218d9f5f25SBoyan Karatotev ENABLE_BTI := 2 5228d9f5f25SBoyan Karatotev ENABLE_PAUTH := 2 523f5211420SGovindraj Rajaelse 524f5211420SGovindraj Raja $(error Unknown BRANCH_PROTECTION value ${BRANCH_PROTECTION}) 525f5211420SGovindraj Rajaendif #(BRANCH_PROTECTION) 526f5211420SGovindraj Raja 5278d9f5f25SBoyan Karatotevifneq ($(ENABLE_PAUTH),0) 5288d9f5f25SBoyan Karatotev CTX_INCLUDE_PAUTH_REGS := ${ENABLE_PAUTH} 529f5211420SGovindraj Rajaendif 530f5211420SGovindraj Rajaifneq (${BP_OPTION},none) 531f5211420SGovindraj Raja TF_CFLAGS_aarch64 += -mbranch-protection=${BP_OPTION} 532f5211420SGovindraj Rajaendif #(BP_OPTION) 533f5211420SGovindraj Raja 534f5211420SGovindraj Raja# Pointer Authentication sources 5358d9f5f25SBoyan Karatotevifneq (${ENABLE_PAUTH},0) 536f5211420SGovindraj Raja# arm/common/aarch64/arm_pauth.c contains a sample platform hook to complete the 537f5211420SGovindraj Raja# Pauth support. As it's not secure, it must be reimplemented for real platforms 5388d9f5f25SBoyan Karatotev BL_COMMON_SOURCES += lib/extensions/pauth/pauth.c 539f5211420SGovindraj Rajaendif 540b14987cfSBoyan Karatotev# 541b14987cfSBoyan Karatotevifneq (${ENABLE_FEAT_PAUTH_LR},0) 542b14987cfSBoyan Karatotev# Currently, FEAT_PAUTH_LR is only supported by arm/clang compilers 543b14987cfSBoyan Karatotev# TODO implement for GCC when support is added 544b14987cfSBoyan Karatotevifeq ($($(ARCH)-cc-id),arm-clang) 545b14987cfSBoyan Karatotev arch-features := $(arch-features)+pauth-lr 546b14987cfSBoyan Karatotevelse 547b14987cfSBoyan Karatotev $(error Error: ENABLE_FEAT_PAUTH_LR not supported for GCC compiler) 548b14987cfSBoyan Karatotevendif 549b14987cfSBoyan Karatotevendif 550f5211420SGovindraj Raja 551f5211420SGovindraj Raja################################################################################ 552f5211420SGovindraj Raja# RME dependent flags configuration, Enable optional features for RME. 553f5211420SGovindraj Raja################################################################################ 554f5211420SGovindraj Raja# FEAT_RME 555f5211420SGovindraj Rajaifeq (${ENABLE_RME},1) 556f5211420SGovindraj Raja # RME requires el2 context to be saved for now. 557f5211420SGovindraj Raja CTX_INCLUDE_EL2_REGS := 1 558f5211420SGovindraj Raja CTX_INCLUDE_AARCH32_REGS := 0 559f5211420SGovindraj Raja CTX_INCLUDE_PAUTH_REGS := 1 560f5211420SGovindraj Raja 561d048af0dSJavier Almansa Sobrino ifneq ($(ENABLE_FEAT_MPAM), 0) 562d048af0dSJavier Almansa Sobrino CTX_INCLUDE_MPAM_REGS := 1 563d048af0dSJavier Almansa Sobrino endif 564d048af0dSJavier Almansa Sobrino 565f5211420SGovindraj Raja # RME enables CSV2_2 extension by default. 566f5211420SGovindraj Raja ENABLE_FEAT_CSV2_2 = 1 567f5211420SGovindraj Rajaendif #(FEAT_RME) 568f5211420SGovindraj Raja 569f5211420SGovindraj Raja################################################################################ 5705b18de09SZelalem Aweke# Include rmmd Makefile if RME is enabled 5715b18de09SZelalem Aweke################################################################################ 5725b18de09SZelalem Awekeifneq (${ENABLE_RME},0) 5735b18de09SZelalem Awekeinclude services/std_svc/rmmd/rmmd.mk 5745b18de09SZelalem Aweke$(warning "RME is an experimental feature") 5755b18de09SZelalem Awekeendif 5765b18de09SZelalem Aweke 5777e84f3cfSTushar Khandelwal################################################################################ 57830655136SGovindraj Raja# Make 128-Bit sysreg read/writes availabe when FEAT_D128 is enabled. 57930655136SGovindraj Raja################################################################################ 58030655136SGovindraj Rajaifneq (${ENABLE_FEAT_D128}, 0) 58130655136SGovindraj Raja BL_COMMON_SOURCES += lib/extensions/sysreg128/sysreg128.S 58230655136SGovindraj Rajaendif 58330655136SGovindraj Raja 58430655136SGovindraj Raja################################################################################ 5857794d6c8SGovindraj Raja# Platform specific Makefile might provide us ARCH_MAJOR/MINOR use that to come 5867794d6c8SGovindraj Raja# up with appropriate march values for compiler. 5877794d6c8SGovindraj Raja################################################################################ 5887794d6c8SGovindraj Rajainclude ${MAKE_HELPERS_DIRECTORY}march.mk 5897794d6c8SGovindraj Raja 5907794d6c8SGovindraj RajaTF_CFLAGS += $(march-directive) 5917275ac2aSGovindraj RajaASFLAGS += $(march-directive) 5927794d6c8SGovindraj Raja 59342d4d3baSArvind Ram Prakash# This internal flag is common option which is set to 1 for scenarios 59442d4d3baSArvind Ram Prakash# when the BL2 is running in EL3 level. This occurs in two scenarios - 59542d4d3baSArvind Ram Prakash# 4 world system running BL2 at EL3 and two world system without BL1 running 59642d4d3baSArvind Ram Prakash# BL2 in EL3 59742d4d3baSArvind Ram Prakash 59842d4d3baSArvind Ram Prakashifeq (${RESET_TO_BL2},1) 59942d4d3baSArvind Ram Prakash BL2_RUNS_AT_EL3 := 1 60042d4d3baSArvind Ram Prakash ifeq (${ENABLE_RME},1) 601c5e1da83SJayanth Dodderi Chidanand $(error RESET_TO_BL2=1 and ENABLE_RME=1 configuration is not \ 602c5e1da83SJayanth Dodderi Chidanand supported at the moment.) 60342d4d3baSArvind Ram Prakash endif 60442d4d3baSArvind Ram Prakashelse ifeq (${ENABLE_RME},1) 60542d4d3baSArvind Ram Prakash BL2_RUNS_AT_EL3 := 1 60642d4d3baSArvind Ram Prakashelse 60742d4d3baSArvind Ram Prakash BL2_RUNS_AT_EL3 := 0 60842d4d3baSArvind Ram Prakashendif 60942d4d3baSArvind Ram Prakash 610f87e54f7SManish Pandey# This internal flag is set to 1 when Firmware First handling of External aborts 611f87e54f7SManish Pandey# is required by lowe ELs. Currently only NS requires this support. 612f87e54f7SManish Pandeyifeq ($(HANDLE_EA_EL3_FIRST_NS),1) 613f87e54f7SManish Pandey FFH_SUPPORT := 1 614f87e54f7SManish Pandeyelse 615f87e54f7SManish Pandey FFH_SUPPORT := 0 616f87e54f7SManish Pandeyendif 617f87e54f7SManish Pandey 61826e63c44SEtienne Carriereifeq (${ARM_ARCH_MAJOR},7) 61926e63c44SEtienne Carriereinclude make_helpers/armv7-a-cpus.mk 62026e63c44SEtienne Carriereendif 62126e63c44SEtienne Carriere 6223bd17c0fSSoby MathewPIE_FOUND := $(findstring --enable-default-pie,${GCC_V_OUTPUT}) 6233bd17c0fSSoby Mathewifneq ($(PIE_FOUND),) 6243bd17c0fSSoby Mathew TF_CFLAGS += -fno-PIE 6258620bd0bSChris Kayifeq ($($(ARCH)-ld-id),gnu-gcc) 6267b592418SSamuel Holland TF_LDFLAGS += -no-pie 6277b592418SSamuel Hollandendif 628c5e1da83SJayanth Dodderi Chidanandendif #(PIE_FOUND) 629320920c1SMasahiro Yamada 6308620bd0bSChris Kayifeq ($($(ARCH)-ld-id),gnu-gcc) 631320920c1SMasahiro Yamada PIE_LDFLAGS += -Wl,-pie -Wl,--no-dynamic-linker 632320920c1SMasahiro Yamadaelse 633320920c1SMasahiro Yamada PIE_LDFLAGS += -pie --no-dynamic-linker 634320920c1SMasahiro Yamadaendif 635320920c1SMasahiro Yamada 636320920c1SMasahiro Yamadaifeq ($(ENABLE_PIE),1) 63742d4d3baSArvind Ram Prakash ifeq ($(RESET_TO_BL2),1) 63869af7fcfSMasahiro Yamada ifneq ($(BL2_IN_XIP_MEM),1) 639966660ecSChris Kay BL2_CPPFLAGS += -fpie 64069af7fcfSMasahiro Yamada BL2_CFLAGS += -fpie 64169af7fcfSMasahiro Yamada BL2_LDFLAGS += $(PIE_LDFLAGS) 642c5e1da83SJayanth Dodderi Chidanand endif #(BL2_IN_XIP_MEM) 643c5e1da83SJayanth Dodderi Chidanand endif #(RESET_TO_BL2) 644966660ecSChris Kay BL31_CPPFLAGS += -fpie 645320920c1SMasahiro Yamada BL31_CFLAGS += -fpie 646320920c1SMasahiro Yamada BL31_LDFLAGS += $(PIE_LDFLAGS) 647966660ecSChris Kay 648966660ecSChris Kay BL32_CPPFLAGS += -fpie 649d974301dSMasahiro Yamada BL32_CFLAGS += -fpie 650d974301dSMasahiro Yamada BL32_LDFLAGS += $(PIE_LDFLAGS) 651c5e1da83SJayanth Dodderi Chidanandendif #(ENABLE_PIE) 6523bd17c0fSSoby Mathew 653007433d8SBoyan KaratotevBL1_CPPFLAGS += -DREPORT_ERRATA=${DEBUG} 654007433d8SBoyan KaratotevBL31_CPPFLAGS += -DREPORT_ERRATA=${DEBUG} 655007433d8SBoyan KaratotevBL32_CPPFLAGS += -DREPORT_ERRATA=${DEBUG} 656007433d8SBoyan Karatotev 6579cefb4b1SMasahiro YamadaBL1_CPPFLAGS += -DIMAGE_AT_EL3 65842d4d3baSArvind Ram Prakashifeq ($(RESET_TO_BL2),1) 6599cefb4b1SMasahiro Yamada BL2_CPPFLAGS += -DIMAGE_AT_EL3 660d5e97a1dSMasahiro Yamadaelse 6619cefb4b1SMasahiro Yamada BL2_CPPFLAGS += -DIMAGE_AT_EL1 662c5e1da83SJayanth Dodderi Chidanandendif #(RESET_TO_BL2) 663007433d8SBoyan Karatotev 664007433d8SBoyan Karatotevifeq (${ARCH},aarch64) 6659cefb4b1SMasahiro Yamada BL2U_CPPFLAGS += -DIMAGE_AT_EL1 6669cefb4b1SMasahiro Yamada BL31_CPPFLAGS += -DIMAGE_AT_EL3 6679cefb4b1SMasahiro Yamada BL32_CPPFLAGS += -DIMAGE_AT_EL1 668007433d8SBoyan Karatotevelse 669007433d8SBoyan Karatotev BL32_CPPFLAGS += -DIMAGE_AT_EL3 670d5e97a1dSMasahiro Yamadaendif 671d5e97a1dSMasahiro Yamada 67254035fc4SSandrine Bailleux# Include the CPU specific operations makefile, which provides default 67354035fc4SSandrine Bailleux# values for all CPU errata workarounds and CPU specific optimisations. 67454035fc4SSandrine Bailleux# This can be overridden by the platform. 67573c99d4eSJuan Castilloinclude lib/cpus/cpu-ops.mk 6764f6ad66aSAchin Gupta 677a4409008Sdp-arm################################################################################ 678a4409008Sdp-arm# Build `AARCH32_SP` as BL32 image for AArch32 679a4409008Sdp-arm################################################################################ 680c5e1da83SJayanth Dodderi Chidanandifeq (${ARCH},aarch32) 681c5e1da83SJayanth Dodderi Chidanand NEED_BL32 := yes 682c5e1da83SJayanth Dodderi Chidanand 683a4409008Sdp-arm ifneq (${AARCH32_SP},none) 684a4409008Sdp-arm # We expect to locate an sp.mk under the specified AARCH32_SP directory 685a4409008Sdp-arm AARCH32_SP_MAKE := $(wildcard bl32/${AARCH32_SP}/${AARCH32_SP}.mk) 686a4409008Sdp-arm 687a4409008Sdp-arm ifeq (${AARCH32_SP_MAKE},) 688a4409008Sdp-arm $(error Error: No bl32/${AARCH32_SP}/${AARCH32_SP}.mk located) 689a4409008Sdp-arm endif 690a4409008Sdp-arm $(info Including ${AARCH32_SP_MAKE}) 691a4409008Sdp-arm include ${AARCH32_SP_MAKE} 692a4409008Sdp-arm endif 693c5e1da83SJayanth Dodderi Chidanandendif #(ARCH=aarch32) 6944f6ad66aSAchin Gupta 69573c99d4eSJuan Castillo################################################################################ 69677f1f7a1SVarun Wadekar# Include libc if not overridden 69777f1f7a1SVarun Wadekar################################################################################ 69877f1f7a1SVarun Wadekarifeq (${OVERRIDE_LIBC},0) 69977f1f7a1SVarun Wadekarinclude lib/libc/libc.mk 70077f1f7a1SVarun Wadekarendif 70177f1f7a1SVarun Wadekar 7025d893410SBoyan Karatotevifneq (${USE_GIC_DRIVER},0) 7035d893410SBoyan Karatotevinclude drivers/arm/gic/gic.mk 7045d893410SBoyan Karatotevendif 7055d893410SBoyan Karatotev 70677f1f7a1SVarun Wadekar################################################################################ 707c5e1da83SJayanth Dodderi Chidanand# Check incompatible options and dependencies 708cf2c8a33SAntonio Nino Diaz################################################################################ 709b14987cfSBoyan Karatotevinclude ${MAKE_HELPERS_DIRECTORY}constraints.mk 710c5e1da83SJayanth Dodderi Chidanand 711c5e1da83SJayanth Dodderi Chidanand# The cert_create tool cannot generate certificates individually, so we use the 712c5e1da83SJayanth Dodderi Chidanand# target 'certificates' to create them all 713c5e1da83SJayanth Dodderi Chidanandifneq (${GENERATE_COT},0) 714c5e1da83SJayanth Dodderi Chidanand FIP_DEPS += certificates 715c5e1da83SJayanth Dodderi Chidanand FWU_FIP_DEPS += fwu_certificates 716c5e1da83SJayanth Dodderi Chidanandendif 717c5e1da83SJayanth Dodderi Chidanand 718c5e1da83SJayanth Dodderi Chidanandifneq (${DECRYPTION_SUPPORT},none) 719c5e1da83SJayanth Dodderi Chidanand ENC_ARGS += -f ${FW_ENC_STATUS} 720c5e1da83SJayanth Dodderi Chidanand ENC_ARGS += -k ${ENC_KEY} 721c5e1da83SJayanth Dodderi Chidanand ENC_ARGS += -n ${ENC_NONCE} 722c5e1da83SJayanth Dodderi Chidanand FIP_DEPS += enctool 723c5e1da83SJayanth Dodderi Chidanand FWU_FIP_DEPS += enctool 724c5e1da83SJayanth Dodderi Chidanandendif #(DECRYPTION_SUPPORT) 725c5e1da83SJayanth Dodderi Chidanand 7262bf4f27fSManish V Badarkheifeq ($(MEASURED_BOOT)-$(TRUSTED_BOARD_BOOT),1-1) 7272bf4f27fSManish V Badarkhe# Support authentication verification and hash calculation 7282bf4f27fSManish V Badarkhe CRYPTO_SUPPORT := 3 7292bf4f27fSManish V Badarkheelse ifeq ($(DRTM_SUPPORT)-$(TRUSTED_BOARD_BOOT),1-1) 7302bf4f27fSManish V Badarkhe# Support authentication verification and hash calculation 7312bf4f27fSManish V Badarkhe CRYPTO_SUPPORT := 3 7322bf4f27fSManish V Badarkheelse ifneq ($(filter 1,${MEASURED_BOOT} ${DRTM_SUPPORT}),) 7332bf4f27fSManish V Badarkhe# Support hash calculation only 7342bf4f27fSManish V Badarkhe CRYPTO_SUPPORT := 2 7352bf4f27fSManish V Badarkheelse ifeq (${TRUSTED_BOARD_BOOT},1) 7362bf4f27fSManish V Badarkhe# Support authentication verification only 737c9c56f6eSManish V Badarkhe CRYPTO_SUPPORT := 1 738c9c56f6eSManish V Badarkheelse 739c9c56f6eSManish V Badarkhe CRYPTO_SUPPORT := 0 740c5e1da83SJayanth Dodderi Chidanandendif #($(MEASURED_BOOT)-$(TRUSTED_BOARD_BOOT)) 741c9c56f6eSManish V Badarkhe 742e4a070e3SManish V Badarkheifneq ($(filter 1 2 3,$(CRYPTO_SUPPORT)),) 743e4a070e3SManish V BadarkheCRYPTO_LIB := $(BUILD_PLAT)/lib/libmbedtls.a 744e4a070e3SManish V Badarkheendif 745e4a070e3SManish V Badarkhe 746cf2c8a33SAntonio Nino Diaz################################################################################ 74773c99d4eSJuan Castillo# Process platform overrideable behaviour 74873c99d4eSJuan Castillo################################################################################ 7494f6ad66aSAchin Gupta 7505f24ce96SManish Pandeyifdef BL1_SOURCES 7515f24ce96SManish Pandey NEED_BL1 := yes 752c5e1da83SJayanth Dodderi Chidanandendif #(BL1_SOURCES) 7535f24ce96SManish Pandey 7545f24ce96SManish Pandeyifdef BL2_SOURCES 7555f24ce96SManish Pandey NEED_BL2 := yes 7565f24ce96SManish Pandey 757bd97f83aSJohn Tsichritzis # Using BL2 implies that a BL33 image also needs to be supplied for the FIP and 758bd97f83aSJohn Tsichritzis # Certificate generation tools. This flag can be overridden by the platform. 759cf2c8a33SAntonio Nino Diaz ifdef EL3_PAYLOAD_BASE 760cf2c8a33SAntonio Nino Diaz # If booting an EL3 payload there is no need for a BL33 image 761cf2c8a33SAntonio Nino Diaz # in the FIP file. 7624c117f6cSSandrine Bailleux NEED_BL33 := no 763cf2c8a33SAntonio Nino Diaz else 76468450a6dSAntonio Nino Diaz ifdef PRELOADED_BL33_BASE 765cf2c8a33SAntonio Nino Diaz # If booting a BL33 preloaded image there is no need of 766cf2c8a33SAntonio Nino Diaz # another one in the FIP file. 767cf2c8a33SAntonio Nino Diaz NEED_BL33 := no 768cf2c8a33SAntonio Nino Diaz else 769cf2c8a33SAntonio Nino Diaz NEED_BL33 ?= yes 770cf2c8a33SAntonio Nino Diaz endif 7714c117f6cSSandrine Bailleux endif 772c5e1da83SJayanth Dodderi Chidanandendif #(BL2_SOURCES) 7736f971622SJuan Castillo 7745f24ce96SManish Pandeyifdef BL2U_SOURCES 7755f24ce96SManish Pandey NEED_BL2U := yes 776c5e1da83SJayanth Dodderi Chidanandendif #(BL2U_SOURCES) 7775f24ce96SManish Pandey 7784d045d0eSMasahiro Yamada# If SCP_BL2 is given, we always want FIP to include it. 7794d045d0eSMasahiro Yamadaifdef SCP_BL2 7804d045d0eSMasahiro Yamada NEED_SCP_BL2 := yes 781c5e1da83SJayanth Dodderi Chidanandendif #(SCP_BL2) 7824d045d0eSMasahiro Yamada 7835744e874SSoby Mathew# For AArch32, BL31 is not currently supported. 7845744e874SSoby Mathewifneq (${ARCH},aarch32) 7855744e874SSoby Mathew ifdef BL31_SOURCES 786c5e1da83SJayanth Dodderi Chidanand # When booting an EL3 payload, there is no need to compile the BL31 787c5e1da83SJayanth Dodderi Chidanand # image nor put it in the FIP. 7885744e874SSoby Mathew ifndef EL3_PAYLOAD_BASE 7895744e874SSoby Mathew NEED_BL31 := yes 7905744e874SSoby Mathew endif 7915744e874SSoby Mathew endif 792c5e1da83SJayanth Dodderi Chidanandendif #(ARCH=aarch64) 7935744e874SSoby Mathew 79473c99d4eSJuan Castillo# Process TBB related flags 7956f971622SJuan Castilloifneq (${GENERATE_COT},0) 79673c99d4eSJuan Castillo # Common cert_create options 7976f971622SJuan Castillo ifneq (${CREATE_KEYS},0) 7986f971622SJuan Castillo $(eval CRT_ARGS += -n) 7990191262dSYatharth Kochar $(eval FWU_CRT_ARGS += -n) 800fd34e7baSJuan Castillo ifneq (${SAVE_KEYS},0) 801fd34e7baSJuan Castillo $(eval CRT_ARGS += -k) 8020191262dSYatharth Kochar $(eval FWU_CRT_ARGS += -k) 803fd34e7baSJuan Castillo endif 8046f971622SJuan Castillo endif 80573c99d4eSJuan Castillo # Include TBBR makefile (unless the platform indicates otherwise) 80673c99d4eSJuan Castillo ifeq (${INCLUDE_TBBR_MK},1) 80773c99d4eSJuan Castillo include make_helpers/tbbr/tbbr_tools.mk 80873c99d4eSJuan Castillo endif 809c5e1da83SJayanth Dodderi Chidanandendif #(GENERATE_COT) 8106f971622SJuan Castillo 8111c75d5dfSMasahiro Yamadaifneq (${FIP_ALIGN},0) 8121c75d5dfSMasahiro Yamada FIP_ARGS += --align ${FIP_ALIGN} 813c5e1da83SJayanth Dodderi Chidanandendif #(FIP_ALIGN) 8141c75d5dfSMasahiro Yamada 8155f24ce96SManish Pandeyifdef FDT_SOURCES 8165f24ce96SManish Pandey NEED_FDT := yes 817c5e1da83SJayanth Dodderi Chidanandendif #(FDT_SOURCES) 8185f24ce96SManish Pandey 81973c99d4eSJuan Castillo################################################################################ 82046e5e035SMichalis Pappas# Include libraries' Makefile that are used in all BL 82146e5e035SMichalis Pappas################################################################################ 82246e5e035SMichalis Pappas 82346e5e035SMichalis Pappasinclude lib/stack_protector/stack_protector.mk 82446e5e035SMichalis Pappas 82546e5e035SMichalis Pappas################################################################################ 8268a86052dSSoby Mathew# Include BL specific makefiles 8278a86052dSSoby Mathew################################################################################ 8285f24ce96SManish Pandey 8295f24ce96SManish Pandeyifeq (${NEED_BL1},yes) 8308a86052dSSoby Mathewinclude bl1/bl1.mk 8318a86052dSSoby Mathewendif 8328a86052dSSoby Mathew 8335f24ce96SManish Pandeyifeq (${NEED_BL2},yes) 8348a86052dSSoby Mathewinclude bl2/bl2.mk 8358a86052dSSoby Mathewendif 8368a86052dSSoby Mathew 8375f24ce96SManish Pandeyifeq (${NEED_BL2U},yes) 8388a86052dSSoby Mathewinclude bl2u/bl2u.mk 8398a86052dSSoby Mathewendif 8408a86052dSSoby Mathew 8415744e874SSoby Mathewifeq (${NEED_BL31},yes) 8428a86052dSSoby Mathewinclude bl31/bl31.mk 8438a86052dSSoby Mathewendif 84403b397a8SNishanth Menon 84573c99d4eSJuan Castillo################################################################################ 84673c99d4eSJuan Castillo# Build options checks 84773c99d4eSJuan Castillo################################################################################ 84873c99d4eSJuan Castillo 849c5e1da83SJayanth Dodderi Chidanand# Boolean_Flags 850327131c4SLeonardo Sandoval$(eval $(call assert_booleans,\ 851327131c4SLeonardo Sandoval $(sort \ 852327131c4SLeonardo Sandoval ALLOW_RO_XLAT_TABLES \ 85346789a7cSBalint Dobszay BL2_ENABLE_SP_LOAD \ 854327131c4SLeonardo Sandoval COLD_BOOT_SINGLE_CPU \ 855327131c4SLeonardo Sandoval CREATE_KEYS \ 856327131c4SLeonardo Sandoval CTX_INCLUDE_AARCH32_REGS \ 857327131c4SLeonardo Sandoval CTX_INCLUDE_FPREGS \ 85842422622SMadhukar Pappireddy CTX_INCLUDE_SVE_REGS \ 859327131c4SLeonardo Sandoval CTX_INCLUDE_EL2_REGS \ 8609acff28aSArvind Ram Prakash CTX_INCLUDE_MPAM_REGS \ 861327131c4SLeonardo Sandoval DEBUG \ 862327131c4SLeonardo Sandoval DYN_DISABLE_AUTH \ 863327131c4SLeonardo Sandoval EL3_EXCEPTION_HANDLING \ 8641fd685a7SChris Kay ENABLE_AMU_AUXILIARY_COUNTERS \ 865873d4241Sjohpow01 AMU_RESTRICT_COUNTERS \ 866327131c4SLeonardo Sandoval ENABLE_ASSERTIONS \ 867327131c4SLeonardo Sandoval ENABLE_PIE \ 868327131c4SLeonardo Sandoval ENABLE_PMF \ 869327131c4SLeonardo Sandoval ENABLE_PSCI_STAT \ 870327131c4SLeonardo Sandoval ENABLE_RUNTIME_INSTRUMENTATION \ 871dc78e62dSjohpow01 ENABLE_SME_FOR_SWD \ 8720c5e7d1cSMax Shvetsov ENABLE_SVE_FOR_SWD \ 8738cef63d6SBoyan Karatotev ENABLE_FEAT_GCIE \ 874970a4a8dSManish Pandey ENABLE_FEAT_RAS \ 875f87e54f7SManish Pandey FFH_SUPPORT \ 876327131c4SLeonardo Sandoval ERROR_DEPRECATED \ 877327131c4SLeonardo Sandoval FAULT_INJECTION_SUPPORT \ 878327131c4SLeonardo Sandoval GENERATE_COT \ 879327131c4SLeonardo Sandoval GICV2_G0_FOR_EL3 \ 88046cc41d5SManish Pandey HANDLE_EA_EL3_FIRST_NS \ 881538516f5SBipin Ravi HARDEN_SLS \ 882327131c4SLeonardo Sandoval HW_ASSISTED_COHERENCY \ 883327131c4SLeonardo Sandoval MEASURED_BOOT \ 88436e3d877SAbhi.Singh DISCRETE_TPM \ 885e7f1181fSTamas Ban DICE_PROTECTION_ENVIRONMENT \ 8866a88ec8bSRaghu Krishnamurthy RMMD_ENABLE_EL3_TOKEN_SIGN \ 8872132c707SSona Mathew RMMD_ENABLE_IDE_KEY_PROG \ 88800e28874SManish V Badarkhe DRTM_SUPPORT \ 889327131c4SLeonardo Sandoval NS_TIMER_SWITCH \ 890327131c4SLeonardo Sandoval OVERRIDE_LIBC \ 891327131c4SLeonardo Sandoval PL011_GENERIC_UART \ 892327131c4SLeonardo Sandoval PROGRAMMABLE_RESET_ADDRESS \ 893327131c4SLeonardo Sandoval PSCI_EXTENDED_STATE_ID \ 89464b4710bSWing Li PSCI_OS_INIT_MODE \ 8958db17052SBoyan Karatotev ARCH_FEATURE_AVAILABILITY \ 896327131c4SLeonardo Sandoval RESET_TO_BL31 \ 897327131c4SLeonardo Sandoval SAVE_KEYS \ 898327131c4SLeonardo Sandoval SEPARATE_CODE_AND_RODATA \ 89996a8ed14SJiafei Pan SEPARATE_BL2_NOLOAD_REGION \ 900327131c4SLeonardo Sandoval SEPARATE_NOBITS_REGION \ 90186acbbe2SYe Li SEPARATE_RWDATA_REGION \ 902308ebfa1SMadhukar Pappireddy SEPARATE_SIMD_SECTION \ 903327131c4SLeonardo Sandoval SPIN_ON_BL1_EXIT \ 904327131c4SLeonardo Sandoval SPM_MM \ 9051d63ae4dSMarc Bonnici SPMC_AT_EL3 \ 906801cd3c8SNishant Sharma SPMC_AT_EL3_SEL0_SP \ 907327131c4SLeonardo Sandoval SPMD_SPM_AT_SEL2 \ 908890b5088SRaghu Krishnamurthy ENABLE_SPMD_LP \ 9093ba2c151SRaymond Mao TRANSFER_LIST \ 910327131c4SLeonardo Sandoval TRUSTED_BOARD_BOOT \ 911327131c4SLeonardo Sandoval USE_COHERENT_MEM \ 912327131c4SLeonardo Sandoval USE_DEBUGFS \ 913327131c4SLeonardo Sandoval ARM_IO_IN_DTB \ 914327131c4SLeonardo Sandoval SDEI_IN_FCONF \ 915327131c4SLeonardo Sandoval SEC_INT_DESC_IN_FCONF \ 916327131c4SLeonardo Sandoval USE_ROMLIB \ 917327131c4SLeonardo Sandoval USE_TBBR_DEFS \ 918327131c4SLeonardo Sandoval WARMBOOT_ENABLE_DCACHE_EARLY \ 91942d4d3baSArvind Ram Prakash RESET_TO_BL2 \ 920327131c4SLeonardo Sandoval BL2_IN_XIP_MEM \ 921327131c4SLeonardo Sandoval BL2_INV_DCACHE \ 922327131c4SLeonardo Sandoval USE_SPINLOCK_CAS \ 923327131c4SLeonardo Sandoval ENCRYPT_BL31 \ 924327131c4SLeonardo Sandoval ENCRYPT_BL32 \ 925327131c4SLeonardo Sandoval ERRATA_SPECULATIVE_AT \ 92645c7328cSBoyan Karatotev ERRATA_SME_POWER_DOWN \ 92700e8f79cSManish Pandey RAS_TRAP_NS_ERR_REC_ACCESS \ 928327131c4SLeonardo Sandoval COT_DESC_IN_DTB \ 929327131c4SLeonardo Sandoval USE_SP804_TIMER \ 930396b339dSManish V Badarkhe PSA_FWU_SUPPORT \ 93111d05a77SSughosh Ganu PSA_FWU_METADATA_FW_STORE_DESC \ 93268120783SChris Kay ENABLE_MPMM \ 9332b5e00d4SBoyan Karatotev FEAT_PABANDON \ 9346a0da736SJayanth Dodderi Chidanand FEATURE_DETECTION \ 9350b22e591SJayanth Dodderi Chidanand TRNG_SUPPORT \ 936593ae354SBoyan Karatotev ENABLE_ERRATA_ALL \ 937ffea3844SSona Mathew ERRATA_ABI_SUPPORT \ 938ef63f5beSSona Mathew ERRATA_NON_ARM_INTERCONNECT \ 93904c7303bSOkash Khawaja CONDITIONAL_CMO \ 9405782b890SManish V Badarkhe PSA_CRYPTO \ 94185bebe18SSandrine Bailleux ENABLE_CONSOLE_GETC \ 942183329a5SArvind Ram Prakash INIT_UNUSED_NS_EL2 \ 943bfef8b90SJuan Pablo Conde PLATFORM_REPORT_CTX_MEM_USE \ 944ae770fedSYann Gautier EARLY_CONSOLE \ 945f99a69c3SArvind Ram Prakash PRESERVE_DSU_PMU_REGS \ 9468953568aSLevi Yun HOB_LIST \ 947cf48f49fSManish V Badarkhe LFA_SUPPORT \ 948327131c4SLeonardo Sandoval))) 94973c99d4eSJuan Castillo 950c5e1da83SJayanth Dodderi Chidanand# Numeric_Flags 951327131c4SLeonardo Sandoval$(eval $(call assert_numerics,\ 952327131c4SLeonardo Sandoval $(sort \ 953327131c4SLeonardo Sandoval ARM_ARCH_MAJOR \ 954327131c4SLeonardo Sandoval ARM_ARCH_MINOR \ 955327131c4SLeonardo Sandoval BRANCH_PROTECTION \ 9566a0da736SJayanth Dodderi Chidanand CTX_INCLUDE_PAUTH_REGS \ 9576a0da736SJayanth Dodderi Chidanand CTX_INCLUDE_NEVE_REGS \ 9582bf4f27fSManish V Badarkhe CRYPTO_SUPPORT \ 95983a4dae1SBoyan Karatotev DISABLE_MTPMU \ 9601298f2f1SJayanth Dodderi Chidanand ENABLE_BRBE_FOR_NS \ 96147c681b7SJayanth Dodderi Chidanand ENABLE_TRBE_FOR_NS \ 9626a0da736SJayanth Dodderi Chidanand ENABLE_BTI \ 9636a0da736SJayanth Dodderi Chidanand ENABLE_PAUTH \ 964025b1b81SJohn Powell ENABLE_FEAT_PAUTH_LR \ 965d23acc9eSAndre Przywara ENABLE_FEAT_AMU \ 9666a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_AMUv1p1 \ 9676a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_CSV2_2 \ 96830019d86SSona Mathew ENABLE_FEAT_CSV2_3 \ 96983271d5aSArvind Ram Prakash ENABLE_FEAT_DEBUGV8P9 \ 9706a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_DIT \ 9716a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_ECV \ 9726a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_FGT \ 97333e6aaacSArvind Ram Prakash ENABLE_FEAT_FGT2 \ 974a57e18e4SArvind Ram Prakash ENABLE_FEAT_FPMR \ 9756a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_HCX \ 97619d52a83SAndre Przywara ENABLE_FEAT_LS64_ACCDATA \ 9777e84f3cfSTushar Khandelwal ENABLE_FEAT_MEC \ 9786b8df7b9SArvind Ram Prakash ENABLE_FEAT_MOPS \ 9798e397889SGovindraj Raja ENABLE_FEAT_MTE2 \ 9806a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_PAN \ 9816a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_RNG \ 982ff86e0b4SJuan Pablo Conde ENABLE_FEAT_RNG_TRAP \ 9836a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_SEL2 \ 984d3331603SMark Brown ENABLE_FEAT_TCR2 \ 9856d0433f0SJayanth Dodderi Chidanand ENABLE_FEAT_THE \ 9860e4daed2SGovindraj Raja ENABLE_FEAT_SB \ 987062b6c6bSMark Brown ENABLE_FEAT_S2PIE \ 988062b6c6bSMark Brown ENABLE_FEAT_S1PIE \ 989062b6c6bSMark Brown ENABLE_FEAT_S2POE \ 990062b6c6bSMark Brown ENABLE_FEAT_S1POE \ 9914ec4e545SJayanth Dodderi Chidanand ENABLE_FEAT_SCTLR2 \ 99230655136SGovindraj Raja ENABLE_FEAT_D128 \ 993688ab57bSMark Brown ENABLE_FEAT_GCS \ 9946a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_VHE \ 995edebefbcSArvind Ram Prakash ENABLE_FEAT_MPAM \ 9966a0da736SJayanth Dodderi Chidanand ENABLE_RME \ 9976437a09aSAndre Przywara ENABLE_SPE_FOR_NS \ 998603a0c6fSAndre Przywara ENABLE_SYS_REG_TRACE_FOR_NS \ 99945007acdSJayanth Dodderi Chidanand ENABLE_SME_FOR_NS \ 100003d3c0d7SJayanth Dodderi Chidanand ENABLE_SME2_FOR_NS \ 10012b0bc4e0SJayanth Dodderi Chidanand ENABLE_SVE_FOR_NS \ 10026a0da736SJayanth Dodderi Chidanand ENABLE_TRF_FOR_NS \ 1003327131c4SLeonardo Sandoval FW_ENC_STATUS \ 10045357f83dSManish V Badarkhe NR_OF_FW_BANKS \ 10055357f83dSManish V Badarkhe NR_OF_IMAGES_IN_FW_BANK \ 1006781d07a4SJayanth Dodderi Chidanand TWED_DELAY \ 1007781d07a4SJayanth Dodderi Chidanand ENABLE_FEAT_TWED \ 1008bebcf27fSMark Brown SVE_VECTOR_LEN \ 10090ed3be6fSVarun Wadekar IMPDEF_SYSREG_TRAP \ 1010ee580c2dSBoyan Karatotev W \ 1011327131c4SLeonardo Sandoval))) 1012c877b414SJeenu Viswambharan 1013aacff749SJustin Chadwellifdef KEY_SIZE 1014aacff749SJustin Chadwell $(eval $(call assert_numeric,KEY_SIZE)) 1015aacff749SJustin Chadwellendif 1016aacff749SJustin Chadwell 10171f461979SJustin Chadwellifeq ($(filter $(SANITIZE_UB), on off trap),) 10181f461979SJustin Chadwell $(error "Invalid value for SANITIZE_UB: can be one of on, off, trap") 10191f461979SJustin Chadwellendif 10201f461979SJustin Chadwell 102173c99d4eSJuan Castillo################################################################################ 102273c99d4eSJuan Castillo# Add definitions to the cpp preprocessor based on the current build options. 102373c99d4eSJuan Castillo# This is done after including the platform specific makefile to allow the 102473c99d4eSJuan Castillo# platform to overwrite the default options 102573c99d4eSJuan Castillo################################################################################ 102673c99d4eSJuan Castillo 1027327131c4SLeonardo Sandoval$(eval $(call add_defines,\ 1028327131c4SLeonardo Sandoval $(sort \ 1029327131c4SLeonardo Sandoval ALLOW_RO_XLAT_TABLES \ 1030327131c4SLeonardo Sandoval ARM_ARCH_MAJOR \ 1031327131c4SLeonardo Sandoval ARM_ARCH_MINOR \ 103246789a7cSBalint Dobszay BL2_ENABLE_SP_LOAD \ 1033327131c4SLeonardo Sandoval COLD_BOOT_SINGLE_CPU \ 1034327131c4SLeonardo Sandoval CTX_INCLUDE_AARCH32_REGS \ 1035327131c4SLeonardo Sandoval CTX_INCLUDE_FPREGS \ 103642422622SMadhukar Pappireddy CTX_INCLUDE_SVE_REGS \ 1037327131c4SLeonardo Sandoval CTX_INCLUDE_PAUTH_REGS \ 10389acff28aSArvind Ram Prakash CTX_INCLUDE_MPAM_REGS \ 1039327131c4SLeonardo Sandoval EL3_EXCEPTION_HANDLING \ 1040327131c4SLeonardo Sandoval CTX_INCLUDE_EL2_REGS \ 1041062f8aafSArunachalam Ganapathy CTX_INCLUDE_NEVE_REGS \ 1042ee580c2dSBoyan Karatotev DEBUG \ 1043327131c4SLeonardo Sandoval DECRYPTION_SUPPORT_${DECRYPTION_SUPPORT} \ 10440063dd17SJavier Almansa Sobrino DISABLE_MTPMU \ 1045d23acc9eSAndre Przywara ENABLE_FEAT_AMU \ 10461fd685a7SChris Kay ENABLE_AMU_AUXILIARY_COUNTERS \ 1047873d4241Sjohpow01 AMU_RESTRICT_COUNTERS \ 1048327131c4SLeonardo Sandoval ENABLE_ASSERTIONS \ 1049327131c4SLeonardo Sandoval ENABLE_BTI \ 105083271d5aSArvind Ram Prakash ENABLE_FEAT_DEBUGV8P9 \ 1051edebefbcSArvind Ram Prakash ENABLE_FEAT_MPAM \ 1052327131c4SLeonardo Sandoval ENABLE_PAUTH \ 1053025b1b81SJohn Powell ENABLE_FEAT_PAUTH_LR \ 1054327131c4SLeonardo Sandoval ENABLE_PIE \ 1055327131c4SLeonardo Sandoval ENABLE_PMF \ 1056327131c4SLeonardo Sandoval ENABLE_PSCI_STAT \ 10575b18de09SZelalem Aweke ENABLE_RME \ 10586a88ec8bSRaghu Krishnamurthy RMMD_ENABLE_EL3_TOKEN_SIGN \ 10592132c707SSona Mathew RMMD_ENABLE_IDE_KEY_PROG \ 1060327131c4SLeonardo Sandoval ENABLE_RUNTIME_INSTRUMENTATION \ 1061dc78e62dSjohpow01 ENABLE_SME_FOR_NS \ 106203d3c0d7SJayanth Dodderi Chidanand ENABLE_SME2_FOR_NS \ 1063dc78e62dSjohpow01 ENABLE_SME_FOR_SWD \ 106490118bb5SAndre Przywara ENABLE_SPE_FOR_NS \ 1065327131c4SLeonardo Sandoval ENABLE_SVE_FOR_NS \ 10660c5e7d1cSMax Shvetsov ENABLE_SVE_FOR_SWD \ 1067970a4a8dSManish Pandey ENABLE_FEAT_RAS \ 1068f87e54f7SManish Pandey FFH_SUPPORT \ 1069327131c4SLeonardo Sandoval ENCRYPT_BL31 \ 1070327131c4SLeonardo Sandoval ENCRYPT_BL32 \ 1071327131c4SLeonardo Sandoval ERROR_DEPRECATED \ 1072327131c4SLeonardo Sandoval FAULT_INJECTION_SUPPORT \ 1073327131c4SLeonardo Sandoval GICV2_G0_FOR_EL3 \ 107446cc41d5SManish Pandey HANDLE_EA_EL3_FIRST_NS \ 1075327131c4SLeonardo Sandoval HW_ASSISTED_COHERENCY \ 1076327131c4SLeonardo Sandoval LOG_LEVEL \ 1077327131c4SLeonardo Sandoval MEASURED_BOOT \ 107836e3d877SAbhi.Singh DISCRETE_TPM \ 1079e7f1181fSTamas Ban DICE_PROTECTION_ENVIRONMENT \ 108000e28874SManish V Badarkhe DRTM_SUPPORT \ 1081327131c4SLeonardo Sandoval NS_TIMER_SWITCH \ 1082327131c4SLeonardo Sandoval PL011_GENERIC_UART \ 1083327131c4SLeonardo Sandoval PLAT_${PLAT} \ 1084327131c4SLeonardo Sandoval PROGRAMMABLE_RESET_ADDRESS \ 1085327131c4SLeonardo Sandoval PSCI_EXTENDED_STATE_ID \ 108664b4710bSWing Li PSCI_OS_INIT_MODE \ 10878db17052SBoyan Karatotev ARCH_FEATURE_AVAILABILITY \ 1088327131c4SLeonardo Sandoval RESET_TO_BL31 \ 1089d766084fSAlexeiFedorov RME_GPT_BITLOCK_BLOCK \ 1090ec0088bbSAlexeiFedorov RME_GPT_MAX_BLOCK \ 1091327131c4SLeonardo Sandoval SEPARATE_CODE_AND_RODATA \ 109296a8ed14SJiafei Pan SEPARATE_BL2_NOLOAD_REGION \ 1093327131c4SLeonardo Sandoval SEPARATE_NOBITS_REGION \ 109486acbbe2SYe Li SEPARATE_RWDATA_REGION \ 1095308ebfa1SMadhukar Pappireddy SEPARATE_SIMD_SECTION \ 1096327131c4SLeonardo Sandoval RECLAIM_INIT_CODE \ 1097327131c4SLeonardo Sandoval SPD_${SPD} \ 1098327131c4SLeonardo Sandoval SPIN_ON_BL1_EXIT \ 1099327131c4SLeonardo Sandoval SPM_MM \ 11001d63ae4dSMarc Bonnici SPMC_AT_EL3 \ 1101801cd3c8SNishant Sharma SPMC_AT_EL3_SEL0_SP \ 1102327131c4SLeonardo Sandoval SPMD_SPM_AT_SEL2 \ 11033ba2c151SRaymond Mao TRANSFER_LIST \ 1104327131c4SLeonardo Sandoval TRUSTED_BOARD_BOOT \ 1105c9c56f6eSManish V Badarkhe CRYPTO_SUPPORT \ 11067dfb9911SJimmy Brisson TRNG_SUPPORT \ 1107ffea3844SSona Mathew ERRATA_ABI_SUPPORT \ 1108ef63f5beSSona Mathew ERRATA_NON_ARM_INTERCONNECT \ 1109327131c4SLeonardo Sandoval USE_COHERENT_MEM \ 1110327131c4SLeonardo Sandoval USE_DEBUGFS \ 1111327131c4SLeonardo Sandoval ARM_IO_IN_DTB \ 1112327131c4SLeonardo Sandoval SDEI_IN_FCONF \ 1113327131c4SLeonardo Sandoval SEC_INT_DESC_IN_FCONF \ 1114327131c4SLeonardo Sandoval USE_ROMLIB \ 1115327131c4SLeonardo Sandoval USE_TBBR_DEFS \ 1116327131c4SLeonardo Sandoval WARMBOOT_ENABLE_DCACHE_EARLY \ 111742d4d3baSArvind Ram Prakash RESET_TO_BL2 \ 111842d4d3baSArvind Ram Prakash BL2_RUNS_AT_EL3 \ 1119327131c4SLeonardo Sandoval BL2_IN_XIP_MEM \ 1120327131c4SLeonardo Sandoval BL2_INV_DCACHE \ 1121327131c4SLeonardo Sandoval USE_SPINLOCK_CAS \ 1122327131c4SLeonardo Sandoval ERRATA_SPECULATIVE_AT \ 112345c7328cSBoyan Karatotev ERRATA_SME_POWER_DOWN \ 112400e8f79cSManish Pandey RAS_TRAP_NS_ERR_REC_ACCESS \ 1125327131c4SLeonardo Sandoval COT_DESC_IN_DTB \ 1126327131c4SLeonardo Sandoval USE_SP804_TIMER \ 112712cd65e0STomas Pilar ENABLE_FEAT_RNG \ 1128ff86e0b4SJuan Pablo Conde ENABLE_FEAT_RNG_TRAP \ 11294e04478aSChris Kay ENABLE_FEAT_SB \ 11307d33ffe4SDaniel Boulby ENABLE_FEAT_DIT \ 11315357f83dSManish V Badarkhe NR_OF_FW_BANKS \ 11325357f83dSManish V Badarkhe NR_OF_IMAGES_IN_FW_BANK \ 1133396b339dSManish V Badarkhe PSA_FWU_SUPPORT \ 113411d05a77SSughosh Ganu PSA_FWU_METADATA_FW_STORE_DESC \ 1135744ad974Sjohpow01 ENABLE_BRBE_FOR_NS \ 1136813524eaSManish V Badarkhe ENABLE_TRBE_FOR_NS \ 1137d4582d30SManish V Badarkhe ENABLE_SYS_REG_TRACE_FOR_NS \ 11388fcd3d96SManish V Badarkhe ENABLE_TRF_FOR_NS \ 1139cb4ec47bSjohpow01 ENABLE_FEAT_HCX \ 114068120783SChris Kay ENABLE_MPMM \ 11412b5e00d4SBoyan Karatotev FEAT_PABANDON \ 1142f74cb0beSJayanth Dodderi Chidanand ENABLE_FEAT_FGT \ 114333e6aaacSArvind Ram Prakash ENABLE_FEAT_FGT2 \ 1144a57e18e4SArvind Ram Prakash ENABLE_FEAT_FPMR \ 1145f74cb0beSJayanth Dodderi Chidanand ENABLE_FEAT_ECV \ 11466a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_AMUv1p1 \ 11476a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_SEL2 \ 11486a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_VHE \ 11496a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_CSV2_2 \ 115030019d86SSona Mathew ENABLE_FEAT_CSV2_3 \ 115119d52a83SAndre Przywara ENABLE_FEAT_LS64_ACCDATA \ 11527e84f3cfSTushar Khandelwal ENABLE_FEAT_MEC \ 11536a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_PAN \ 1154d3331603SMark Brown ENABLE_FEAT_TCR2 \ 11556d0433f0SJayanth Dodderi Chidanand ENABLE_FEAT_THE \ 1156062b6c6bSMark Brown ENABLE_FEAT_S2PIE \ 1157062b6c6bSMark Brown ENABLE_FEAT_S1PIE \ 1158062b6c6bSMark Brown ENABLE_FEAT_S2POE \ 1159062b6c6bSMark Brown ENABLE_FEAT_S1POE \ 11604ec4e545SJayanth Dodderi Chidanand ENABLE_FEAT_SCTLR2 \ 116130655136SGovindraj Raja ENABLE_FEAT_D128 \ 1162688ab57bSMark Brown ENABLE_FEAT_GCS \ 11636b8df7b9SArvind Ram Prakash ENABLE_FEAT_MOPS \ 11648cef63d6SBoyan Karatotev ENABLE_FEAT_GCIE \ 11658e397889SGovindraj Raja ENABLE_FEAT_MTE2 \ 11666a0da736SJayanth Dodderi Chidanand FEATURE_DETECTION \ 1167781d07a4SJayanth Dodderi Chidanand TWED_DELAY \ 1168781d07a4SJayanth Dodderi Chidanand ENABLE_FEAT_TWED \ 116904c7303bSOkash Khawaja CONDITIONAL_CMO \ 11700ed3be6fSVarun Wadekar IMPDEF_SYSREG_TRAP \ 1171a8cf6faeSJayanth Dodderi Chidanand SVE_VECTOR_LEN \ 1172890b5088SRaghu Krishnamurthy ENABLE_SPMD_LP \ 11735782b890SManish V Badarkhe PSA_CRYPTO \ 117485bebe18SSandrine Bailleux ENABLE_CONSOLE_GETC \ 1175183329a5SArvind Ram Prakash INIT_UNUSED_NS_EL2 \ 1176bfef8b90SJuan Pablo Conde PLATFORM_REPORT_CTX_MEM_USE \ 1177ae770fedSYann Gautier EARLY_CONSOLE \ 1178f99a69c3SArvind Ram Prakash PRESERVE_DSU_PMU_REGS \ 11798953568aSLevi Yun HOB_LIST \ 1180cf48f49fSManish V Badarkhe LFA_SUPPORT \ 1181327131c4SLeonardo Sandoval))) 11822fae4b1eSJeenu Viswambharan 1183bfef8b90SJuan Pablo Condeifeq (${PLATFORM_REPORT_CTX_MEM_USE}, 1) 1184bfef8b90SJuan Pablo Condeifeq (${DEBUG}, 0) 1185bfef8b90SJuan Pablo Conde $(warning "PLATFORM_REPORT_CTX_MEM_USE can be applied when DEBUG=1 only") 1186bfef8b90SJuan Pablo Conde override PLATFORM_REPORT_CTX_MEM_USE := 0 1187bfef8b90SJuan Pablo Condeendif 1188bfef8b90SJuan Pablo Condeendif 1189bfef8b90SJuan Pablo Conde 11901f461979SJustin Chadwellifeq (${SANITIZE_UB},trap) 11911f461979SJustin Chadwell $(eval $(call add_define,MONITOR_TRAPS)) 1192c5e1da83SJayanth Dodderi Chidanandendif #(SANITIZE_UB) 11931f461979SJustin Chadwell 11944c117f6cSSandrine Bailleux# Define the EL3_PAYLOAD_BASE flag only if it is provided. 11954c117f6cSSandrine Bailleuxifdef EL3_PAYLOAD_BASE 11964c117f6cSSandrine Bailleux $(eval $(call add_define,EL3_PAYLOAD_BASE)) 1197cf2c8a33SAntonio Nino Diazelse 119868450a6dSAntonio Nino Diaz# Define the PRELOADED_BL33_BASE flag only if it is provided and 119968450a6dSAntonio Nino Diaz# EL3_PAYLOAD_BASE is not defined, as it has priority. 120068450a6dSAntonio Nino Diaz ifdef PRELOADED_BL33_BASE 120168450a6dSAntonio Nino Diaz $(eval $(call add_define,PRELOADED_BL33_BASE)) 12024c117f6cSSandrine Bailleux endif 1203c5e1da83SJayanth Dodderi Chidanandendif #(EL3_PAYLOAD_BASE) 120473c99d4eSJuan Castillo 1205209a60ccSSoby Mathew# Define the DYN_DISABLE_AUTH flag only if set. 1206209a60ccSSoby Mathewifeq (${DYN_DISABLE_AUTH},1) 1207209a60ccSSoby Mathew $(eval $(call add_define,DYN_DISABLE_AUTH)) 1208209a60ccSSoby Mathewendif 1209209a60ccSSoby Mathew 12108620bd0bSChris Kayifeq ($($(ARCH)-ld-id),arm-link) 1211c2ad38ceSVarun Wadekar $(eval $(call add_define,USE_ARM_LINK)) 1212c2ad38ceSVarun Wadekarendif 1213c2ad38ceSVarun Wadekar 1214ce2b1ec6SManish Pandey# Generate and include sp_gen.mk if SPD is spmd and SP_LAYOUT_FILE is defined 1215ce2b1ec6SManish Pandeyifeq (${SPD},spmd) 1216c33ff198SOlivier Deprezifdef SP_LAYOUT_FILE 1217ce2b1ec6SManish Pandey -include $(BUILD_PLAT)/sp_gen.mk 1218ce2b1ec6SManish Pandey FIP_DEPS += sp 121907c44475SManish Pandey CRT_DEPS += sp 1220ce2b1ec6SManish Pandey NEED_SP_PKG := yes 1221ce2b1ec6SManish Pandeyelse 1222c33ff198SOlivier Deprez ifeq (${SPMD_SPM_AT_SEL2},1) 1223c33ff198SOlivier Deprez $(error "SPMD with SPM at S-EL2 require SP_LAYOUT_FILE") 1224c33ff198SOlivier Deprez endif 1225c5e1da83SJayanth Dodderi Chidanandendif #(SP_LAYOUT_FILE) 1226c5e1da83SJayanth Dodderi Chidanandendif #(SPD) 1227ce2b1ec6SManish Pandey 122873c99d4eSJuan Castillo################################################################################ 122973c99d4eSJuan Castillo# Build targets 123073c99d4eSJuan Castillo################################################################################ 123173c99d4eSJuan Castillo 12322329e22bSHarrison 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 123373c99d4eSJuan Castillo 123473c99d4eSJuan Castilloall: msg_start 123573c99d4eSJuan Castillo 123673c99d4eSJuan Castillomsg_start: 12377c4e1eeaSChris Kay $(s)echo "Building ${PLAT}" 123873c99d4eSJuan Castillo 12397a24cba5SSoby Mathewifeq (${ERROR_DEPRECATED},0) 1240d5dfdeb6SJulius Werner# Check if deprecated declarations and cpp warnings should be treated as error or not. 12418620bd0bSChris Kayifneq ($(filter %-clang,$($(ARCH)-cc-id)),) 1242c2ad38ceSVarun Wadekar CPPFLAGS += -Wno-error=deprecated-declarations 1243c2ad38ceSVarun Wadekarelse 1244bc1a03c7SDan Handley CPPFLAGS += -Wno-error=deprecated-declarations -Wno-error=cpp 12457a24cba5SSoby Mathewendif 1246c5e1da83SJayanth Dodderi Chidanandendif #(!ERROR_DEPRECATED) 12477a24cba5SSoby Mathew 124861f72a34SRoberto Vargas$(eval $(call MAKE_LIB,c)) 12495fee0287SRoberto Vargas 125073c99d4eSJuan Castillo# Expand build macros for the different images 125173c99d4eSJuan Castilloifeq (${NEED_BL1},yes) 1252b34635a0SChris KayBL1_SOURCES := $(sort ${BL1_SOURCES}) 1253434d0491SZelalem Aweke$(eval $(call MAKE_BL,bl1)) 1254c5e1da83SJayanth Dodderi Chidanandendif #(NEED_BL1) 125573c99d4eSJuan Castillo 125673c99d4eSJuan Castilloifeq (${NEED_BL2},yes) 1257c5e1da83SJayanth Dodderi Chidanand 125842d4d3baSArvind Ram Prakashifeq (${RESET_TO_BL2}, 0) 1259c9b31ae8SRoberto VargasFIP_BL2_ARGS := tb-fw 1260c9b31ae8SRoberto Vargasendif 1261c9b31ae8SRoberto Vargas 1262eb1acfb6SChris KayBL2_SOURCES := $(sort ${BL2_SOURCES}) 1263eb1acfb6SChris Kay 126433950dd8SMasahiro Yamada$(if ${BL2}, $(eval $(call TOOL_ADD_IMG,bl2,--${FIP_BL2_ARGS})),\ 1265434d0491SZelalem Aweke $(eval $(call MAKE_BL,bl2,${FIP_BL2_ARGS}))) 1266c5e1da83SJayanth Dodderi Chidanand 1267c5e1da83SJayanth Dodderi Chidanandendif #(NEED_BL2) 126873c99d4eSJuan Castillo 12694d045d0eSMasahiro Yamadaifeq (${NEED_SCP_BL2},yes) 127033950dd8SMasahiro Yamada$(eval $(call TOOL_ADD_IMG,scp_bl2,--scp-fw)) 1271c5e1da83SJayanth Dodderi Chidanandendif #(NEED_SCP_BL2) 12724d045d0eSMasahiro Yamada 127373c99d4eSJuan Castilloifeq (${NEED_BL31},yes) 127473c99d4eSJuan CastilloBL31_SOURCES += ${SPD_SOURCES} 127526d1e0c3SMadhukar Pappireddy# Sort BL31 source files to remove duplicates 127626d1e0c3SMadhukar PappireddyBL31_SOURCES := $(sort ${BL31_SOURCES}) 1277c6ba9b45SSumit Gargifneq (${DECRYPTION_SUPPORT},none) 1278c6ba9b45SSumit Garg$(if ${BL31}, $(eval $(call TOOL_ADD_IMG,bl31,--soc-fw,,$(ENCRYPT_BL31))),\ 1279434d0491SZelalem Aweke $(eval $(call MAKE_BL,bl31,soc-fw,,$(ENCRYPT_BL31)))) 1280c6ba9b45SSumit Gargelse 128133950dd8SMasahiro Yamada$(if ${BL31}, $(eval $(call TOOL_ADD_IMG,bl31,--soc-fw)),\ 1282434d0491SZelalem Aweke $(eval $(call MAKE_BL,bl31,soc-fw))) 1283c5e1da83SJayanth Dodderi Chidanandendif #(DECRYPTION_SUPPORT) 1284c5e1da83SJayanth Dodderi Chidanandendif #(NEED_BL31) 128573c99d4eSJuan Castillo 128670d1fc53SJuan Castillo# If a BL32 image is needed but neither BL32 nor BL32_SOURCES is defined, the 1287c939d13aSMasahiro Yamada# build system will call TOOL_ADD_IMG to print a warning message and abort the 128870d1fc53SJuan Castillo# process. Note that the dependency on BL32 applies to the FIP only. 128973c99d4eSJuan Castilloifeq (${NEED_BL32},yes) 129026d1e0c3SMadhukar Pappireddy# Sort BL32 source files to remove duplicates 129126d1e0c3SMadhukar PappireddyBL32_SOURCES := $(sort ${BL32_SOURCES}) 12929cd15239SMasahiro YamadaBUILD_BL32 := $(if $(BL32),,$(if $(BL32_SOURCES),1)) 12939cd15239SMasahiro Yamada 1294c6ba9b45SSumit Gargifneq (${DECRYPTION_SUPPORT},none) 1295434d0491SZelalem Aweke$(if ${BUILD_BL32}, $(eval $(call MAKE_BL,bl32,tos-fw,,$(ENCRYPT_BL32))),\ 1296c6ba9b45SSumit Garg $(eval $(call TOOL_ADD_IMG,bl32,--tos-fw,,$(ENCRYPT_BL32)))) 1297c6ba9b45SSumit Gargelse 1298434d0491SZelalem Aweke$(if ${BUILD_BL32}, $(eval $(call MAKE_BL,bl32,tos-fw)),\ 129933950dd8SMasahiro Yamada $(eval $(call TOOL_ADD_IMG,bl32,--tos-fw))) 1300c5e1da83SJayanth Dodderi Chidanandendif #(DECRYPTION_SUPPORT) 1301c5e1da83SJayanth Dodderi Chidanandendif #(NEED_BL32) 130273c99d4eSJuan Castillo 13035b18de09SZelalem Aweke# If RMM image is needed but RMM is not defined, Test Realm Payload (TRP) 13045b18de09SZelalem Aweke# needs to be built from RMM_SOURCES. 13055b18de09SZelalem Awekeifeq (${NEED_RMM},yes) 13065b18de09SZelalem Aweke# Sort RMM source files to remove duplicates 13075b18de09SZelalem AwekeRMM_SOURCES := $(sort ${RMM_SOURCES}) 13085b18de09SZelalem AwekeBUILD_RMM := $(if $(RMM),,$(if $(RMM_SOURCES),1)) 13095b18de09SZelalem Aweke 13105b18de09SZelalem Aweke$(if ${BUILD_RMM}, $(eval $(call MAKE_BL,rmm,rmm-fw)),\ 13115b18de09SZelalem Aweke $(eval $(call TOOL_ADD_IMG,rmm,--rmm-fw))) 1312c5e1da83SJayanth Dodderi Chidanandendif #(NEED_RMM) 13135b18de09SZelalem Aweke 131473c99d4eSJuan Castillo# Add the BL33 image if required by the platform 131573c99d4eSJuan Castilloifeq (${NEED_BL33},yes) 131633950dd8SMasahiro Yamada$(eval $(call TOOL_ADD_IMG,bl33,--nt-fw)) 1317c5e1da83SJayanth Dodderi Chidanandendif #(NEED_BL33) 1318db6071c9SJuan Castillo 13199003fa0bSYatharth Kocharifeq (${NEED_BL2U},yes) 132033950dd8SMasahiro Yamada$(if ${BL2U}, $(eval $(call TOOL_ADD_IMG,bl2u,--ap-fwu-cfg,FWU_)),\ 1321434d0491SZelalem Aweke $(eval $(call MAKE_BL,bl2u,ap-fwu-cfg,FWU_))) 1322c5e1da83SJayanth Dodderi Chidanandendif #(NEED_BL2U) 13239003fa0bSYatharth Kochar 132403b397a8SNishanth Menon# Expand build macros for the different images 132503b397a8SNishanth Menonifeq (${NEED_FDT},yes) 132603b397a8SNishanth Menon $(eval $(call MAKE_DTBS,$(BUILD_PLAT)/fdts,$(FDT_SOURCES))) 13271c08ff32SSalman Nabi 13281c08ff32SSalman Nabi ifneq (${INITRD_SIZE}${INITRD_PATH},) 13291c08ff32SSalman Nabi ifndef INITRD_BASE 13301c08ff32SSalman Nabi $(error INITRD_BASE must be set when inserting initrd properties to the DTB.) 13311c08ff32SSalman Nabi endif 13321c08ff32SSalman Nabi 13331c08ff32SSalman Nabi INITRD_SIZE ?= $(shell printf "0x%x\n" $$(stat -Lc %s $(INITRD_PATH))) 13341c08ff32SSalman Nabi initrd_end = $(shell printf "0x%x\n" $$(expr $$(($(INITRD_BASE) + $(INITRD_SIZE))))) 13351c08ff32SSalman Nabi 13361c08ff32SSalman Nabi define $(HW_CONFIG)-after += 13371c08ff32SSalman Nabi $(s)echo " INITRD $(HW_CONFIG)" 13381c08ff32SSalman Nabi $(q)fdtput -t x $@ /chosen linux,initrd-start $(INITRD_BASE) 13391c08ff32SSalman Nabi $(q)fdtput -t x $@ /chosen linux,initrd-end $(initrd_end) 13401c08ff32SSalman Nabi endef 13411c08ff32SSalman Nabi endif 1342c5e1da83SJayanth Dodderi Chidanandendif #(NEED_FDT) 134303b397a8SNishanth Menon 1344ce2b1ec6SManish Pandey# Add Secure Partition packages 1345ce2b1ec6SManish Pandeyifeq (${NEED_SP_PKG},yes) 1346fd74ca0dSChris Kay$(BUILD_PLAT)/sp_gen.mk: ${SP_MK_GEN} ${SP_LAYOUT_FILE} | $$(@D)/ 1347679e27ceSChris Kay $(if $(host-poetry),$(q)poetry -q install --no-root) 1348dd816235SKathleen Capella $(q)$(if $(host-poetry),poetry run )${PYTHON} "$<" "$@" $(filter-out $<,$^) $(BUILD_PLAT) ${COT} ${SP_DTS_LIST_FRAGMENT} 1349822c7279SJ-Alvessp: $(DTBS) $(BUILD_PLAT)/sp_gen.mk $(SP_PKGS) 13507c4e1eeaSChris Kay $(s)echo 13517c4e1eeaSChris Kay $(s)echo "Built SP Images successfully" 13527c4e1eeaSChris Kay $(s)echo 1353c5e1da83SJayanth Dodderi Chidanandendif #(NEED_SP_PKG) 1354ce2b1ec6SManish Pandey 135536eaaf37SIan Spraylocate-checkpatch: 135636eaaf37SIan Sprayifndef CHECKPATCH 135766079b04SEtienne Carriere $(error "Please set CHECKPATCH to point to the Linux checkpatch.pl file, eg: CHECKPATCH=../linux/scripts/checkpatch.pl") 135836eaaf37SIan Sprayelse 135936eaaf37SIan Sprayifeq (,$(wildcard ${CHECKPATCH})) 136066079b04SEtienne Carriere $(error "The file CHECKPATCH points to cannot be found, use eg: CHECKPATCH=../linux/scripts/checkpatch.pl") 136136eaaf37SIan Sprayendif 1362c5e1da83SJayanth Dodderi Chidanandendif #(CHECKPATCH) 136336eaaf37SIan Spray 13644f6ad66aSAchin Guptaclean: 13657c4e1eeaSChris Kay $(s)echo " CLEAN" 1366c3273703SChris Kay $(q)rm -rf $(BUILD_PLAT) 1367cbd6cec3SBoyan Karatotev $(q)${MAKE} PLAT=${PLAT} BUILD_PLAT=${BUILD_PLAT} --no-print-directory -C ${FIPTOOLPATH} clean 1368cbd6cec3SBoyan Karatotev $(q)rm -rf ${FIPTOOLPATH}/fiptool 1369*f4595e6eSBoyan Karatotev $(q)${MAKE} PLAT=${PLAT} BUILD_PLAT=${BUILD_PLAT} --no-print-directory -C ${CRTTOOLPATH} clean 1370*f4595e6eSBoyan Karatotev $(q)rm -rf ${CRTTOOLPATH}/cert_create 137196fbe884SBoyan Karatotev $(q)${MAKE} PLAT=${PLAT} BUILD_PLAT=${BUILD_PLAT} --no-print-directory -C ${ENCTOOLPATH} clean 13727c4e1eeaSChris Kay $(q)${MAKE} --no-print-directory -C ${ROMLIBPATH} clean 13734f6ad66aSAchin Gupta 1374eaaeece2SJames Morrisseyrealclean distclean: 13757c4e1eeaSChris Kay $(s)echo " REALCLEAN" 1376c3273703SChris Kay $(q)rm -rf $(BUILD_BASE) 1377c3273703SChris Kay $(q)rm -rf $(CURDIR)/cscope.* 1378cbd6cec3SBoyan Karatotev $(q)${MAKE} PLAT=${PLAT} BUILD_PLAT=${BUILD_PLAT} --no-print-directory -C ${FIPTOOLPATH} clean 1379cbd6cec3SBoyan Karatotev $(q)rm -rf ${FIPTOOLPATH}/fiptool 1380*f4595e6eSBoyan Karatotev $(q)${MAKE} PLAT=${PLAT} BUILD_PLAT=${BUILD_PLAT} --no-print-directory -C ${CRTTOOLPATH} clean 1381*f4595e6eSBoyan Karatotev $(q)rm -rf ${CRTTOOLPATH}/cert_create 138296fbe884SBoyan Karatotev $(q)${MAKE} PLAT=${PLAT} BUILD_PLAT=${BUILD_PLAT} --no-print-directory -C ${ENCTOOLPATH} clean 13837c4e1eeaSChris Kay $(q)${MAKE} --no-print-directory -C ${ROMLIBPATH} clean 13844f6ad66aSAchin Gupta 138536eaaf37SIan Spraycheckcodebase: locate-checkpatch 13867c4e1eeaSChris Kay $(s)echo " CHECKING STYLE" 13877c4e1eeaSChris Kay $(q)if test -d .git ; then \ 13881ef35512SPaul Beesley git ls-files | grep -E -v 'libfdt|libc|docs|\.rst' | \ 13891a41e8c1SDan Handley while read GIT_FILE ; \ 13901a41e8c1SDan Handley do ${CHECKPATCH} ${CHECKCODE_ARGS} -f $$GIT_FILE ; \ 13911a41e8c1SDan Handley done ; \ 139236eaaf37SIan Spray else \ 13931a41e8c1SDan Handley find . -type f -not -iwholename "*.git*" \ 13941a41e8c1SDan Handley -not -iwholename "*build*" \ 13951a41e8c1SDan Handley -not -iwholename "*libfdt*" \ 139661f72a34SRoberto Vargas -not -iwholename "*libc*" \ 13971a41e8c1SDan Handley -not -iwholename "*docs*" \ 13981ef35512SPaul Beesley -not -iwholename "*.rst" \ 13991a41e8c1SDan Handley -exec ${CHECKPATCH} ${CHECKCODE_ARGS} -f {} \; ; \ 140036eaaf37SIan Spray fi 140136eaaf37SIan Spray 140236eaaf37SIan Spraycheckpatch: locate-checkpatch 14037c4e1eeaSChris Kay $(s)echo " CHECKING STYLE" 14047c4e1eeaSChris Kay $(q)if test -n "${CHECKPATCH_OPTS}"; then \ 140502a76d5fSYann Gautier echo " with ${CHECKPATCH_OPTS} option(s)"; \ 140602a76d5fSYann Gautier fi 14077c4e1eeaSChris Kay $(q)COMMON_COMMIT=$$(git merge-base HEAD ${BASE_COMMIT}); \ 140877a0a7f1SYann Gautier for commit in `git rev-list --no-merges $$COMMON_COMMIT..HEAD`; \ 140977a0a7f1SYann Gautier do \ 141051d28937SAntonio Nino Diaz printf "\n[*] Checking style of '$$commit'\n\n"; \ 14111a721748SYann Gautier ( git log --format=email "$$commit~..$$commit" \ 14121a721748SYann Gautier -- ${CHECK_PATHS} ; \ 141351d28937SAntonio Nino Diaz git diff --format=email "$$commit~..$$commit" \ 14141a721748SYann Gautier -- ${CHECK_PATHS}; ) | \ 141502a76d5fSYann Gautier ${CHECKPATCH} ${CHECKPATCH_OPTS} - || true; \ 141651d28937SAntonio Nino Diaz done 141736eaaf37SIan Spray 141873c99d4eSJuan Castillocerttool: ${CRTTOOL} 141973c99d4eSJuan Castillo 1420a9812206SPali Rohár${CRTTOOL}: FORCE 1421*f4595e6eSBoyan 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 1422*f4595e6eSBoyan Karatotev $(q)ln -sf ${CRTTOOL} ${CRTTOOLPATH}/cert_create 14237c4e1eeaSChris Kay $(s)echo 14247c4e1eeaSChris Kay $(s)echo "Built $@ successfully" 14257c4e1eeaSChris Kay $(s)echo 14266f971622SJuan Castillo 14276f971622SJuan Castilloifneq (${GENERATE_COT},0) 142873c99d4eSJuan Castillocertificates: ${CRT_DEPS} ${CRTTOOL} 14297c4e1eeaSChris Kay $(q)${CRTTOOL} ${CRT_ARGS} 14307c4e1eeaSChris Kay $(s)echo 14317c4e1eeaSChris Kay $(s)echo "Built $@ successfully" 14327c4e1eeaSChris Kay $(s)echo "Certificates can be found in ${BUILD_PLAT}" 14337c4e1eeaSChris Kay $(s)echo 1434c5e1da83SJayanth Dodderi Chidanandendif #(GENERATE_COT) 143527713fb4SSoby Mathew 143673c99d4eSJuan Castillo${BUILD_PLAT}/${FIP_NAME}: ${FIP_DEPS} ${FIPTOOL} 14374727fd13SPali Rohár $(eval ${CHECK_FIP_CMD}) 14387c4e1eeaSChris Kay $(q)${FIPTOOL} create ${FIP_ARGS} $@ 14397c4e1eeaSChris Kay $(q)${FIPTOOL} info $@ 14407c4e1eeaSChris Kay $(s)echo 14417c4e1eeaSChris Kay $(s)echo "Built $@ successfully" 14427c4e1eeaSChris Kay $(s)echo 1443f58ad36fSHarry Liebel 14440191262dSYatharth Kocharifneq (${GENERATE_COT},0) 14450191262dSYatharth Kocharfwu_certificates: ${FWU_CRT_DEPS} ${CRTTOOL} 14467c4e1eeaSChris Kay $(q)${CRTTOOL} ${FWU_CRT_ARGS} 14477c4e1eeaSChris Kay $(s)echo 14487c4e1eeaSChris Kay $(s)echo "Built $@ successfully" 14497c4e1eeaSChris Kay $(s)echo "FWU certificates can be found in ${BUILD_PLAT}" 14507c4e1eeaSChris Kay $(s)echo 1451c5e1da83SJayanth Dodderi Chidanandendif #(GENERATE_COT) 14520191262dSYatharth Kochar 14530191262dSYatharth Kochar${BUILD_PLAT}/${FWU_FIP_NAME}: ${FWU_FIP_DEPS} ${FIPTOOL} 14544727fd13SPali Rohár $(eval ${CHECK_FWU_FIP_CMD}) 14557c4e1eeaSChris Kay $(q)${FIPTOOL} create ${FWU_FIP_ARGS} $@ 14567c4e1eeaSChris Kay $(q)${FIPTOOL} info $@ 14577c4e1eeaSChris Kay $(s)echo 14587c4e1eeaSChris Kay $(s)echo "Built $@ successfully" 14597c4e1eeaSChris Kay $(s)echo 14600191262dSYatharth Kochar 146173c99d4eSJuan Castillofiptool: ${FIPTOOL} 146273c99d4eSJuan Castillofip: ${BUILD_PLAT}/${FIP_NAME} 14630191262dSYatharth Kocharfwu_fip: ${BUILD_PLAT}/${FWU_FIP_NAME} 146473c99d4eSJuan Castillo 1465cbd6cec3SBoyan Karatotev# symlink for compatibility before tools were in the build directory 1466a9812206SPali Rohár${FIPTOOL}: FORCE 1467cbd6cec3SBoyan 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 1468cbd6cec3SBoyan Karatotev $(q)ln -sf ${FIPTOOL} ${FIPTOOLPATH}/fiptool 1469f58ad36fSHarry Liebel 1470e4a070e3SManish V Badarkhe$(BUILD_PLAT)/romlib/romlib.bin $(BUILD_PLAT)/lib/libwrappers.a $&: $(BUILD_PLAT)/lib/libfdt.a $(BUILD_PLAT)/lib/libc.a $(CRYPTO_LIB) 1471e4a070e3SManish V Badarkhe $(q)${MAKE} PLAT_DIR=${PLAT_DIR} BUILD_PLAT=${BUILD_PLAT} ENABLE_BTI=${ENABLE_BTI} CRYPTO_SUPPORT=${CRYPTO_SUPPORT} ARM_ARCH_MINOR=${ARM_ARCH_MINOR} INCLUDES=$(call escape-shell,$(INCLUDES)) DEFINES=$(call escape-shell,$(DEFINES)) --no-print-directory -C ${ROMLIBPATH} all 14725accce5bSRoberto Vargas 1473cfe83910SLouis Mayencourtmemmap: all 1474c25405d6SChris Kay $(if $(host-poetry),$(q)poetry -q install --no-root) 14758daebefeSChris Kay $(q)$(if $(host-poetry),poetry run )memory symbols --root ${BUILD_PLAT} 1476cfe83910SLouis Mayencourt 14772329e22bSHarrison Mutaitl: ${BUILD_PLAT}/tl.bin 14782329e22bSHarrison Mutai${BUILD_PLAT}/tl.bin: ${HW_CONFIG} 1479c25405d6SChris Kay $(if $(host-poetry),$(q)poetry -q install --no-root) 1480d2867397SChris Kay $(q)$(if $(host-poetry),poetry run )tlc create --fdt $< -s ${FW_HANDOFF_SIZE} $@ 14812329e22bSHarrison Mutai 14826de32378SMadhukar Pappireddydoc: 14837c4e1eeaSChris Kay $(s)echo " BUILD DOCUMENTATION" 1484c61c9a31SHarrison Mutai $(if $(host-poetry),$(q)poetry -q install --with docs --no-root) 1485c61c9a31SHarrison Mutai $(q)$(if $(host-poetry),poetry run )${MAKE} --no-print-directory -C ${DOCS_PATH} html 14866de32378SMadhukar Pappireddy 148790aa901fSSumit Gargenctool: ${ENCTOOL} 148890aa901fSSumit Garg 1489a9812206SPali Rohár${ENCTOOL}: FORCE 149096fbe884SBoyan 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 14917c4e1eeaSChris Kay $(s)echo 14927c4e1eeaSChris Kay $(s)echo "Built $@ successfully" 14937c4e1eeaSChris Kay $(s)echo 149490aa901fSSumit Garg 149535fab8c9SJoakim Bechcscope: 14967c4e1eeaSChris Kay $(s)echo " CSCOPE" 14977c4e1eeaSChris Kay $(q)find ${CURDIR} -name "*.[chsS]" > cscope.files 14987c4e1eeaSChris Kay $(q)cscope -b -q -k 149935fab8c9SJoakim Bech 150072ee3314SRyan Harkinhelp: 15017c4e1eeaSChris Kay $(s)echo "usage: ${MAKE} [PLAT=<platform>] [OPTIONS] [TARGET]" 15027c4e1eeaSChris Kay $(s)echo "" 15037c4e1eeaSChris Kay $(s)echo "PLAT is used to specify which platform you wish to build." 15047c4e1eeaSChris Kay $(s)echo "If no platform is specified, PLAT defaults to: ${DEFAULT_PLAT}" 15057c4e1eeaSChris Kay $(s)echo "" 15067c4e1eeaSChris Kay $(s)echo "platform = ${PLATFORM_LIST}" 15077c4e1eeaSChris Kay $(s)echo "" 15087c4e1eeaSChris Kay $(s)echo "Please refer to the User Guide for a list of all supported options." 15097c4e1eeaSChris Kay $(s)echo "Note that the build system doesn't track dependencies for build " 15107c4e1eeaSChris Kay $(s)echo "options. Therefore, if any of the build options are changed " 15117c4e1eeaSChris Kay $(s)echo "from a previous build, a clean build must be performed." 15127c4e1eeaSChris Kay $(s)echo "" 15137c4e1eeaSChris Kay $(s)echo "Supported Targets:" 15147c4e1eeaSChris Kay $(s)echo " all Build all individual bootloader binaries" 15157c4e1eeaSChris Kay $(s)echo " bl1 Build the BL1 binary" 15167c4e1eeaSChris Kay $(s)echo " bl2 Build the BL2 binary" 15177c4e1eeaSChris Kay $(s)echo " bl2u Build the BL2U binary" 15187c4e1eeaSChris Kay $(s)echo " bl31 Build the BL31 binary" 15197c4e1eeaSChris Kay $(s)echo " bl32 Build the BL32 binary. If ARCH=aarch32, then " 15207c4e1eeaSChris Kay $(s)echo " this builds secure payload specified by AARCH32_SP" 15217c4e1eeaSChris Kay $(s)echo " certificates Build the certificates (requires 'GENERATE_COT=1')" 15227c4e1eeaSChris Kay $(s)echo " fip Build the Firmware Image Package (FIP)" 15237c4e1eeaSChris Kay $(s)echo " fwu_fip Build the FWU Firmware Image Package (FIP)" 15247c4e1eeaSChris Kay $(s)echo " checkcodebase Check the coding style of the entire source tree" 15257c4e1eeaSChris Kay $(s)echo " checkpatch Check the coding style on changes in the current" 15267c4e1eeaSChris Kay $(s)echo " branch against BASE_COMMIT (default origin/master)" 15277c4e1eeaSChris Kay $(s)echo " clean Clean the build for the selected platform" 15287c4e1eeaSChris Kay $(s)echo " cscope Generate cscope index" 15297c4e1eeaSChris Kay $(s)echo " distclean Remove all build artifacts for all platforms" 15307c4e1eeaSChris Kay $(s)echo " certtool Build the Certificate generation tool" 15317c4e1eeaSChris Kay $(s)echo " enctool Build the Firmware encryption tool" 15327c4e1eeaSChris Kay $(s)echo " fiptool Build the Firmware Image Package (FIP) creation tool" 15337c4e1eeaSChris Kay $(s)echo " sp Build the Secure Partition Packages" 15347c4e1eeaSChris Kay $(s)echo " sptool Build the Secure Partition Package creation tool" 15357c4e1eeaSChris Kay $(s)echo " dtbs Build the Device Tree Blobs (if required for the platform)" 15367c4e1eeaSChris Kay $(s)echo " memmap Print the memory map of the built binaries" 15377c4e1eeaSChris Kay $(s)echo " doc Build html based documentation using Sphinx tool" 15387c4e1eeaSChris Kay $(s)echo "" 15397c4e1eeaSChris Kay $(s)echo "Note: most build targets require PLAT to be set to a specific platform." 15407c4e1eeaSChris Kay $(s)echo "" 15417c4e1eeaSChris Kay $(s)echo "example: build all targets for the FVP platform:" 15427c4e1eeaSChris Kay $(s)echo " CROSS_COMPILE=aarch64-none-elf- make PLAT=fvp all" 1543a9812206SPali Rohár 1544a9812206SPali Rohár.PHONY: FORCE 1545a9812206SPali RohárFORCE:; 1546