14f6ad66aSAchin Gupta# 2c9c56f6eSManish V Badarkhe# Copyright (c) 2013-2022, 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 1124c5d206SJayanth Dodderi ChidanandVERSION_MINOR := 7 12dddf4283Slaurenw-armVERSION := ${VERSION_MAJOR}.${VERSION_MINOR} 13aaa3e722SJuan Castillo 1488154678SJuan Castillo# Default goal is build all images 1588154678SJuan Castillo.DEFAULT_GOAL := all 1688154678SJuan Castillo 1772fc70edSDouglas Raillard# Avoid any implicit propagation of command line variable definitions to 1872fc70edSDouglas Raillard# sub-Makefiles, like CFLAGS that we reserved for the firmware images' 1972fc70edSDouglas Raillard# usage. Other command line options like "-s" are still propagated as usual. 2072fc70edSDouglas RaillardMAKEOVERRIDES = 2172fc70edSDouglas Raillard 22231c1470SEvan LloydMAKE_HELPERS_DIRECTORY := make_helpers/ 23231c1470SEvan Lloydinclude ${MAKE_HELPERS_DIRECTORY}build_macros.mk 24e7f54dbdSEvan Lloydinclude ${MAKE_HELPERS_DIRECTORY}build_env.mk 2573c99d4eSJuan Castillo 2673c99d4eSJuan Castillo################################################################################ 272fae4b1eSJeenu Viswambharan# Default values for build configurations, and their dependencies 2873c99d4eSJuan Castillo################################################################################ 29e35c4045SJeenu Viswambharan 302fae4b1eSJeenu Viswambharaninclude ${MAKE_HELPERS_DIRECTORY}defaults.mk 31872be88aSdp-arm 32cc8b5632SAntonio Nino Diaz# Assertions enabled for DEBUG builds by default 33cc8b5632SAntonio Nino DiazENABLE_ASSERTIONS := ${DEBUG} 342fae4b1eSJeenu ViswambharanENABLE_PMF := ${ENABLE_RUNTIME_INSTRUMENTATION} 352fae4b1eSJeenu ViswambharanPLAT := ${DEFAULT_PLAT} 3673c99d4eSJuan Castillo 3773c99d4eSJuan Castillo################################################################################ 3873c99d4eSJuan Castillo# Checkpatch script options 3973c99d4eSJuan Castillo################################################################################ 4073c99d4eSJuan Castillo 41f607739cSSandrine BailleuxCHECKCODE_ARGS := --no-patch 42f0b489c1SDan Handley# Do not check the coding style on imported library files or documentation files 434501843fSGilad Ben-YossefINC_ARM_DIRS_TO_CHECK := $(sort $(filter-out \ 444501843fSGilad Ben-Yossef include/drivers/arm/cryptocell, \ 454501843fSGilad Ben-Yossef $(wildcard include/drivers/arm/*))) 464501843fSGilad Ben-YossefINC_ARM_DIRS_TO_CHECK += include/drivers/arm/cryptocell/*.h 474501843fSGilad Ben-YossefINC_DRV_DIRS_TO_CHECK := $(sort $(filter-out \ 484501843fSGilad Ben-Yossef include/drivers/arm, \ 494501843fSGilad Ben-Yossef $(wildcard include/drivers/*))) 50f0b489c1SDan HandleyINC_LIB_DIRS_TO_CHECK := $(sort $(filter-out \ 511a41e8c1SDan Handley include/lib/libfdt \ 5261f72a34SRoberto Vargas include/lib/libc, \ 53f0b489c1SDan Handley $(wildcard include/lib/*))) 54f0b489c1SDan HandleyINC_DIRS_TO_CHECK := $(sort $(filter-out \ 554501843fSGilad Ben-Yossef include/lib \ 564501843fSGilad Ben-Yossef include/drivers, \ 57f0b489c1SDan Handley $(wildcard include/*))) 58f0b489c1SDan HandleyLIB_DIRS_TO_CHECK := $(sort $(filter-out \ 59d801fbb0Sdp-arm lib/compiler-rt \ 6055cdcf75SAntonio Nino Diaz lib/libfdt% \ 6161f72a34SRoberto Vargas lib/libc, \ 62*a194255dSDaniel Boulby lib/zlib \ 63f0b489c1SDan Handley $(wildcard lib/*))) 64f0b489c1SDan HandleyROOT_DIRS_TO_CHECK := $(sort $(filter-out \ 65f0b489c1SDan Handley lib \ 66f0b489c1SDan Handley include \ 67f0b489c1SDan Handley docs \ 681ef35512SPaul Beesley %.rst, \ 69f0b489c1SDan Handley $(wildcard *))) 70f0b489c1SDan HandleyCHECK_PATHS := ${ROOT_DIRS_TO_CHECK} \ 71f0b489c1SDan Handley ${INC_DIRS_TO_CHECK} \ 72f0b489c1SDan Handley ${INC_LIB_DIRS_TO_CHECK} \ 734501843fSGilad Ben-Yossef ${LIB_DIRS_TO_CHECK} \ 744501843fSGilad Ben-Yossef ${INC_DRV_DIRS_TO_CHECK} \ 754501843fSGilad Ben-Yossef ${INC_ARM_DIRS_TO_CHECK} 7636eaaf37SIan Spray 7773c99d4eSJuan Castillo 7873c99d4eSJuan Castillo################################################################################ 7973c99d4eSJuan Castillo# Process build options 8073c99d4eSJuan Castillo################################################################################ 8173c99d4eSJuan Castillo 8273c99d4eSJuan Castillo# Verbose flag 83e35c4045SJeenu Viswambharanifeq (${V},0) 84b169f6a9SEvan Lloyd Q:=@ 85ee1ba6d4SAndre Przywara ECHO:=@echo 8636eaaf37SIan Spray CHECKCODE_ARGS += --no-summary --terse 874f6ad66aSAchin Guptaelse 88b169f6a9SEvan Lloyd Q:= 89b5a0f4bdSAntonio Nino Diaz ECHO:=$(ECHO_QUIET) 904f6ad66aSAchin Guptaendif 91ee1ba6d4SAndre Przywara 92ee1ba6d4SAndre Przywaraifneq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),) 93ee1ba6d4SAndre Przywara Q:=@ 94b5a0f4bdSAntonio Nino Diaz ECHO:=$(ECHO_QUIET) 95ee1ba6d4SAndre Przywaraendif 96ee1ba6d4SAndre Przywara 97ee1ba6d4SAndre Przywaraexport Q ECHO 982f2cef46SJeenu Viswambharan 9973c99d4eSJuan Castillo# The cert_create tool cannot generate certificates individually, so we use the 10073c99d4eSJuan Castillo# target 'certificates' to create them all 10173c99d4eSJuan Castilloifneq (${GENERATE_COT},0) 10273c99d4eSJuan Castillo FIP_DEPS += certificates 1030191262dSYatharth Kochar FWU_FIP_DEPS += fwu_certificates 10473c99d4eSJuan Castilloendif 10573c99d4eSJuan Castillo 1069fc59639SAlexei Fedorov# Process BRANCH_PROTECTION value and set 1079fc59639SAlexei Fedorov# Pointer Authentication and Branch Target Identification flags 1089fc59639SAlexei Fedorovifeq (${BRANCH_PROTECTION},0) 1099fc59639SAlexei Fedorov # Default value turns off all types of branch protection 1109fc59639SAlexei Fedorov BP_OPTION := none 1119fc59639SAlexei Fedorovelse ifneq (${ARCH},aarch64) 1129fc59639SAlexei Fedorov $(error BRANCH_PROTECTION requires AArch64) 1139fc59639SAlexei Fedorovelse ifeq (${BRANCH_PROTECTION},1) 1149fc59639SAlexei Fedorov # Enables all types of branch protection features 1159fc59639SAlexei Fedorov BP_OPTION := standard 1169fc59639SAlexei Fedorov ENABLE_BTI := 1 1179fc59639SAlexei Fedorov ENABLE_PAUTH := 1 1189fc59639SAlexei Fedorovelse ifeq (${BRANCH_PROTECTION},2) 1199fc59639SAlexei Fedorov # Return address signing to its standard level 1209fc59639SAlexei Fedorov BP_OPTION := pac-ret 1219fc59639SAlexei Fedorov ENABLE_PAUTH := 1 1229fc59639SAlexei Fedorovelse ifeq (${BRANCH_PROTECTION},3) 1239fc59639SAlexei Fedorov # Extend the signing to include leaf functions 1249fc59639SAlexei Fedorov BP_OPTION := pac-ret+leaf 1259fc59639SAlexei Fedorov ENABLE_PAUTH := 1 1263768fecfSAlexei Fedorovelse ifeq (${BRANCH_PROTECTION},4) 1273768fecfSAlexei Fedorov # Turn on branch target identification mechanism 1283768fecfSAlexei Fedorov BP_OPTION := bti 1293768fecfSAlexei Fedorov ENABLE_BTI := 1 1309fc59639SAlexei Fedorovelse 1319fc59639SAlexei Fedorov $(error Unknown BRANCH_PROTECTION value ${BRANCH_PROTECTION}) 1329fc59639SAlexei Fedorovendif 13373c99d4eSJuan Castillo 1345b18de09SZelalem Aweke# FEAT_RME 1355b18de09SZelalem Awekeifeq (${ENABLE_RME},1) 1365b18de09SZelalem Aweke# RME doesn't support PIE 1375b18de09SZelalem Awekeifneq (${ENABLE_PIE},0) 1385b18de09SZelalem Aweke $(error ENABLE_RME does not support PIE) 1395b18de09SZelalem Awekeendif 140744ad974Sjohpow01# RME doesn't support BRBE 141744ad974Sjohpow01ifneq (${ENABLE_BRBE_FOR_NS},0) 142744ad974Sjohpow01 $(error ENABLE_RME does not support BRBE.) 143744ad974Sjohpow01endif 1445b18de09SZelalem Aweke# RME requires AARCH64 1455b18de09SZelalem Awekeifneq (${ARCH},aarch64) 1465b18de09SZelalem Aweke $(error ENABLE_RME requires AArch64) 1475b18de09SZelalem Awekeendif 1485b18de09SZelalem Aweke# RME requires el2 context to be saved for now. 1495b18de09SZelalem AwekeCTX_INCLUDE_EL2_REGS := 1 1505b18de09SZelalem AwekeCTX_INCLUDE_AARCH32_REGS := 0 1515b18de09SZelalem AwekeARM_ARCH_MAJOR := 8 1525b18de09SZelalem AwekeARM_ARCH_MINOR := 6 1535b18de09SZelalem Awekeendif 1545b18de09SZelalem Aweke 155c97cba4eSSoby Mathew# USE_SPINLOCK_CAS requires AArch64 build 156c97cba4eSSoby Mathewifeq (${USE_SPINLOCK_CAS},1) 157c97cba4eSSoby Mathewifneq (${ARCH},aarch64) 158c97cba4eSSoby Mathew $(error USE_SPINLOCK_CAS requires AArch64) 159c97cba4eSSoby Mathewendif 160c97cba4eSSoby Mathewendif 161c97cba4eSSoby Mathew 1620ca3913dSOlivier Deprez# USE_DEBUGFS experimental feature recommended only in debug builds 1630ca3913dSOlivier Deprezifeq (${USE_DEBUGFS},1) 1640ca3913dSOlivier Deprezifeq (${DEBUG},1) 1650ca3913dSOlivier Deprez $(warning DEBUGFS experimental feature is enabled.) 1660ca3913dSOlivier Deprezelse 1670ca3913dSOlivier Deprez $(warning DEBUGFS experimental, recommended in DEBUG builds ONLY) 1680ca3913dSOlivier Deprezendif 1690ca3913dSOlivier Deprezendif 1700ca3913dSOlivier Deprez 171c6ba9b45SSumit Gargifneq (${DECRYPTION_SUPPORT},none) 172c6ba9b45SSumit GargENC_ARGS += -f ${FW_ENC_STATUS} 173c6ba9b45SSumit GargENC_ARGS += -k ${ENC_KEY} 174c6ba9b45SSumit GargENC_ARGS += -n ${ENC_NONCE} 175c6ba9b45SSumit GargFIP_DEPS += enctool 176c6ba9b45SSumit GargFWU_FIP_DEPS += enctool 177c6ba9b45SSumit Gargendif 178c6ba9b45SSumit Garg 17973c99d4eSJuan Castillo################################################################################ 18073c99d4eSJuan Castillo# Toolchain 18173c99d4eSJuan Castillo################################################################################ 18273c99d4eSJuan Castillo 18372610c41Sdp-armHOSTCC := gcc 18472610c41Sdp-armexport HOSTCC 18572610c41Sdp-arm 18673c99d4eSJuan CastilloCC := ${CROSS_COMPILE}gcc 18773c99d4eSJuan CastilloCPP := ${CROSS_COMPILE}cpp 18873c99d4eSJuan CastilloAS := ${CROSS_COMPILE}gcc 18973c99d4eSJuan CastilloAR := ${CROSS_COMPILE}ar 1902adee763SRoberto VargasLINKER := ${CROSS_COMPILE}ld 19173c99d4eSJuan CastilloOC := ${CROSS_COMPILE}objcopy 19273c99d4eSJuan CastilloOD := ${CROSS_COMPILE}objdump 19373c99d4eSJuan CastilloNM := ${CROSS_COMPILE}nm 19473c99d4eSJuan CastilloPP := ${CROSS_COMPILE}gcc -E 19538c14d88SSoby MathewDTC := dtc 19673c99d4eSJuan Castillo 197b25a577fSJulius Werner# Use ${LD}.bfd instead if it exists (as absolute path or together with $PATH). 198b25a577fSJulius Wernerifneq ($(strip $(wildcard ${LD}.bfd) \ 1992adee763SRoberto Vargas $(foreach dir,$(subst :, ,${PATH}),$(wildcard ${dir}/${LINKER}.bfd))),) 2002adee763SRoberto VargasLINKER := ${LINKER}.bfd 201b25a577fSJulius Wernerendif 202b25a577fSJulius Werner 20326e63c44SEtienne Carriereifeq (${ARM_ARCH_MAJOR},7) 20426e63c44SEtienne Carrieretarget32-directive = -target arm-none-eabi 20526e63c44SEtienne Carriere# Will set march32-directive from platform configuration 20626e63c44SEtienne Carriereelse 20726e63c44SEtienne Carrieretarget32-directive = -target armv8a-none-eabi 208fa6f774bSAlexei Fedorov 209f1821790SAlexei Fedorov# Set the compiler's target architecture profile based on 210f1821790SAlexei Fedorov# ARM_ARCH_MAJOR ARM_ARCH_MINOR options 211fa6f774bSAlexei Fedorovifeq (${ARM_ARCH_MINOR},0) 212f1821790SAlexei Fedorovmarch32-directive = -march=armv${ARM_ARCH_MAJOR}-a 213f1821790SAlexei Fedorovmarch64-directive = -march=armv${ARM_ARCH_MAJOR}-a 214fa6f774bSAlexei Fedorovelse 215f1821790SAlexei Fedorovmarch32-directive = -march=armv${ARM_ARCH_MAJOR}.${ARM_ARCH_MINOR}-a 216f1821790SAlexei Fedorovmarch64-directive = -march=armv${ARM_ARCH_MAJOR}.${ARM_ARCH_MINOR}-a 217fa6f774bSAlexei Fedorovendif 21826e63c44SEtienne Carriereendif 21926e63c44SEtienne Carriere 2207ff088d1SManish V Badarkhe# Memory tagging is supported in architecture Armv8.5-A AArch64 and onwards 2217ff088d1SManish V Badarkheifeq ($(ARCH), aarch64) 2224a565bd8SSami Mujawar# Check if revision is greater than or equal to 8.5 2234a565bd8SSami Mujawarifeq "8.5" "$(word 1, $(sort 8.5 $(ARM_ARCH_MAJOR).$(ARM_ARCH_MINOR)))" 2247ff088d1SManish V Badarkhemem_tag_arch_support = yes 2257ff088d1SManish V Badarkheendif 2267ff088d1SManish V Badarkheendif 2277ff088d1SManish V Badarkhe 228f1821790SAlexei Fedorov# Get architecture feature modifiers 229f1821790SAlexei Fedorovarch-features = ${ARM_ARCH_FEATURE} 230f1821790SAlexei Fedorov 231f1821790SAlexei Fedorov# Enable required options for memory stack tagging. 232f1821790SAlexei Fedorov# Currently, these options are enabled only for clang and armclang compiler. 2337ff088d1SManish V Badarkheifeq (${SUPPORT_STACK_MEMTAG},yes) 2347ff088d1SManish V Badarkheifdef mem_tag_arch_support 235f1821790SAlexei Fedorov# Check for armclang and clang compilers 2367ff088d1SManish V Badarkheifneq ( ,$(filter $(notdir $(CC)),armclang clang)) 237f1821790SAlexei Fedorov# Add "memtag" architecture feature modifier if not specified 238f1821790SAlexei Fedorovifeq ( ,$(findstring memtag,$(arch-features))) 239f1821790SAlexei Fedorovarch-features := $(arch-features)+memtag 240f1821790SAlexei Fedorovendif # memtag 2417ff088d1SManish V Badarkheifeq ($(notdir $(CC)),armclang) 2427ff088d1SManish V BadarkheTF_CFLAGS += -mmemtag-stack 2437ff088d1SManish V Badarkheelse ifeq ($(notdir $(CC)),clang) 2447ff088d1SManish V BadarkheTF_CFLAGS += -fsanitize=memtag 245f1821790SAlexei Fedorovendif # armclang 246f1821790SAlexei Fedorovendif # armclang clang 2477ff088d1SManish V Badarkheelse 2487ff088d1SManish V Badarkhe$(error "Error: stack memory tagging is not supported for architecture \ 2497ff088d1SManish V Badarkhe ${ARCH},armv${ARM_ARCH_MAJOR}.${ARM_ARCH_MINOR}-a") 250f1821790SAlexei Fedorovendif # mem_tag_arch_support 251f1821790SAlexei Fedorovendif # SUPPORT_STACK_MEMTAG 252f1821790SAlexei Fedorov 253f1821790SAlexei Fedorov# Set the compiler's architecture feature modifiers 254f1821790SAlexei Fedorovifneq ($(arch-features), none) 255f1821790SAlexei Fedorov# Strip "none+" from arch-features 256f1821790SAlexei Fedorovarch-features := $(subst none+,,$(arch-features)) 257f1821790SAlexei Fedorovifeq ($(ARCH), aarch32) 258f1821790SAlexei Fedorovmarch32-directive := $(march32-directive)+$(arch-features) 259f1821790SAlexei Fedorovelse 260f1821790SAlexei Fedorovmarch64-directive := $(march64-directive)+$(arch-features) 2617ff088d1SManish V Badarkheendif 262f1821790SAlexei Fedorov# Print features 263f1821790SAlexei Fedorov$(info Arm Architecture Features specified: $(subst +, ,$(arch-features))) 264f1821790SAlexei Fedorovendif # arch-features 2657ff088d1SManish V Badarkhe 26612cd65e0STomas Pilar# Determine if FEAT_RNG is supported 26712cd65e0STomas PilarENABLE_FEAT_RNG = $(if $(findstring rng,${arch-features}),1,0) 26812cd65e0STomas Pilar 2694e04478aSChris Kay# Determine if FEAT_SB is supported 2704e04478aSChris KayENABLE_FEAT_SB = $(if $(findstring sb,${arch-features}),1,0) 2714e04478aSChris Kay 272c8a992fdSoriginifneq ($(findstring clang,$(notdir $(CC))),) 273fd18a8fcSVarun Wadekar ifneq ($(findstring armclang,$(notdir $(CC))),) 274c8a992fdSorigin TF_CFLAGS_aarch32 := -target arm-arm-none-eabi $(march32-directive) 275c8a992fdSorigin TF_CFLAGS_aarch64 := -target aarch64-arm-none-eabi $(march64-directive) 276c8a992fdSorigin LD := $(LINKER) 277c8a992fdSorigin else 278c8a992fdSorigin TF_CFLAGS_aarch32 := $(target32-directive) $(march32-directive) 279c8a992fdSorigin TF_CFLAGS_aarch64 := -target aarch64-elf $(march64-directive) 280c8a992fdSorigin LD := $(shell $(CC) --print-prog-name ld.lld) 281c8a992fdSorigin 282c8a992fdSorigin AR := $(shell $(CC) --print-prog-name llvm-ar) 283c8a992fdSorigin OD := $(shell $(CC) --print-prog-name llvm-objdump) 284c8a992fdSorigin OC := $(shell $(CC) --print-prog-name llvm-objcopy) 285641f16e7SAmbroise Vincent endif 286c8a992fdSorigin 287c8a992fdSorigin CPP := $(CC) -E $(TF_CFLAGS_$(ARCH)) 288c8a992fdSorigin PP := $(CC) -E $(TF_CFLAGS_$(ARCH)) 289c8a992fdSorigin AS := $(CC) -c -x assembler-with-cpp $(TF_CFLAGS_$(ARCH)) 290edbce9aaSzelalem-awekeelse ifneq ($(findstring gcc,$(notdir $(CC))),) 291edbce9aaSzelalem-awekeTF_CFLAGS_aarch32 = $(march32-directive) 292edbce9aaSzelalem-awekeTF_CFLAGS_aarch64 = $(march64-directive) 293edbce9aaSzelalem-awekeifeq ($(ENABLE_LTO),1) 294edbce9aaSzelalem-aweke # Enable LTO only for aarch64 295edbce9aaSzelalem-aweke ifeq (${ARCH},aarch64) 296edbce9aaSzelalem-aweke LTO_CFLAGS = -flto 297edbce9aaSzelalem-aweke # Use gcc as a wrapper for the ld, recommended for LTO 298edbce9aaSzelalem-aweke LINKER := ${CROSS_COMPILE}gcc 299edbce9aaSzelalem-aweke endif 300edbce9aaSzelalem-awekeendif 301edbce9aaSzelalem-awekeLD = $(LINKER) 302d5461857Sdp-armelse 30326e63c44SEtienne CarriereTF_CFLAGS_aarch32 = $(march32-directive) 304fa6f774bSAlexei FedorovTF_CFLAGS_aarch64 = $(march64-directive) 3052adee763SRoberto VargasLD = $(LINKER) 306d5461857Sdp-armendif 307d5461857Sdp-arm 30832b209bfSAhmad Fatoum# Process Debug flag 30932b209bfSAhmad Fatoum$(eval $(call add_define,DEBUG)) 31032b209bfSAhmad Fatoumifneq (${DEBUG}, 0) 31132b209bfSAhmad Fatoum BUILD_TYPE := debug 3124466cf82SDaniel Boulby TF_CFLAGS += -g -gdwarf-4 3134466cf82SDaniel Boulby ASFLAGS += -g -Wa,-gdwarf-4 31432b209bfSAhmad Fatoum 31532b209bfSAhmad Fatoum # Use LOG_LEVEL_INFO by default for debug builds 31632b209bfSAhmad Fatoum LOG_LEVEL := 40 31732b209bfSAhmad Fatoumelse 31832b209bfSAhmad Fatoum BUILD_TYPE := release 31932b209bfSAhmad Fatoum # Use LOG_LEVEL_NOTICE by default for release builds 32032b209bfSAhmad Fatoum LOG_LEVEL := 20 32132b209bfSAhmad Fatoumendif 32232b209bfSAhmad Fatoum 323f1de4c8fSPeiyuan Song# Default build string (git branch and commit) 324f1de4c8fSPeiyuan Songifeq (${BUILD_STRING},) 325f1de4c8fSPeiyuan Song BUILD_STRING := $(shell git describe --always --dirty --tags 2> /dev/null) 326f1de4c8fSPeiyuan Songendif 327dddf4283Slaurenw-armVERSION_STRING := v${VERSION}(${BUILD_TYPE}):${BUILD_STRING} 328f1de4c8fSPeiyuan Song 3298fd9d4d5SAntonio Nino Diazifeq (${AARCH32_INSTRUCTION_SET},A32) 3308fd9d4d5SAntonio Nino DiazTF_CFLAGS_aarch32 += -marm 3318fd9d4d5SAntonio Nino Diazelse ifeq (${AARCH32_INSTRUCTION_SET},T32) 3328fd9d4d5SAntonio Nino DiazTF_CFLAGS_aarch32 += -mthumb 3338fd9d4d5SAntonio Nino Diazelse 3348fd9d4d5SAntonio Nino Diaz$(error Error: Unknown AArch32 instruction set ${AARCH32_INSTRUCTION_SET}) 3358fd9d4d5SAntonio Nino Diazendif 3368fd9d4d5SAntonio Nino Diaz 337a9c4dde3SSandrine BailleuxTF_CFLAGS_aarch32 += -mno-unaligned-access 338d5461857Sdp-armTF_CFLAGS_aarch64 += -mgeneral-regs-only -mstrict-align 3399d29c227SSoby Mathew 3409fc59639SAlexei Fedorovifneq (${BP_OPTION},none) 3419fc59639SAlexei FedorovTF_CFLAGS_aarch64 += -mbranch-protection=${BP_OPTION} 3429fc59639SAlexei Fedorovendif 3439fc59639SAlexei Fedorov 34426e63c44SEtienne CarriereASFLAGS_aarch32 = $(march32-directive) 345fa6f774bSAlexei FedorovASFLAGS_aarch64 = $(march64-directive) 346b86048c4SAntonio Nino Diaz 3479ab81b5eSJustin Chadwell# General warnings 3489ab81b5eSJustin ChadwellWARNINGS := -Wall -Wmissing-include-dirs -Wunused \ 349b7f6525dSJustin Chadwell -Wdisabled-optimization -Wvla -Wshadow \ 350ca661a00SMadhukar Pappireddy -Wno-unused-parameter -Wredundant-decls 3519ab81b5eSJustin Chadwell 3529ab81b5eSJustin Chadwell# Additional warnings 3539ab81b5eSJustin Chadwell# Level 1 354e7c645b5SYann GautierWARNING1 := -Wextra 355e7c645b5SYann GautierWARNING1 += -Wmissing-format-attribute 356e7c645b5SYann GautierWARNING1 += -Wmissing-prototypes 357e7c645b5SYann GautierWARNING1 += -Wold-style-definition 358e7c645b5SYann Gautier 359b7f6525dSJustin Chadwell# Level 2 360e7c645b5SYann GautierWARNING2 := -Waggregate-return 361e7c645b5SYann GautierWARNING2 += -Wcast-align 362e7c645b5SYann GautierWARNING2 += -Wnested-externs 363e7c645b5SYann Gautier 364e7c645b5SYann GautierWARNING3 := -Wbad-function-cast 365e7c645b5SYann GautierWARNING3 += -Wcast-qual 366e7c645b5SYann GautierWARNING3 += -Wconversion 367e7c645b5SYann GautierWARNING3 += -Wpacked 368e7c645b5SYann GautierWARNING3 += -Wpointer-arith 369e7c645b5SYann GautierWARNING3 += -Wswitch-default 370e7c645b5SYann Gautier 371e7c645b5SYann Gautierifeq (${W},1) 3729ab81b5eSJustin ChadwellWARNINGS += $(WARNING1) 373e7c645b5SYann Gautierelse ifeq (${W},2) 3749ab81b5eSJustin ChadwellWARNINGS += $(WARNING1) $(WARNING2) 375e7c645b5SYann Gautierelse ifeq (${W},3) 3769ab81b5eSJustin ChadwellWARNINGS += $(WARNING1) $(WARNING2) $(WARNING3) 377e7c645b5SYann Gautierendif 378e7c645b5SYann Gautier 3799ab81b5eSJustin Chadwell# Compiler specific warnings 38000296576SAmbroise Vincentifeq ($(findstring clang,$(notdir $(CC))),) 38193c690ebSJustin Chadwell# not using clang 382d7b4cd41SJustin ChadwellWARNINGS += -Wunused-but-set-variable -Wmaybe-uninitialized \ 383d7b4cd41SJustin Chadwell -Wpacked-bitfield-compat -Wshift-overflow=2 \ 384d7b4cd41SJustin Chadwell -Wlogical-op 38593c690ebSJustin Chadwellelse 38693c690ebSJustin Chadwell# using clang 387d7b4cd41SJustin ChadwellWARNINGS += -Wshift-overflow -Wshift-sign-overflow \ 388d7b4cd41SJustin Chadwell -Wlogical-op-parentheses 38900296576SAmbroise Vincentendif 39000296576SAmbroise Vincent 3916336b07aSYann Gautierifneq (${E},0) 3926336b07aSYann GautierERRORS := -Werror 3936336b07aSYann Gautierendif 3946336b07aSYann Gautier 395ea7a57a3SRoberto VargasCPPFLAGS = ${DEFINES} ${INCLUDES} ${MBEDTLS_INC} -nostdinc \ 3969ab81b5eSJustin Chadwell $(ERRORS) $(WARNINGS) 39759de5096SMasahiro YamadaASFLAGS += $(CPPFLAGS) $(ASFLAGS_$(ARCH)) \ 398d5dfdeb6SJulius Werner -ffreestanding -Wa,--fatal-warnings 39959de5096SMasahiro YamadaTF_CFLAGS += $(CPPFLAGS) $(TF_CFLAGS_$(ARCH)) \ 400ebd6efaeSSamuel Holland -ffunction-sections -fdata-sections \ 401ebd6efaeSSamuel Holland -ffreestanding -fno-builtin -fno-common \ 402ebd6efaeSSamuel Holland -Os -std=gnu99 40373c99d4eSJuan Castillo 404bebcf27fSMark Brown$(eval $(call add_define,SVE_VECTOR_LEN)) 405bebcf27fSMark Brown 4061f461979SJustin Chadwellifeq (${SANITIZE_UB},on) 4071f461979SJustin ChadwellTF_CFLAGS += -fsanitize=undefined -fno-sanitize-recover 4081f461979SJustin Chadwellendif 4091f461979SJustin Chadwellifeq (${SANITIZE_UB},trap) 4101f461979SJustin ChadwellTF_CFLAGS += -fsanitize=undefined -fno-sanitize-recover \ 4111f461979SJustin Chadwell -fsanitize-undefined-trap-on-error 4121f461979SJustin Chadwellendif 4131f461979SJustin Chadwell 414f7ec31dbSdavid cunadoGCC_V_OUTPUT := $(shell $(CC) -v 2>&1) 415f7ec31dbSdavid cunado 416641f16e7SAmbroise Vincent# LD = armlink 417c2ad38ceSVarun Wadekarifneq ($(findstring armlink,$(notdir $(LD))),) 418c2ad38ceSVarun WadekarTF_LDFLAGS += --diag_error=warning --lto_level=O1 419c2ad38ceSVarun WadekarTF_LDFLAGS += --remove --info=unused,unusedsymbols 420edbce9aaSzelalem-awekeTF_LDFLAGS += $(TF_LDFLAGS_$(ARCH)) 421641f16e7SAmbroise Vincent 422641f16e7SAmbroise Vincent# LD = gcc (used when GCC LTO is enabled) 423edbce9aaSzelalem-awekeelse ifneq ($(findstring gcc,$(notdir $(LD))),) 424edbce9aaSzelalem-aweke# Pass ld options with Wl or Xlinker switches 425edbce9aaSzelalem-awekeTF_LDFLAGS += -Wl,--fatal-warnings -O1 426edbce9aaSzelalem-awekeTF_LDFLAGS += -Wl,--gc-sections 427edbce9aaSzelalem-awekeifeq ($(ENABLE_LTO),1) 428edbce9aaSzelalem-aweke ifeq (${ARCH},aarch64) 429edbce9aaSzelalem-aweke TF_LDFLAGS += -flto -fuse-linker-plugin 430edbce9aaSzelalem-aweke endif 431edbce9aaSzelalem-awekeendif 432edbce9aaSzelalem-aweke# GCC automatically adds fix-cortex-a53-843419 flag when used to link 433edbce9aaSzelalem-aweke# which breaks some builds, so disable if errata fix is not explicitly enabled 434edbce9aaSzelalem-awekeifneq (${ERRATA_A53_843419},1) 435edbce9aaSzelalem-aweke TF_LDFLAGS += -mno-fix-cortex-a53-843419 436edbce9aaSzelalem-awekeendif 437edbce9aaSzelalem-awekeTF_LDFLAGS += -nostdlib 438edbce9aaSzelalem-awekeTF_LDFLAGS += $(subst --,-Xlinker --,$(TF_LDFLAGS_$(ARCH))) 439641f16e7SAmbroise Vincent 440641f16e7SAmbroise Vincent# LD = gcc-ld (ld) or llvm-ld (ld.lld) or other 441c2ad38ceSVarun Wadekarelse 442c2b8806fSDouglas RaillardTF_LDFLAGS += --fatal-warnings -O1 443c2b8806fSDouglas RaillardTF_LDFLAGS += --gc-sections 444641f16e7SAmbroise Vincent# ld.lld doesn't recognize the errata flags, 445641f16e7SAmbroise Vincent# therefore don't add those in that case 446641f16e7SAmbroise Vincentifeq ($(findstring ld.lld,$(notdir $(LD))),) 447c2b8806fSDouglas RaillardTF_LDFLAGS += $(TF_LDFLAGS_$(ARCH)) 448edbce9aaSzelalem-awekeendif 449641f16e7SAmbroise Vincentendif 45073c99d4eSJuan Castillo 45103b397a8SNishanth MenonDTC_FLAGS += -I dts -O dtb 452a6de824fSLouis MayencourtDTC_CPPFLAGS += -P -nostdinc -Iinclude -Ifdts -undef \ 453a6de824fSLouis Mayencourt -x assembler-with-cpp $(DEFINES) 45403b397a8SNishanth Menon 45573c99d4eSJuan Castillo################################################################################ 45673c99d4eSJuan Castillo# Common sources and include directories 45773c99d4eSJuan Castillo################################################################################ 4586a0da736SJayanth Dodderi Chidanandinclude ${MAKE_HELPERS_DIRECTORY}arch_features.mk 459d801fbb0Sdp-arminclude lib/compiler-rt/compiler-rt.mk 46073c99d4eSJuan Castillo 46173c99d4eSJuan CastilloBL_COMMON_SOURCES += common/bl_common.c \ 4627f56e9a3SSoby Mathew common/tf_log.c \ 4639d29c227SSoby Mathew common/${ARCH}/debug.S \ 46491b48c9fSJulius Werner drivers/console/multi_console.c \ 4659d29c227SSoby Mathew lib/${ARCH}/cache_helpers.S \ 4669d29c227SSoby Mathew lib/${ARCH}/misc_helpers.S \ 467566034fcSSoby Mathew plat/common/plat_bl_common.c \ 4687f56e9a3SSoby Mathew plat/common/plat_log_common.c \ 46975311203Sdp-arm plat/common/${ARCH}/plat_common.c \ 4709d29c227SSoby Mathew plat/common/${ARCH}/platform_helpers.S \ 47161f72a34SRoberto Vargas ${COMPILER_RT_SRCS} 472d7a6b0f8SRyan Harkin 4738422a840SAntonio Nino Diazifeq ($(notdir $(CC)),armclang) 4748422a840SAntonio Nino DiazBL_COMMON_SOURCES += lib/${ARCH}/armclang_printf.S 4758422a840SAntonio Nino Diazendif 4768422a840SAntonio Nino Diaz 4771f461979SJustin Chadwellifeq (${SANITIZE_UB},on) 4781f461979SJustin ChadwellBL_COMMON_SOURCES += plat/common/ubsan.c 4791f461979SJustin Chadwellendif 4801f461979SJustin Chadwell 48101d237cbSYann GautierINCLUDES += -Iinclude \ 482f5478dedSAntonio Nino Diaz -Iinclude/arch/${ARCH} \ 48309d40e0eSAntonio Nino Diaz -Iinclude/lib/cpus/${ARCH} \ 48409d40e0eSAntonio Nino Diaz -Iinclude/lib/el3_runtime/${ARCH} \ 48509d40e0eSAntonio Nino Diaz ${PLAT_INCLUDES} \ 48609d40e0eSAntonio Nino Diaz ${SPD_INCLUDES} 48709d40e0eSAntonio Nino Diaz 4889c6d1c50SAntonio Nino Diazinclude common/backtrace/backtrace.mk 4899c6d1c50SAntonio Nino Diaz 49073c99d4eSJuan Castillo################################################################################ 49173c99d4eSJuan Castillo# Generic definitions 49273c99d4eSJuan Castillo################################################################################ 49373c99d4eSJuan Castillo 494231c1470SEvan Lloydinclude ${MAKE_HELPERS_DIRECTORY}plat_helpers.mk 495231c1470SEvan Lloyd 49629214e95SGrant Likelyifeq (${BUILD_BASE},) 49773c99d4eSJuan Castillo BUILD_BASE := ./build 49829214e95SGrant Likelyendif 49929214e95SGrant LikelyBUILD_PLAT := $(abspath ${BUILD_BASE})/${PLAT}/${BUILD_TYPE} 50073c99d4eSJuan Castillo 501231c1470SEvan LloydSPDS := $(sort $(filter-out none, $(patsubst services/spd/%,%,$(wildcard services/spd/*)))) 50273c99d4eSJuan Castillo 50373c99d4eSJuan Castillo# Platforms providing their own TBB makefile may override this value 50473c99d4eSJuan CastilloINCLUDE_TBBR_MK := 1 50573c99d4eSJuan Castillo 50673c99d4eSJuan Castillo 50773c99d4eSJuan Castillo################################################################################ 50873c99d4eSJuan Castillo# Include SPD Makefile if one has been specified 50973c99d4eSJuan Castillo################################################################################ 51073c99d4eSJuan Castillo 51173c99d4eSJuan Castilloifneq (${SPD},none) 5129d29c227SSoby Mathew ifeq (${ARCH},aarch32) 5139d29c227SSoby Mathew $(error "Error: SPD is incompatible with AArch32.") 5149d29c227SSoby Mathew endif 51528f39f02SMax Shvetsov 5164c117f6cSSandrine Bailleux ifdef EL3_PAYLOAD_BASE 5174c117f6cSSandrine Bailleux $(warning "SPD and EL3_PAYLOAD_BASE are incompatible build options.") 5184c117f6cSSandrine Bailleux $(warning "The SPD and its BL32 companion will be present but ignored.") 5194c117f6cSSandrine Bailleux endif 52028f39f02SMax Shvetsov 521c3fb00d9SAchin Gupta ifeq (${SPD},spmd) 522c3fb00d9SAchin Gupta # SPMD is located in std_svc directory 523c3fb00d9SAchin Gupta SPD_DIR := std_svc 52428f39f02SMax Shvetsov 525033039f8SMax Shvetsov ifeq ($(SPMD_SPM_AT_SEL2),1) 52628f39f02SMax Shvetsov ifeq ($(CTX_INCLUDE_EL2_REGS),0) 527033039f8SMax Shvetsov $(error SPMD with SPM at S-EL2 requires CTX_INCLUDE_EL2_REGS option) 528033039f8SMax Shvetsov endif 5291d63ae4dSMarc Bonnici ifeq ($(SPMC_AT_EL3),1) 5301d63ae4dSMarc Bonnici $(error SPM cannot be enabled in both S-EL2 and EL3.) 5311d63ae4dSMarc Bonnici endif 53228f39f02SMax Shvetsov endif 533db1ef41aSOlivier Deprez 534db1ef41aSOlivier Deprez ifeq ($(findstring optee_sp,$(ARM_SPMC_MANIFEST_DTS)),optee_sp) 535db1ef41aSOlivier Deprez DTC_CPPFLAGS += -DOPTEE_SP_FW_CONFIG 536db1ef41aSOlivier Deprez endif 537ca932481SDavidson K 538ca932481SDavidson K ifeq ($(TS_SP_FW_CONFIG),1) 539ca932481SDavidson K DTC_CPPFLAGS += -DTS_SP_FW_CONFIG 540ca932481SDavidson K endif 54133993a37SBalint Dobszay 54233993a37SBalint Dobszay ifneq ($(ARM_BL2_SP_LIST_DTS),) 54333993a37SBalint Dobszay DTC_CPPFLAGS += -DARM_BL2_SP_LIST_DTS=$(ARM_BL2_SP_LIST_DTS) 54433993a37SBalint Dobszay endif 54546789a7cSBalint Dobszay 54646789a7cSBalint Dobszay ifneq ($(SP_LAYOUT_FILE),) 54746789a7cSBalint Dobszay BL2_ENABLE_SP_LOAD := 1 54846789a7cSBalint Dobszay endif 549c3fb00d9SAchin Gupta else 550c3fb00d9SAchin Gupta # All other SPDs in spd directory 551c3fb00d9SAchin Gupta SPD_DIR := spd 552c3fb00d9SAchin Gupta endif 553c3fb00d9SAchin Gupta 55473c99d4eSJuan Castillo # We expect to locate an spd.mk under the specified SPD directory 555c3fb00d9SAchin Gupta SPD_MAKE := $(wildcard services/${SPD_DIR}/${SPD}/${SPD}.mk) 556c3fb00d9SAchin Gupta 55773c99d4eSJuan Castillo ifeq (${SPD_MAKE},) 558c3fb00d9SAchin Gupta $(error Error: No services/${SPD_DIR}/${SPD}/${SPD}.mk located) 55973c99d4eSJuan Castillo endif 56073c99d4eSJuan Castillo $(info Including ${SPD_MAKE}) 56173c99d4eSJuan Castillo include ${SPD_MAKE} 56273c99d4eSJuan Castillo 56370d1fc53SJuan Castillo # If there's BL32 companion for the chosen SPD, we expect that the SPD's 56470d1fc53SJuan Castillo # Makefile would set NEED_BL32 to "yes". In this case, the build system 56570d1fc53SJuan Castillo # supports two mutually exclusive options: 56670d1fc53SJuan Castillo # * BL32 is built from source: then BL32_SOURCES must contain the list 56770d1fc53SJuan Castillo # of source files to build BL32 56870d1fc53SJuan Castillo # * BL32 is a prebuilt binary: then BL32 must point to the image file 56970d1fc53SJuan Castillo # that will be included in the FIP 57070d1fc53SJuan Castillo # If both BL32_SOURCES and BL32 are defined, the binary takes precedence 57170d1fc53SJuan Castillo # over the sources. 572e35c4045SJeenu Viswambharanendif 573e35c4045SJeenu Viswambharan 57451faada7SDouglas Raillard################################################################################ 5755b18de09SZelalem Aweke# Include rmmd Makefile if RME is enabled 5765b18de09SZelalem Aweke################################################################################ 5775b18de09SZelalem Aweke 5785b18de09SZelalem Awekeifneq (${ENABLE_RME},0) 5795b18de09SZelalem Awekeifneq (${ARCH},aarch64) 5805b18de09SZelalem Aweke $(error ENABLE_RME requires AArch64) 5815b18de09SZelalem Awekeendif 5821d63ae4dSMarc Bonniciifeq ($(SPMC_AT_EL3),1) 5831d63ae4dSMarc Bonnici $(error SPMC_AT_EL3 and ENABLE_RME cannot both be enabled.) 5841d63ae4dSMarc Bonniciendif 5855b18de09SZelalem Awekeinclude services/std_svc/rmmd/rmmd.mk 5865b18de09SZelalem Aweke$(warning "RME is an experimental feature") 5875b18de09SZelalem Awekeendif 5885b18de09SZelalem Aweke 5895b18de09SZelalem Aweke################################################################################ 59073c99d4eSJuan Castillo# Include the platform specific Makefile after the SPD Makefile (the platform 59173c99d4eSJuan Castillo# makefile may use all previous definitions in this file) 59273c99d4eSJuan Castillo################################################################################ 5932da8d8bfSJeenu Viswambharan 59473c99d4eSJuan Castilloinclude ${PLAT_MAKEFILE_FULL} 5950f21c547SJuan Castillo 5968012cc5cSMasahiro Yamada$(eval $(call MAKE_PREREQ_DIR,${BUILD_PLAT})) 5978012cc5cSMasahiro Yamada 59826e63c44SEtienne Carriereifeq (${ARM_ARCH_MAJOR},7) 59926e63c44SEtienne Carriereinclude make_helpers/armv7-a-cpus.mk 60026e63c44SEtienne Carriereendif 60126e63c44SEtienne Carriere 6023bd17c0fSSoby MathewPIE_FOUND := $(findstring --enable-default-pie,${GCC_V_OUTPUT}) 6033bd17c0fSSoby Mathewifneq ($(PIE_FOUND),) 6043bd17c0fSSoby Mathew TF_CFLAGS += -fno-PIE 6057b592418SSamuel Hollandifneq ($(findstring gcc,$(notdir $(LD))),) 6067b592418SSamuel Holland TF_LDFLAGS += -no-pie 6077b592418SSamuel Hollandendif 6083bd17c0fSSoby Mathewendif 609320920c1SMasahiro Yamada 610320920c1SMasahiro Yamadaifneq ($(findstring gcc,$(notdir $(LD))),) 611320920c1SMasahiro Yamada PIE_LDFLAGS += -Wl,-pie -Wl,--no-dynamic-linker 612320920c1SMasahiro Yamadaelse 613320920c1SMasahiro Yamada PIE_LDFLAGS += -pie --no-dynamic-linker 614320920c1SMasahiro Yamadaendif 615320920c1SMasahiro Yamada 616320920c1SMasahiro Yamadaifeq ($(ENABLE_PIE),1) 61769af7fcfSMasahiro Yamadaifeq ($(BL2_AT_EL3),1) 61869af7fcfSMasahiro Yamadaifneq ($(BL2_IN_XIP_MEM),1) 61969af7fcfSMasahiro Yamada BL2_CFLAGS += -fpie 62069af7fcfSMasahiro Yamada BL2_LDFLAGS += $(PIE_LDFLAGS) 62169af7fcfSMasahiro Yamadaendif 62269af7fcfSMasahiro Yamadaendif 623320920c1SMasahiro Yamada BL31_CFLAGS += -fpie 624320920c1SMasahiro Yamada BL31_LDFLAGS += $(PIE_LDFLAGS) 625d974301dSMasahiro Yamada BL32_CFLAGS += -fpie 626d974301dSMasahiro Yamada BL32_LDFLAGS += $(PIE_LDFLAGS) 627d974301dSMasahiro Yamadaendif 6283bd17c0fSSoby Mathew 629d5e97a1dSMasahiro Yamadaifeq (${ARCH},aarch64) 6309cefb4b1SMasahiro YamadaBL1_CPPFLAGS += -DIMAGE_AT_EL3 631d5e97a1dSMasahiro Yamadaifeq ($(BL2_AT_EL3),1) 6329cefb4b1SMasahiro YamadaBL2_CPPFLAGS += -DIMAGE_AT_EL3 633d5e97a1dSMasahiro Yamadaelse 6349cefb4b1SMasahiro YamadaBL2_CPPFLAGS += -DIMAGE_AT_EL1 635d5e97a1dSMasahiro Yamadaendif 6369cefb4b1SMasahiro YamadaBL2U_CPPFLAGS += -DIMAGE_AT_EL1 6379cefb4b1SMasahiro YamadaBL31_CPPFLAGS += -DIMAGE_AT_EL3 6389cefb4b1SMasahiro YamadaBL32_CPPFLAGS += -DIMAGE_AT_EL1 639d5e97a1dSMasahiro Yamadaendif 640d5e97a1dSMasahiro Yamada 64154035fc4SSandrine Bailleux# Include the CPU specific operations makefile, which provides default 64254035fc4SSandrine Bailleux# values for all CPU errata workarounds and CPU specific optimisations. 64354035fc4SSandrine Bailleux# This can be overridden by the platform. 64473c99d4eSJuan Castilloinclude lib/cpus/cpu-ops.mk 6454f6ad66aSAchin Gupta 646a4409008Sdp-armifeq (${ARCH},aarch32) 647a4409008Sdp-armNEED_BL32 := yes 648a4409008Sdp-arm 649a4409008Sdp-arm################################################################################ 650a4409008Sdp-arm# Build `AARCH32_SP` as BL32 image for AArch32 651a4409008Sdp-arm################################################################################ 652a4409008Sdp-armifneq (${AARCH32_SP},none) 653a4409008Sdp-arm# We expect to locate an sp.mk under the specified AARCH32_SP directory 654a4409008Sdp-armAARCH32_SP_MAKE := $(wildcard bl32/${AARCH32_SP}/${AARCH32_SP}.mk) 655a4409008Sdp-arm 656a4409008Sdp-armifeq (${AARCH32_SP_MAKE},) 657a4409008Sdp-arm $(error Error: No bl32/${AARCH32_SP}/${AARCH32_SP}.mk located) 658a4409008Sdp-armendif 659a4409008Sdp-arm 660a4409008Sdp-arm$(info Including ${AARCH32_SP_MAKE}) 661a4409008Sdp-arminclude ${AARCH32_SP_MAKE} 662a4409008Sdp-armendif 663a4409008Sdp-arm 664a4409008Sdp-armendif 6654f6ad66aSAchin Gupta 66673c99d4eSJuan Castillo################################################################################ 66777f1f7a1SVarun Wadekar# Include libc if not overridden 66877f1f7a1SVarun Wadekar################################################################################ 66977f1f7a1SVarun Wadekarifeq (${OVERRIDE_LIBC},0) 67077f1f7a1SVarun Wadekarinclude lib/libc/libc.mk 67177f1f7a1SVarun Wadekarendif 67277f1f7a1SVarun Wadekar 67377f1f7a1SVarun Wadekar################################################################################ 674cf2c8a33SAntonio Nino Diaz# Check incompatible options 675cf2c8a33SAntonio Nino Diaz################################################################################ 676cf2c8a33SAntonio Nino Diaz 677cf2c8a33SAntonio Nino Diazifdef EL3_PAYLOAD_BASE 67868450a6dSAntonio Nino Diaz ifdef PRELOADED_BL33_BASE 67968450a6dSAntonio Nino Diaz $(warning "PRELOADED_BL33_BASE and EL3_PAYLOAD_BASE are \ 68068450a6dSAntonio Nino Diaz incompatible build options. EL3_PAYLOAD_BASE has priority.") 681cf2c8a33SAntonio Nino Diaz endif 68276580f3dSQixiang Xu ifneq (${GENERATE_COT},0) 68376580f3dSQixiang Xu $(error "GENERATE_COT and EL3_PAYLOAD_BASE are incompatible build options.") 68476580f3dSQixiang Xu endif 68576580f3dSQixiang Xu ifneq (${TRUSTED_BOARD_BOOT},0) 68676580f3dSQixiang Xu $(error "TRUSTED_BOARD_BOOT and EL3_PAYLOAD_BASE are incompatible build options.") 68776580f3dSQixiang Xu endif 688cf2c8a33SAntonio Nino Diazendif 689cf2c8a33SAntonio Nino Diaz 690cf2c8a33SAntonio Nino Diazifeq (${NEED_BL33},yes) 691cf2c8a33SAntonio Nino Diaz ifdef EL3_PAYLOAD_BASE 692cf2c8a33SAntonio Nino Diaz $(warning "BL33 image is not needed when option \ 693cf2c8a33SAntonio Nino Diaz BL33_PAYLOAD_BASE is used and won't be added to the FIP file.") 694cf2c8a33SAntonio Nino Diaz endif 69568450a6dSAntonio Nino Diaz ifdef PRELOADED_BL33_BASE 69668450a6dSAntonio Nino Diaz $(warning "BL33 image is not needed when option \ 69768450a6dSAntonio Nino Diaz PRELOADED_BL33_BASE is used and won't be added to the FIP \ 69868450a6dSAntonio Nino Diaz file.") 699cf2c8a33SAntonio Nino Diaz endif 700cf2c8a33SAntonio Nino Diazendif 701cf2c8a33SAntonio Nino Diaz 702d4593e47SJeenu Viswambharan# When building for systems with hardware-assisted coherency, there's no need to 703d4593e47SJeenu Viswambharan# use USE_COHERENT_MEM. Require that USE_COHERENT_MEM must be set to 0 too. 704d4593e47SJeenu Viswambharanifeq ($(HW_ASSISTED_COHERENCY)-$(USE_COHERENT_MEM),1-1) 705d4593e47SJeenu Viswambharan$(error USE_COHERENT_MEM cannot be enabled with HW_ASSISTED_COHERENCY) 706d4593e47SJeenu Viswambharanendif 7071a0a3f06SYatharth Kochar 7087d173fc5SJiafei Pan#For now, BL2_IN_XIP_MEM is only supported when BL2_AT_EL3 is 1. 7097d173fc5SJiafei Panifeq ($(BL2_AT_EL3)-$(BL2_IN_XIP_MEM),0-1) 7107d173fc5SJiafei Pan$(error "BL2_IN_XIP_MEM is only supported when BL2_AT_EL3 is enabled") 7117d173fc5SJiafei Panendif 7127d173fc5SJiafei Pan 71314c6016aSJeenu Viswambharan# For RAS_EXTENSION, require that EAs are handled in EL3 first 71414c6016aSJeenu Viswambharanifeq ($(RAS_EXTENSION),1) 71514c6016aSJeenu Viswambharan ifneq ($(HANDLE_EA_EL3_FIRST),1) 71614c6016aSJeenu Viswambharan $(error For RAS_EXTENSION, HANDLE_EA_EL3_FIRST must also be 1) 71714c6016aSJeenu Viswambharan endif 71814c6016aSJeenu Viswambharanendif 71914c6016aSJeenu Viswambharan 7201a7c1cfeSJeenu Viswambharan# When FAULT_INJECTION_SUPPORT is used, require that RAS_EXTENSION is enabled 7211a7c1cfeSJeenu Viswambharanifeq ($(FAULT_INJECTION_SUPPORT),1) 7221a7c1cfeSJeenu Viswambharan ifneq ($(RAS_EXTENSION),1) 7231a7c1cfeSJeenu Viswambharan $(error For FAULT_INJECTION_SUPPORT, RAS_EXTENSION must also be 1) 7241a7c1cfeSJeenu Viswambharan endif 7251a7c1cfeSJeenu Viswambharanendif 7261a7c1cfeSJeenu Viswambharan 727ed51b51fSRoberto Vargas# DYN_DISABLE_AUTH can be set only when TRUSTED_BOARD_BOOT=1 728209a60ccSSoby Mathewifeq ($(DYN_DISABLE_AUTH), 1) 729209a60ccSSoby Mathew ifeq (${TRUSTED_BOARD_BOOT}, 0) 730209a60ccSSoby Mathew $(error "TRUSTED_BOARD_BOOT must be enabled for DYN_DISABLE_AUTH to be set.") 731209a60ccSSoby Mathew endif 732209a60ccSSoby Mathewendif 733209a60ccSSoby Mathew 7342bf4f27fSManish V Badarkheifeq ($(MEASURED_BOOT)-$(TRUSTED_BOARD_BOOT),1-1) 7352bf4f27fSManish V Badarkhe# Support authentication verification and hash calculation 7362bf4f27fSManish V Badarkhe CRYPTO_SUPPORT := 3 7372bf4f27fSManish V Badarkheelse ifeq ($(DRTM_SUPPORT)-$(TRUSTED_BOARD_BOOT),1-1) 7382bf4f27fSManish V Badarkhe# Support authentication verification and hash calculation 7392bf4f27fSManish V Badarkhe CRYPTO_SUPPORT := 3 7402bf4f27fSManish V Badarkheelse ifneq ($(filter 1,${MEASURED_BOOT} ${DRTM_SUPPORT}),) 7412bf4f27fSManish V Badarkhe# Support hash calculation only 7422bf4f27fSManish V Badarkhe CRYPTO_SUPPORT := 2 7432bf4f27fSManish V Badarkheelse ifeq (${TRUSTED_BOARD_BOOT},1) 7442bf4f27fSManish V Badarkhe# Support authentication verification only 745c9c56f6eSManish V Badarkhe CRYPTO_SUPPORT := 1 746c9c56f6eSManish V Badarkheelse 747c9c56f6eSManish V Badarkhe CRYPTO_SUPPORT := 0 748c9c56f6eSManish V Badarkheendif 749c9c56f6eSManish V Badarkhe 750cbf9e84aSBalint Dobszay# SDEI_IN_FCONF is only supported when SDEI_SUPPORT is enabled. 751cbf9e84aSBalint Dobszayifeq ($(SDEI_SUPPORT)-$(SDEI_IN_FCONF),0-1) 752700e7685SManish Pandey$(error "SDEI_IN_FCONF is only supported when SDEI_SUPPORT is enabled") 75384ef9cd8SManish V Badarkheendif 75484ef9cd8SManish V Badarkhe 755b86048c4SAntonio Nino Diaz# If pointer authentication is used in the firmware, make sure that all the 7569fc59639SAlexei Fedorov# registers associated to it are also saved and restored. 7579fc59639SAlexei Fedorov# Not doing it would leak the value of the keys used by EL3 to EL1 and S-EL1. 758b86048c4SAntonio Nino Diazifeq ($(ENABLE_PAUTH),1) 7599fc59639SAlexei Fedorov ifeq ($(CTX_INCLUDE_PAUTH_REGS),0) 7609fc59639SAlexei Fedorov $(error Pointer Authentication requires CTX_INCLUDE_PAUTH_REGS=1) 76106715f85SAlexei Fedorov endif 7629fc59639SAlexei Fedorovendif 7639fc59639SAlexei Fedorov 76406715f85SAlexei Fedorovifeq ($(CTX_INCLUDE_PAUTH_REGS),1) 7659fc59639SAlexei Fedorov ifneq (${ARCH},aarch64) 7669fc59639SAlexei Fedorov $(error CTX_INCLUDE_PAUTH_REGS requires AArch64) 767b86048c4SAntonio Nino Diaz endif 768b86048c4SAntonio Nino Diazendif 7699fc59639SAlexei Fedorov 7709dd94382SJustin Chadwellifeq ($(CTX_INCLUDE_MTE_REGS),1) 7719dd94382SJustin Chadwell ifneq (${ARCH},aarch64) 7729dd94382SJustin Chadwell $(error CTX_INCLUDE_MTE_REGS requires AArch64) 7739dd94382SJustin Chadwell endif 7749dd94382SJustin Chadwellendif 7759dd94382SJustin Chadwell 776396b339dSManish V Badarkheifeq ($(PSA_FWU_SUPPORT),1) 777396b339dSManish V Badarkhe $(info PSA_FWU_SUPPORT is an experimental feature) 778396b339dSManish V Badarkheendif 779396b339dSManish V Badarkhe 7806a0da736SJayanth Dodderi Chidanandifeq ($(FEATURE_DETECTION),1) 7816a0da736SJayanth Dodderi Chidanand $(info FEATURE_DETECTION is an experimental feature) 7826a0da736SJayanth Dodderi Chidanandendif 7836a0da736SJayanth Dodderi Chidanand 78460e8f3cfSPetre-Ionut Tudorifeq (${ARM_XLAT_TABLES_LIB_V1}, 1) 78560e8f3cfSPetre-Ionut Tudor ifeq (${ALLOW_RO_XLAT_TABLES}, 1) 78660e8f3cfSPetre-Ionut Tudor $(error "ALLOW_RO_XLAT_TABLES requires translation tables library v2") 78760e8f3cfSPetre-Ionut Tudor endif 78860e8f3cfSPetre-Ionut Tudorendif 78960e8f3cfSPetre-Ionut Tudor 7907cda17bbSSumit Gargifneq (${DECRYPTION_SUPPORT},none) 7917cda17bbSSumit Garg ifeq (${TRUSTED_BOARD_BOOT}, 0) 7927cda17bbSSumit Garg $(error TRUSTED_BOARD_BOOT must be enabled for DECRYPTION_SUPPORT to be set) 7937cda17bbSSumit Garg endif 7947cda17bbSSumit Gargendif 7957cda17bbSSumit Garg 796744ad974Sjohpow01# Ensure that no Aarch64-only features are enabled in Aarch32 build 797dc78e62dSjohpow01ifeq (${ARCH},aarch32) 798744ad974Sjohpow01 799744ad974Sjohpow01 # SME/SVE only supported on AArch64 800dc78e62dSjohpow01 ifeq (${ENABLE_SME_FOR_NS},1) 801dc78e62dSjohpow01 $(error "ENABLE_SME_FOR_NS cannot be used with ARCH=aarch32") 802dc78e62dSjohpow01 endif 803dc78e62dSjohpow01 ifeq (${ENABLE_SVE_FOR_NS},1) 804dc78e62dSjohpow01 # Warning instead of error due to CI dependency on this 80524ab2c0aSYann Gautier $(error "ENABLE_SVE_FOR_NS cannot be used with ARCH=aarch32") 806dc78e62dSjohpow01 endif 807744ad974Sjohpow01 808ff86e0b4SJuan Pablo Conde # BRBE is not supported in AArch32 809744ad974Sjohpow01 ifeq (${ENABLE_BRBE_FOR_NS},1) 810744ad974Sjohpow01 $(error "ENABLE_BRBE_FOR_NS cannot be used with ARCH=aarch32") 811744ad974Sjohpow01 endif 812744ad974Sjohpow01 813ff86e0b4SJuan Pablo Conde # FEAT_RNG_TRAP is not supported in AArch32 814ff86e0b4SJuan Pablo Conde ifeq (${ENABLE_FEAT_RNG_TRAP},1) 815ff86e0b4SJuan Pablo Conde $(error "ENABLE_FEAT_RNG_TRAP cannot be used with ARCH=aarch32") 816ff86e0b4SJuan Pablo Conde endif 817dc78e62dSjohpow01endif 818dc78e62dSjohpow01 819dc78e62dSjohpow01# Ensure ENABLE_RME is not used with SME 820dc78e62dSjohpow01ifeq (${ENABLE_RME},1) 821dc78e62dSjohpow01 ifeq (${ENABLE_SME_FOR_NS},1) 822dc78e62dSjohpow01 $(error "ENABLE_SME_FOR_NS cannot be used with ENABLE_RME") 823dc78e62dSjohpow01 endif 824dc78e62dSjohpow01endif 825dc78e62dSjohpow01 826dc78e62dSjohpow01# Secure SME/SVE requires the non-secure component as well 827dc78e62dSjohpow01ifeq (${ENABLE_SME_FOR_SWD},1) 828dc78e62dSjohpow01 ifeq (${ENABLE_SME_FOR_NS},0) 829dc78e62dSjohpow01 $(error "ENABLE_SME_FOR_SWD requires ENABLE_SME_FOR_NS") 830dc78e62dSjohpow01 endif 831dc78e62dSjohpow01endif 832dc78e62dSjohpow01ifeq (${ENABLE_SVE_FOR_SWD},1) 833dc78e62dSjohpow01 ifeq (${ENABLE_SVE_FOR_NS},0) 834dc78e62dSjohpow01 $(error "ENABLE_SVE_FOR_SWD requires ENABLE_SVE_FOR_NS") 835dc78e62dSjohpow01 endif 836dc78e62dSjohpow01endif 837dc78e62dSjohpow01 838dc78e62dSjohpow01# SVE and SME cannot be used with CTX_INCLUDE_FPREGS since secure manager does 839dc78e62dSjohpow01# its own context management including FPU registers. 840dc78e62dSjohpow01ifeq (${CTX_INCLUDE_FPREGS},1) 841dc78e62dSjohpow01 ifeq (${ENABLE_SME_FOR_NS},1) 842dc78e62dSjohpow01 $(error "ENABLE_SME_FOR_NS cannot be used with CTX_INCLUDE_FPREGS") 843dc78e62dSjohpow01 endif 844dc78e62dSjohpow01 ifeq (${ENABLE_SVE_FOR_NS},1) 845dc78e62dSjohpow01 # Warning instead of error due to CI dependency on this 846dc78e62dSjohpow01 $(warning "ENABLE_SVE_FOR_NS cannot be used with CTX_INCLUDE_FPREGS") 847dc78e62dSjohpow01 $(warning "Forced ENABLE_SVE_FOR_NS=0") 848dc78e62dSjohpow01 override ENABLE_SVE_FOR_NS := 0 849dc78e62dSjohpow01 endif 850dc78e62dSjohpow01endif 851dc78e62dSjohpow01 85200e28874SManish V Badarkheifeq ($(DRTM_SUPPORT),1) 85300e28874SManish V Badarkhe $(info DRTM_SUPPORT is an experimental feature) 85400e28874SManish V Badarkheendif 85500e28874SManish V Badarkhe 856274a69e7SChris Kayifeq (${ENABLE_RME},1) 857274a69e7SChris Kay ifneq (${SEPARATE_CODE_AND_RODATA},1) 858274a69e7SChris Kay $(error `ENABLE_RME=1` requires `SEPARATE_CODE_AND_RODATA=1`) 859274a69e7SChris Kay endif 860274a69e7SChris Kayendif 861274a69e7SChris Kay 862cf2c8a33SAntonio Nino Diaz################################################################################ 86373c99d4eSJuan Castillo# Process platform overrideable behaviour 86473c99d4eSJuan Castillo################################################################################ 8654f6ad66aSAchin Gupta 8665f24ce96SManish Pandeyifdef BL1_SOURCES 8675f24ce96SManish PandeyNEED_BL1 := yes 8685f24ce96SManish Pandeyendif 8695f24ce96SManish Pandey 8705f24ce96SManish Pandeyifdef BL2_SOURCES 8715f24ce96SManish Pandey NEED_BL2 := yes 8725f24ce96SManish Pandey 873bd97f83aSJohn Tsichritzis # Using BL2 implies that a BL33 image also needs to be supplied for the FIP and 874bd97f83aSJohn Tsichritzis # Certificate generation tools. This flag can be overridden by the platform. 875cf2c8a33SAntonio Nino Diaz ifdef EL3_PAYLOAD_BASE 876cf2c8a33SAntonio Nino Diaz # If booting an EL3 payload there is no need for a BL33 image 877cf2c8a33SAntonio Nino Diaz # in the FIP file. 8784c117f6cSSandrine Bailleux NEED_BL33 := no 879cf2c8a33SAntonio Nino Diaz else 88068450a6dSAntonio Nino Diaz ifdef PRELOADED_BL33_BASE 881cf2c8a33SAntonio Nino Diaz # If booting a BL33 preloaded image there is no need of 882cf2c8a33SAntonio Nino Diaz # another one in the FIP file. 883cf2c8a33SAntonio Nino Diaz NEED_BL33 := no 884cf2c8a33SAntonio Nino Diaz else 885cf2c8a33SAntonio Nino Diaz NEED_BL33 ?= yes 886cf2c8a33SAntonio Nino Diaz endif 8874c117f6cSSandrine Bailleux endif 88873c99d4eSJuan Castilloendif 8896f971622SJuan Castillo 8905f24ce96SManish Pandeyifdef BL2U_SOURCES 8915f24ce96SManish PandeyNEED_BL2U := yes 8925f24ce96SManish Pandeyendif 8935f24ce96SManish Pandey 8944d045d0eSMasahiro Yamada# If SCP_BL2 is given, we always want FIP to include it. 8954d045d0eSMasahiro Yamadaifdef SCP_BL2 8964d045d0eSMasahiro Yamada NEED_SCP_BL2 := yes 8974d045d0eSMasahiro Yamadaendif 8984d045d0eSMasahiro Yamada 8995744e874SSoby Mathew# For AArch32, BL31 is not currently supported. 9005744e874SSoby Mathewifneq (${ARCH},aarch32) 9015744e874SSoby Mathew ifdef BL31_SOURCES 9025744e874SSoby Mathew # When booting an EL3 payload, there is no need to compile the BL31 image nor 9035744e874SSoby Mathew # put it in the FIP. 9045744e874SSoby Mathew ifndef EL3_PAYLOAD_BASE 9055744e874SSoby Mathew NEED_BL31 := yes 9065744e874SSoby Mathew endif 9075744e874SSoby Mathew endif 9085744e874SSoby Mathewendif 9095744e874SSoby Mathew 91073c99d4eSJuan Castillo# Process TBB related flags 9116f971622SJuan Castilloifneq (${GENERATE_COT},0) 91273c99d4eSJuan Castillo # Common cert_create options 9136f971622SJuan Castillo ifneq (${CREATE_KEYS},0) 9146f971622SJuan Castillo $(eval CRT_ARGS += -n) 9150191262dSYatharth Kochar $(eval FWU_CRT_ARGS += -n) 916fd34e7baSJuan Castillo ifneq (${SAVE_KEYS},0) 917fd34e7baSJuan Castillo $(eval CRT_ARGS += -k) 9180191262dSYatharth Kochar $(eval FWU_CRT_ARGS += -k) 919fd34e7baSJuan Castillo endif 9206f971622SJuan Castillo endif 92173c99d4eSJuan Castillo # Include TBBR makefile (unless the platform indicates otherwise) 92273c99d4eSJuan Castillo ifeq (${INCLUDE_TBBR_MK},1) 92373c99d4eSJuan Castillo include make_helpers/tbbr/tbbr_tools.mk 92473c99d4eSJuan Castillo endif 9256f971622SJuan Castilloendif 9266f971622SJuan Castillo 9271c75d5dfSMasahiro Yamadaifneq (${FIP_ALIGN},0) 9281c75d5dfSMasahiro YamadaFIP_ARGS += --align ${FIP_ALIGN} 9291c75d5dfSMasahiro Yamadaendif 9301c75d5dfSMasahiro Yamada 9315f24ce96SManish Pandeyifdef FDT_SOURCES 9325f24ce96SManish PandeyNEED_FDT := yes 9335f24ce96SManish Pandeyendif 9345f24ce96SManish Pandey 93573c99d4eSJuan Castillo################################################################################ 93646e5e035SMichalis Pappas# Include libraries' Makefile that are used in all BL 93746e5e035SMichalis Pappas################################################################################ 93846e5e035SMichalis Pappas 93946e5e035SMichalis Pappasinclude lib/stack_protector/stack_protector.mk 94046e5e035SMichalis Pappas 94146e5e035SMichalis Pappas################################################################################ 942819281eeSdp-arm# Auxiliary tools (fiptool, cert_create, etc) 94373c99d4eSJuan Castillo################################################################################ 94473c99d4eSJuan Castillo 94573c99d4eSJuan Castillo# Variables for use with Certificate Generation Tool 94673c99d4eSJuan CastilloCRTTOOLPATH ?= tools/cert_create 94742a45b51SEvan LloydCRTTOOL ?= ${CRTTOOLPATH}/cert_create${BIN_EXT} 94873c99d4eSJuan Castillo 94990aa901fSSumit Garg# Variables for use with Firmware Encryption Tool 95090aa901fSSumit GargENCTOOLPATH ?= tools/encrypt_fw 95190aa901fSSumit GargENCTOOL ?= ${ENCTOOLPATH}/encrypt_fw${BIN_EXT} 95290aa901fSSumit Garg 95373c99d4eSJuan Castillo# Variables for use with Firmware Image Package 954819281eeSdp-armFIPTOOLPATH ?= tools/fiptool 955819281eeSdp-armFIPTOOL ?= ${FIPTOOLPATH}/fiptool${BIN_EXT} 95673c99d4eSJuan Castillo 95726010da1SAntonio Nino Diaz# Variables for use with sptool 95826010da1SAntonio Nino DiazSPTOOLPATH ?= tools/sptool 959822c7279SJ-AlvesSPTOOL ?= ${SPTOOLPATH}/sptool.py 960ce2b1ec6SManish PandeySP_MK_GEN ?= ${SPTOOLPATH}/sp_mk_generator.py 96126010da1SAntonio Nino Diaz 9625accce5bSRoberto Vargas# Variables for use with ROMLIB 9635accce5bSRoberto VargasROMLIBPATH ?= lib/romlib 9645accce5bSRoberto Vargas 965cfe83910SLouis Mayencourt# Variable for use with Python 966cfe83910SLouis MayencourtPYTHON ?= python3 967cfe83910SLouis Mayencourt 968cfe83910SLouis Mayencourt# Variables for use with PRINT_MEMORY_MAP 969cfe83910SLouis MayencourtPRINT_MEMORY_MAP_PATH ?= tools/memory 970cfe83910SLouis MayencourtPRINT_MEMORY_MAP ?= ${PRINT_MEMORY_MAP_PATH}/print_memory_map.py 971cfe83910SLouis Mayencourt 9726de32378SMadhukar Pappireddy# Variables for use with documentation build using Sphinx tool 9736de32378SMadhukar PappireddyDOCS_PATH ?= docs 9746de32378SMadhukar Pappireddy 9751f1c0206SAbdul Halim, Muhammad Hadi Asyrafi# Defination of SIMICS flag 9761f1c0206SAbdul Halim, Muhammad Hadi AsyrafiSIMICS_BUILD ?= 0 9771f1c0206SAbdul Halim, Muhammad Hadi Asyrafi 9788a86052dSSoby Mathew################################################################################ 9798a86052dSSoby Mathew# Include BL specific makefiles 9808a86052dSSoby Mathew################################################################################ 9815f24ce96SManish Pandey 9825f24ce96SManish Pandeyifeq (${NEED_BL1},yes) 9838a86052dSSoby Mathewinclude bl1/bl1.mk 9848a86052dSSoby Mathewendif 9858a86052dSSoby Mathew 9865f24ce96SManish Pandeyifeq (${NEED_BL2},yes) 9878a86052dSSoby Mathewinclude bl2/bl2.mk 9888a86052dSSoby Mathewendif 9898a86052dSSoby Mathew 9905f24ce96SManish Pandeyifeq (${NEED_BL2U},yes) 9918a86052dSSoby Mathewinclude bl2u/bl2u.mk 9928a86052dSSoby Mathewendif 9938a86052dSSoby Mathew 9945744e874SSoby Mathewifeq (${NEED_BL31},yes) 9958a86052dSSoby Mathewinclude bl31/bl31.mk 9968a86052dSSoby Mathewendif 99703b397a8SNishanth Menon 99873c99d4eSJuan Castillo################################################################################ 99973c99d4eSJuan Castillo# Build options checks 100073c99d4eSJuan Castillo################################################################################ 100173c99d4eSJuan Castillo 1002327131c4SLeonardo Sandoval$(eval $(call assert_booleans,\ 1003327131c4SLeonardo Sandoval $(sort \ 1004327131c4SLeonardo Sandoval ALLOW_RO_XLAT_TABLES \ 100546789a7cSBalint Dobszay BL2_ENABLE_SP_LOAD \ 1006327131c4SLeonardo Sandoval COLD_BOOT_SINGLE_CPU \ 1007327131c4SLeonardo Sandoval CREATE_KEYS \ 1008327131c4SLeonardo Sandoval CTX_INCLUDE_AARCH32_REGS \ 1009327131c4SLeonardo Sandoval CTX_INCLUDE_FPREGS \ 1010327131c4SLeonardo Sandoval CTX_INCLUDE_EL2_REGS \ 1011327131c4SLeonardo Sandoval DEBUG \ 10120063dd17SJavier Almansa Sobrino DISABLE_MTPMU \ 1013327131c4SLeonardo Sandoval DYN_DISABLE_AUTH \ 1014327131c4SLeonardo Sandoval EL3_EXCEPTION_HANDLING \ 1015327131c4SLeonardo Sandoval ENABLE_AMU \ 10161fd685a7SChris Kay ENABLE_AMU_AUXILIARY_COUNTERS \ 1017742ca230SChris Kay ENABLE_AMU_FCONF \ 1018873d4241Sjohpow01 AMU_RESTRICT_COUNTERS \ 1019327131c4SLeonardo Sandoval ENABLE_ASSERTIONS \ 1020327131c4SLeonardo Sandoval ENABLE_PIE \ 1021327131c4SLeonardo Sandoval ENABLE_PMF \ 1022327131c4SLeonardo Sandoval ENABLE_PSCI_STAT \ 1023327131c4SLeonardo Sandoval ENABLE_RUNTIME_INSTRUMENTATION \ 1024dc78e62dSjohpow01 ENABLE_SME_FOR_NS \ 1025dc78e62dSjohpow01 ENABLE_SME_FOR_SWD \ 1026327131c4SLeonardo Sandoval ENABLE_SPE_FOR_LOWER_ELS \ 1027327131c4SLeonardo Sandoval ENABLE_SVE_FOR_NS \ 10280c5e7d1cSMax Shvetsov ENABLE_SVE_FOR_SWD \ 1029327131c4SLeonardo Sandoval ERROR_DEPRECATED \ 1030327131c4SLeonardo Sandoval FAULT_INJECTION_SUPPORT \ 1031327131c4SLeonardo Sandoval GENERATE_COT \ 1032327131c4SLeonardo Sandoval GICV2_G0_FOR_EL3 \ 1033327131c4SLeonardo Sandoval HANDLE_EA_EL3_FIRST \ 1034327131c4SLeonardo Sandoval HW_ASSISTED_COHERENCY \ 1035327131c4SLeonardo Sandoval INVERTED_MEMMAP \ 1036327131c4SLeonardo Sandoval MEASURED_BOOT \ 103700e28874SManish V Badarkhe DRTM_SUPPORT \ 1038327131c4SLeonardo Sandoval NS_TIMER_SWITCH \ 1039327131c4SLeonardo Sandoval OVERRIDE_LIBC \ 1040327131c4SLeonardo Sandoval PL011_GENERIC_UART \ 10410ce2072dSTamas Ban PLAT_RSS_NOT_SUPPORTED \ 1042327131c4SLeonardo Sandoval PROGRAMMABLE_RESET_ADDRESS \ 1043327131c4SLeonardo Sandoval PSCI_EXTENDED_STATE_ID \ 1044327131c4SLeonardo Sandoval RESET_TO_BL31 \ 104525844ff7SJorge Ramirez-Ortiz RESET_TO_BL31_WITH_PARAMS \ 1046327131c4SLeonardo Sandoval SAVE_KEYS \ 1047327131c4SLeonardo Sandoval SEPARATE_CODE_AND_RODATA \ 104896a8ed14SJiafei Pan SEPARATE_BL2_NOLOAD_REGION \ 1049327131c4SLeonardo Sandoval SEPARATE_NOBITS_REGION \ 1050327131c4SLeonardo Sandoval SPIN_ON_BL1_EXIT \ 1051327131c4SLeonardo Sandoval SPM_MM \ 10521d63ae4dSMarc Bonnici SPMC_AT_EL3 \ 1053327131c4SLeonardo Sandoval SPMD_SPM_AT_SEL2 \ 1054327131c4SLeonardo Sandoval TRUSTED_BOARD_BOOT \ 1055327131c4SLeonardo Sandoval USE_COHERENT_MEM \ 1056327131c4SLeonardo Sandoval USE_DEBUGFS \ 1057327131c4SLeonardo Sandoval ARM_IO_IN_DTB \ 1058327131c4SLeonardo Sandoval SDEI_IN_FCONF \ 1059327131c4SLeonardo Sandoval SEC_INT_DESC_IN_FCONF \ 1060327131c4SLeonardo Sandoval USE_ROMLIB \ 1061327131c4SLeonardo Sandoval USE_TBBR_DEFS \ 1062327131c4SLeonardo Sandoval WARMBOOT_ENABLE_DCACHE_EARLY \ 1063327131c4SLeonardo Sandoval BL2_AT_EL3 \ 1064327131c4SLeonardo Sandoval BL2_IN_XIP_MEM \ 1065327131c4SLeonardo Sandoval BL2_INV_DCACHE \ 1066327131c4SLeonardo Sandoval USE_SPINLOCK_CAS \ 1067327131c4SLeonardo Sandoval ENCRYPT_BL31 \ 1068327131c4SLeonardo Sandoval ENCRYPT_BL32 \ 1069327131c4SLeonardo Sandoval ERRATA_SPECULATIVE_AT \ 107000e8f79cSManish Pandey RAS_TRAP_NS_ERR_REC_ACCESS \ 1071327131c4SLeonardo Sandoval COT_DESC_IN_DTB \ 1072327131c4SLeonardo Sandoval USE_SP804_TIMER \ 1073396b339dSManish V Badarkhe PSA_FWU_SUPPORT \ 1074d4582d30SManish V Badarkhe ENABLE_SYS_REG_TRACE_FOR_NS \ 107568120783SChris Kay ENABLE_MPMM \ 107668120783SChris Kay ENABLE_MPMM_FCONF \ 10771f1c0206SAbdul Halim, Muhammad Hadi Asyrafi SIMICS_BUILD \ 10786a0da736SJayanth Dodderi Chidanand FEATURE_DETECTION \ 1079327131c4SLeonardo Sandoval))) 108073c99d4eSJuan Castillo 1081327131c4SLeonardo Sandoval$(eval $(call assert_numerics,\ 1082327131c4SLeonardo Sandoval $(sort \ 1083327131c4SLeonardo Sandoval ARM_ARCH_MAJOR \ 1084327131c4SLeonardo Sandoval ARM_ARCH_MINOR \ 1085327131c4SLeonardo Sandoval BRANCH_PROTECTION \ 10866a0da736SJayanth Dodderi Chidanand CTX_INCLUDE_PAUTH_REGS \ 10876a0da736SJayanth Dodderi Chidanand CTX_INCLUDE_MTE_REGS \ 10886a0da736SJayanth Dodderi Chidanand CTX_INCLUDE_NEVE_REGS \ 10892bf4f27fSManish V Badarkhe CRYPTO_SUPPORT \ 10901298f2f1SJayanth Dodderi Chidanand ENABLE_BRBE_FOR_NS \ 109147c681b7SJayanth Dodderi Chidanand ENABLE_TRBE_FOR_NS \ 10926a0da736SJayanth Dodderi Chidanand ENABLE_BTI \ 10936a0da736SJayanth Dodderi Chidanand ENABLE_PAUTH \ 10946a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_AMUv1 \ 10956a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_AMUv1p1 \ 10966a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_CSV2_2 \ 10976a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_DIT \ 10986a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_ECV \ 10996a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_FGT \ 11006a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_HCX \ 11016a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_PAN \ 11026a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_RNG \ 1103ff86e0b4SJuan Pablo Conde ENABLE_FEAT_RNG_TRAP \ 11046a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_SB \ 11056a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_SEL2 \ 11066a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_VHE \ 11076a0da736SJayanth Dodderi Chidanand ENABLE_MPAM_FOR_LOWER_ELS \ 11086a0da736SJayanth Dodderi Chidanand ENABLE_RME \ 11096a0da736SJayanth Dodderi Chidanand ENABLE_TRF_FOR_NS \ 1110327131c4SLeonardo Sandoval FW_ENC_STATUS \ 11115357f83dSManish V Badarkhe NR_OF_FW_BANKS \ 11125357f83dSManish V Badarkhe NR_OF_IMAGES_IN_FW_BANK \ 11136a0da736SJayanth Dodderi Chidanand RAS_EXTENSION \ 1114781d07a4SJayanth Dodderi Chidanand TWED_DELAY \ 1115781d07a4SJayanth Dodderi Chidanand ENABLE_FEAT_TWED \ 1116bebcf27fSMark Brown SVE_VECTOR_LEN \ 1117327131c4SLeonardo Sandoval))) 1118c877b414SJeenu Viswambharan 1119aacff749SJustin Chadwellifdef KEY_SIZE 1120aacff749SJustin Chadwell $(eval $(call assert_numeric,KEY_SIZE)) 1121aacff749SJustin Chadwellendif 1122aacff749SJustin Chadwell 11231f461979SJustin Chadwellifeq ($(filter $(SANITIZE_UB), on off trap),) 11241f461979SJustin Chadwell $(error "Invalid value for SANITIZE_UB: can be one of on, off, trap") 11251f461979SJustin Chadwellendif 11261f461979SJustin Chadwell 112773c99d4eSJuan Castillo################################################################################ 112873c99d4eSJuan Castillo# Add definitions to the cpp preprocessor based on the current build options. 112973c99d4eSJuan Castillo# This is done after including the platform specific makefile to allow the 113073c99d4eSJuan Castillo# platform to overwrite the default options 113173c99d4eSJuan Castillo################################################################################ 113273c99d4eSJuan Castillo 1133327131c4SLeonardo Sandoval$(eval $(call add_defines,\ 1134327131c4SLeonardo Sandoval $(sort \ 1135327131c4SLeonardo Sandoval ALLOW_RO_XLAT_TABLES \ 1136327131c4SLeonardo Sandoval ARM_ARCH_MAJOR \ 1137327131c4SLeonardo Sandoval ARM_ARCH_MINOR \ 113846789a7cSBalint Dobszay BL2_ENABLE_SP_LOAD \ 1139327131c4SLeonardo Sandoval COLD_BOOT_SINGLE_CPU \ 1140327131c4SLeonardo Sandoval CTX_INCLUDE_AARCH32_REGS \ 1141327131c4SLeonardo Sandoval CTX_INCLUDE_FPREGS \ 1142327131c4SLeonardo Sandoval CTX_INCLUDE_PAUTH_REGS \ 1143327131c4SLeonardo Sandoval EL3_EXCEPTION_HANDLING \ 1144327131c4SLeonardo Sandoval CTX_INCLUDE_MTE_REGS \ 1145327131c4SLeonardo Sandoval CTX_INCLUDE_EL2_REGS \ 1146062f8aafSArunachalam Ganapathy CTX_INCLUDE_NEVE_REGS \ 1147327131c4SLeonardo Sandoval DECRYPTION_SUPPORT_${DECRYPTION_SUPPORT} \ 11480063dd17SJavier Almansa Sobrino DISABLE_MTPMU \ 1149327131c4SLeonardo Sandoval ENABLE_AMU \ 11501fd685a7SChris Kay ENABLE_AMU_AUXILIARY_COUNTERS \ 1151742ca230SChris Kay ENABLE_AMU_FCONF \ 1152873d4241Sjohpow01 AMU_RESTRICT_COUNTERS \ 1153327131c4SLeonardo Sandoval ENABLE_ASSERTIONS \ 1154327131c4SLeonardo Sandoval ENABLE_BTI \ 1155327131c4SLeonardo Sandoval ENABLE_MPAM_FOR_LOWER_ELS \ 1156327131c4SLeonardo Sandoval ENABLE_PAUTH \ 1157327131c4SLeonardo Sandoval ENABLE_PIE \ 1158327131c4SLeonardo Sandoval ENABLE_PMF \ 1159327131c4SLeonardo Sandoval ENABLE_PSCI_STAT \ 11605b18de09SZelalem Aweke ENABLE_RME \ 1161327131c4SLeonardo Sandoval ENABLE_RUNTIME_INSTRUMENTATION \ 1162dc78e62dSjohpow01 ENABLE_SME_FOR_NS \ 1163dc78e62dSjohpow01 ENABLE_SME_FOR_SWD \ 1164327131c4SLeonardo Sandoval ENABLE_SPE_FOR_LOWER_ELS \ 1165327131c4SLeonardo Sandoval ENABLE_SVE_FOR_NS \ 11660c5e7d1cSMax Shvetsov ENABLE_SVE_FOR_SWD \ 1167327131c4SLeonardo Sandoval ENCRYPT_BL31 \ 1168327131c4SLeonardo Sandoval ENCRYPT_BL32 \ 1169327131c4SLeonardo Sandoval ERROR_DEPRECATED \ 1170327131c4SLeonardo Sandoval FAULT_INJECTION_SUPPORT \ 1171327131c4SLeonardo Sandoval GICV2_G0_FOR_EL3 \ 1172327131c4SLeonardo Sandoval HANDLE_EA_EL3_FIRST \ 1173327131c4SLeonardo Sandoval HW_ASSISTED_COHERENCY \ 1174327131c4SLeonardo Sandoval LOG_LEVEL \ 1175327131c4SLeonardo Sandoval MEASURED_BOOT \ 117600e28874SManish V Badarkhe DRTM_SUPPORT \ 1177327131c4SLeonardo Sandoval NS_TIMER_SWITCH \ 1178327131c4SLeonardo Sandoval PL011_GENERIC_UART \ 1179327131c4SLeonardo Sandoval PLAT_${PLAT} \ 11800ce2072dSTamas Ban PLAT_RSS_NOT_SUPPORTED \ 1181327131c4SLeonardo Sandoval PROGRAMMABLE_RESET_ADDRESS \ 1182327131c4SLeonardo Sandoval PSCI_EXTENDED_STATE_ID \ 1183327131c4SLeonardo Sandoval RAS_EXTENSION \ 1184327131c4SLeonardo Sandoval RESET_TO_BL31 \ 118525844ff7SJorge Ramirez-Ortiz RESET_TO_BL31_WITH_PARAMS \ 1186327131c4SLeonardo Sandoval SEPARATE_CODE_AND_RODATA \ 118796a8ed14SJiafei Pan SEPARATE_BL2_NOLOAD_REGION \ 1188327131c4SLeonardo Sandoval SEPARATE_NOBITS_REGION \ 1189327131c4SLeonardo Sandoval RECLAIM_INIT_CODE \ 1190327131c4SLeonardo Sandoval SPD_${SPD} \ 1191327131c4SLeonardo Sandoval SPIN_ON_BL1_EXIT \ 1192327131c4SLeonardo Sandoval SPM_MM \ 11931d63ae4dSMarc Bonnici SPMC_AT_EL3 \ 1194327131c4SLeonardo Sandoval SPMD_SPM_AT_SEL2 \ 1195327131c4SLeonardo Sandoval TRUSTED_BOARD_BOOT \ 1196c9c56f6eSManish V Badarkhe CRYPTO_SUPPORT \ 11977dfb9911SJimmy Brisson TRNG_SUPPORT \ 1198327131c4SLeonardo Sandoval USE_COHERENT_MEM \ 1199327131c4SLeonardo Sandoval USE_DEBUGFS \ 1200327131c4SLeonardo Sandoval ARM_IO_IN_DTB \ 1201327131c4SLeonardo Sandoval SDEI_IN_FCONF \ 1202327131c4SLeonardo Sandoval SEC_INT_DESC_IN_FCONF \ 1203327131c4SLeonardo Sandoval USE_ROMLIB \ 1204327131c4SLeonardo Sandoval USE_TBBR_DEFS \ 1205327131c4SLeonardo Sandoval WARMBOOT_ENABLE_DCACHE_EARLY \ 1206327131c4SLeonardo Sandoval BL2_AT_EL3 \ 1207327131c4SLeonardo Sandoval BL2_IN_XIP_MEM \ 1208327131c4SLeonardo Sandoval BL2_INV_DCACHE \ 1209327131c4SLeonardo Sandoval USE_SPINLOCK_CAS \ 1210327131c4SLeonardo Sandoval ERRATA_SPECULATIVE_AT \ 121100e8f79cSManish Pandey RAS_TRAP_NS_ERR_REC_ACCESS \ 1212327131c4SLeonardo Sandoval COT_DESC_IN_DTB \ 1213327131c4SLeonardo Sandoval USE_SP804_TIMER \ 121412cd65e0STomas Pilar ENABLE_FEAT_RNG \ 1215ff86e0b4SJuan Pablo Conde ENABLE_FEAT_RNG_TRAP \ 12164e04478aSChris Kay ENABLE_FEAT_SB \ 12177d33ffe4SDaniel Boulby ENABLE_FEAT_DIT \ 12185357f83dSManish V Badarkhe NR_OF_FW_BANKS \ 12195357f83dSManish V Badarkhe NR_OF_IMAGES_IN_FW_BANK \ 1220396b339dSManish V Badarkhe PSA_FWU_SUPPORT \ 1221744ad974Sjohpow01 ENABLE_BRBE_FOR_NS \ 1222813524eaSManish V Badarkhe ENABLE_TRBE_FOR_NS \ 1223d4582d30SManish V Badarkhe ENABLE_SYS_REG_TRACE_FOR_NS \ 12248fcd3d96SManish V Badarkhe ENABLE_TRF_FOR_NS \ 1225cb4ec47bSjohpow01 ENABLE_FEAT_HCX \ 122668120783SChris Kay ENABLE_MPMM \ 122768120783SChris Kay ENABLE_MPMM_FCONF \ 1228f74cb0beSJayanth Dodderi Chidanand ENABLE_FEAT_FGT \ 1229f74cb0beSJayanth Dodderi Chidanand ENABLE_FEAT_AMUv1 \ 1230f74cb0beSJayanth Dodderi Chidanand ENABLE_FEAT_ECV \ 12311f1c0206SAbdul Halim, Muhammad Hadi Asyrafi SIMICS_BUILD \ 12326a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_AMUv1p1 \ 12336a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_SEL2 \ 12346a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_VHE \ 12356a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_CSV2_2 \ 12366a0da736SJayanth Dodderi Chidanand ENABLE_FEAT_PAN \ 12376a0da736SJayanth Dodderi Chidanand FEATURE_DETECTION \ 1238781d07a4SJayanth Dodderi Chidanand TWED_DELAY \ 1239781d07a4SJayanth Dodderi Chidanand ENABLE_FEAT_TWED \ 1240327131c4SLeonardo Sandoval))) 12412fae4b1eSJeenu Viswambharan 12421f461979SJustin Chadwellifeq (${SANITIZE_UB},trap) 12431f461979SJustin Chadwell $(eval $(call add_define,MONITOR_TRAPS)) 12441f461979SJustin Chadwellendif 12451f461979SJustin Chadwell 12464c117f6cSSandrine Bailleux# Define the EL3_PAYLOAD_BASE flag only if it is provided. 12474c117f6cSSandrine Bailleuxifdef EL3_PAYLOAD_BASE 12484c117f6cSSandrine Bailleux $(eval $(call add_define,EL3_PAYLOAD_BASE)) 1249cf2c8a33SAntonio Nino Diazelse 125068450a6dSAntonio Nino Diaz # Define the PRELOADED_BL33_BASE flag only if it is provided and 125168450a6dSAntonio Nino Diaz # EL3_PAYLOAD_BASE is not defined, as it has priority. 125268450a6dSAntonio Nino Diaz ifdef PRELOADED_BL33_BASE 125368450a6dSAntonio Nino Diaz $(eval $(call add_define,PRELOADED_BL33_BASE)) 12544c117f6cSSandrine Bailleux endif 1255cf2c8a33SAntonio Nino Diazendif 125673c99d4eSJuan Castillo 1257209a60ccSSoby Mathew# Define the DYN_DISABLE_AUTH flag only if set. 1258209a60ccSSoby Mathewifeq (${DYN_DISABLE_AUTH},1) 1259209a60ccSSoby Mathew$(eval $(call add_define,DYN_DISABLE_AUTH)) 1260209a60ccSSoby Mathewendif 1261209a60ccSSoby Mathew 1262c2ad38ceSVarun Wadekarifneq ($(findstring armlink,$(notdir $(LD))),) 1263c2ad38ceSVarun Wadekar$(eval $(call add_define,USE_ARM_LINK)) 1264c2ad38ceSVarun Wadekarendif 1265c2ad38ceSVarun Wadekar 1266ce2b1ec6SManish Pandey# Generate and include sp_gen.mk if SPD is spmd and SP_LAYOUT_FILE is defined 1267ce2b1ec6SManish Pandeyifeq (${SPD},spmd) 1268c33ff198SOlivier Deprezifdef SP_LAYOUT_FILE 1269ce2b1ec6SManish Pandey -include $(BUILD_PLAT)/sp_gen.mk 1270ce2b1ec6SManish Pandey FIP_DEPS += sp 127107c44475SManish Pandey CRT_DEPS += sp 1272ce2b1ec6SManish Pandey NEED_SP_PKG := yes 1273ce2b1ec6SManish Pandeyelse 1274c33ff198SOlivier Deprez ifeq (${SPMD_SPM_AT_SEL2},1) 1275c33ff198SOlivier Deprez $(error "SPMD with SPM at S-EL2 require SP_LAYOUT_FILE") 1276c33ff198SOlivier Deprez endif 1277ce2b1ec6SManish Pandeyendif 1278ce2b1ec6SManish Pandeyendif 1279ce2b1ec6SManish Pandey 128073c99d4eSJuan Castillo################################################################################ 128173c99d4eSJuan Castillo# Build targets 128273c99d4eSJuan Castillo################################################################################ 128373c99d4eSJuan Castillo 128490aa901fSSumit Garg.PHONY: all msg_start clean realclean distclean cscope locate-checkpatch checkcodebase checkpatch fiptool sptool fip sp fwu_fip certtool dtbs memmap doc enctool 128573c99d4eSJuan Castillo.SUFFIXES: 128673c99d4eSJuan Castillo 128773c99d4eSJuan Castilloall: msg_start 128873c99d4eSJuan Castillo 128973c99d4eSJuan Castillomsg_start: 129073c99d4eSJuan Castillo @echo "Building ${PLAT}" 129173c99d4eSJuan Castillo 12927a24cba5SSoby Mathewifeq (${ERROR_DEPRECATED},0) 1293d5dfdeb6SJulius Werner# Check if deprecated declarations and cpp warnings should be treated as error or not. 1294c2ad38ceSVarun Wadekarifneq ($(findstring clang,$(notdir $(CC))),) 1295c2ad38ceSVarun Wadekar CPPFLAGS += -Wno-error=deprecated-declarations 1296c2ad38ceSVarun Wadekarelse 1297bc1a03c7SDan Handley CPPFLAGS += -Wno-error=deprecated-declarations -Wno-error=cpp 12987a24cba5SSoby Mathewendif 1299d5dfdeb6SJulius Wernerendif # !ERROR_DEPRECATED 13007a24cba5SSoby Mathew 13015accce5bSRoberto Vargas$(eval $(call MAKE_LIB_DIRS)) 130261f72a34SRoberto Vargas$(eval $(call MAKE_LIB,c)) 13035fee0287SRoberto Vargas 130473c99d4eSJuan Castillo# Expand build macros for the different images 130573c99d4eSJuan Castilloifeq (${NEED_BL1},yes) 1306b34635a0SChris KayBL1_SOURCES := $(sort ${BL1_SOURCES}) 1307b34635a0SChris Kay 1308434d0491SZelalem Aweke$(eval $(call MAKE_BL,bl1)) 130973c99d4eSJuan Castilloendif 131073c99d4eSJuan Castillo 131173c99d4eSJuan Castilloifeq (${NEED_BL2},yes) 1312c9b31ae8SRoberto Vargasifeq (${BL2_AT_EL3}, 0) 1313c9b31ae8SRoberto VargasFIP_BL2_ARGS := tb-fw 1314c9b31ae8SRoberto Vargasendif 1315c9b31ae8SRoberto Vargas 1316eb1acfb6SChris KayBL2_SOURCES := $(sort ${BL2_SOURCES}) 1317eb1acfb6SChris Kay 131833950dd8SMasahiro Yamada$(if ${BL2}, $(eval $(call TOOL_ADD_IMG,bl2,--${FIP_BL2_ARGS})),\ 1319434d0491SZelalem Aweke $(eval $(call MAKE_BL,bl2,${FIP_BL2_ARGS}))) 132073c99d4eSJuan Castilloendif 132173c99d4eSJuan Castillo 13224d045d0eSMasahiro Yamadaifeq (${NEED_SCP_BL2},yes) 132333950dd8SMasahiro Yamada$(eval $(call TOOL_ADD_IMG,scp_bl2,--scp-fw)) 13244d045d0eSMasahiro Yamadaendif 13254d045d0eSMasahiro Yamada 132673c99d4eSJuan Castilloifeq (${NEED_BL31},yes) 132773c99d4eSJuan CastilloBL31_SOURCES += ${SPD_SOURCES} 132826d1e0c3SMadhukar Pappireddy# Sort BL31 source files to remove duplicates 132926d1e0c3SMadhukar PappireddyBL31_SOURCES := $(sort ${BL31_SOURCES}) 1330c6ba9b45SSumit Gargifneq (${DECRYPTION_SUPPORT},none) 1331c6ba9b45SSumit Garg$(if ${BL31}, $(eval $(call TOOL_ADD_IMG,bl31,--soc-fw,,$(ENCRYPT_BL31))),\ 1332434d0491SZelalem Aweke $(eval $(call MAKE_BL,bl31,soc-fw,,$(ENCRYPT_BL31)))) 1333c6ba9b45SSumit Gargelse 133433950dd8SMasahiro Yamada$(if ${BL31}, $(eval $(call TOOL_ADD_IMG,bl31,--soc-fw)),\ 1335434d0491SZelalem Aweke $(eval $(call MAKE_BL,bl31,soc-fw))) 133673c99d4eSJuan Castilloendif 1337c6ba9b45SSumit Gargendif 133873c99d4eSJuan Castillo 133970d1fc53SJuan Castillo# If a BL32 image is needed but neither BL32 nor BL32_SOURCES is defined, the 1340c939d13aSMasahiro Yamada# build system will call TOOL_ADD_IMG to print a warning message and abort the 134170d1fc53SJuan Castillo# process. Note that the dependency on BL32 applies to the FIP only. 134273c99d4eSJuan Castilloifeq (${NEED_BL32},yes) 134326d1e0c3SMadhukar Pappireddy# Sort BL32 source files to remove duplicates 134426d1e0c3SMadhukar PappireddyBL32_SOURCES := $(sort ${BL32_SOURCES}) 13459cd15239SMasahiro YamadaBUILD_BL32 := $(if $(BL32),,$(if $(BL32_SOURCES),1)) 13469cd15239SMasahiro Yamada 1347c6ba9b45SSumit Gargifneq (${DECRYPTION_SUPPORT},none) 1348434d0491SZelalem Aweke$(if ${BUILD_BL32}, $(eval $(call MAKE_BL,bl32,tos-fw,,$(ENCRYPT_BL32))),\ 1349c6ba9b45SSumit Garg $(eval $(call TOOL_ADD_IMG,bl32,--tos-fw,,$(ENCRYPT_BL32)))) 1350c6ba9b45SSumit Gargelse 1351434d0491SZelalem Aweke$(if ${BUILD_BL32}, $(eval $(call MAKE_BL,bl32,tos-fw)),\ 135233950dd8SMasahiro Yamada $(eval $(call TOOL_ADD_IMG,bl32,--tos-fw))) 135373c99d4eSJuan Castilloendif 1354c6ba9b45SSumit Gargendif 135573c99d4eSJuan Castillo 13565b18de09SZelalem Aweke# If RMM image is needed but RMM is not defined, Test Realm Payload (TRP) 13575b18de09SZelalem Aweke# needs to be built from RMM_SOURCES. 13585b18de09SZelalem Awekeifeq (${NEED_RMM},yes) 13595b18de09SZelalem Aweke# Sort RMM source files to remove duplicates 13605b18de09SZelalem AwekeRMM_SOURCES := $(sort ${RMM_SOURCES}) 13615b18de09SZelalem AwekeBUILD_RMM := $(if $(RMM),,$(if $(RMM_SOURCES),1)) 13625b18de09SZelalem Aweke 13635b18de09SZelalem Aweke$(if ${BUILD_RMM}, $(eval $(call MAKE_BL,rmm,rmm-fw)),\ 13645b18de09SZelalem Aweke $(eval $(call TOOL_ADD_IMG,rmm,--rmm-fw))) 13655b18de09SZelalem Awekeendif 13665b18de09SZelalem Aweke 136773c99d4eSJuan Castillo# Add the BL33 image if required by the platform 136873c99d4eSJuan Castilloifeq (${NEED_BL33},yes) 136933950dd8SMasahiro Yamada$(eval $(call TOOL_ADD_IMG,bl33,--nt-fw)) 1370db6071c9SJuan Castilloendif 1371db6071c9SJuan Castillo 13729003fa0bSYatharth Kocharifeq (${NEED_BL2U},yes) 137333950dd8SMasahiro Yamada$(if ${BL2U}, $(eval $(call TOOL_ADD_IMG,bl2u,--ap-fwu-cfg,FWU_)),\ 1374434d0491SZelalem Aweke $(eval $(call MAKE_BL,bl2u,ap-fwu-cfg,FWU_))) 13759003fa0bSYatharth Kocharendif 13769003fa0bSYatharth Kochar 137703b397a8SNishanth Menon# Expand build macros for the different images 137803b397a8SNishanth Menonifeq (${NEED_FDT},yes) 137903b397a8SNishanth Menon $(eval $(call MAKE_DTBS,$(BUILD_PLAT)/fdts,$(FDT_SOURCES))) 138003b397a8SNishanth Menonendif 138103b397a8SNishanth Menon 1382ce2b1ec6SManish Pandey# Add Secure Partition packages 1383ce2b1ec6SManish Pandeyifeq (${NEED_SP_PKG},yes) 1384ce2b1ec6SManish Pandey$(BUILD_PLAT)/sp_gen.mk: ${SP_MK_GEN} ${SP_LAYOUT_FILE} | ${BUILD_PLAT} 13851e7528ecSRuari Phipps ${Q}${PYTHON} "$<" "$@" $(filter-out $<,$^) $(BUILD_PLAT) ${COT} 1386822c7279SJ-Alvessp: $(DTBS) $(BUILD_PLAT)/sp_gen.mk $(SP_PKGS) 1387ce2b1ec6SManish Pandey @${ECHO_BLANK_LINE} 1388ce2b1ec6SManish Pandey @echo "Built SP Images successfully" 1389ce2b1ec6SManish Pandey @${ECHO_BLANK_LINE} 1390ce2b1ec6SManish Pandeyendif 1391ce2b1ec6SManish Pandey 139236eaaf37SIan Spraylocate-checkpatch: 139336eaaf37SIan Sprayifndef CHECKPATCH 139466079b04SEtienne Carriere $(error "Please set CHECKPATCH to point to the Linux checkpatch.pl file, eg: CHECKPATCH=../linux/scripts/checkpatch.pl") 139536eaaf37SIan Sprayelse 139636eaaf37SIan Sprayifeq (,$(wildcard ${CHECKPATCH})) 139766079b04SEtienne Carriere $(error "The file CHECKPATCH points to cannot be found, use eg: CHECKPATCH=../linux/scripts/checkpatch.pl") 139836eaaf37SIan Sprayendif 139936eaaf37SIan Sprayendif 140036eaaf37SIan Spray 14014f6ad66aSAchin Guptaclean: 14024f6ad66aSAchin Gupta @echo " CLEAN" 1403f1477d4aSEvan Lloyd $(call SHELL_REMOVE_DIR,${BUILD_PLAT}) 140488a1cf1eSSami Mujawarifdef UNIX_MK 14052f2cef46SJeenu Viswambharan ${Q}${MAKE} --no-print-directory -C ${FIPTOOLPATH} clean 140688a1cf1eSSami Mujawarelse 140788a1cf1eSSami Mujawar# Clear the MAKEFLAGS as we do not want 140888a1cf1eSSami Mujawar# to pass the gnumake flags to nmake. 140988a1cf1eSSami Mujawar ${Q}set MAKEFLAGS= && ${MSVC_NMAKE} /nologo /f ${FIPTOOLPATH}/Makefile.msvc FIPTOOLPATH=$(subst /,\,$(FIPTOOLPATH)) FIPTOOL=$(subst /,\,$(FIPTOOL)) clean 141088a1cf1eSSami Mujawarendif 14116f971622SJuan Castillo ${Q}${MAKE} PLAT=${PLAT} --no-print-directory -C ${CRTTOOLPATH} clean 141290aa901fSSumit Garg ${Q}${MAKE} PLAT=${PLAT} --no-print-directory -C ${ENCTOOLPATH} clean 14135accce5bSRoberto Vargas ${Q}${MAKE} --no-print-directory -C ${ROMLIBPATH} clean 14144f6ad66aSAchin Gupta 1415eaaeece2SJames Morrisseyrealclean distclean: 1416eaaeece2SJames Morrissey @echo " REALCLEAN" 1417f1477d4aSEvan Lloyd $(call SHELL_REMOVE_DIR,${BUILD_BASE}) 1418f1477d4aSEvan Lloyd $(call SHELL_DELETE_ALL, ${CURDIR}/cscope.*) 141988a1cf1eSSami Mujawarifdef UNIX_MK 14202f2cef46SJeenu Viswambharan ${Q}${MAKE} --no-print-directory -C ${FIPTOOLPATH} clean 142188a1cf1eSSami Mujawarelse 142288a1cf1eSSami Mujawar# Clear the MAKEFLAGS as we do not want 142388a1cf1eSSami Mujawar# to pass the gnumake flags to nmake. 142488a1cf1eSSami Mujawar ${Q}set MAKEFLAGS= && ${MSVC_NMAKE} /nologo /f ${FIPTOOLPATH}/Makefile.msvc FIPTOOLPATH=$(subst /,\,$(FIPTOOLPATH)) FIPTOOL=$(subst /,\,$(FIPTOOL)) realclean 142588a1cf1eSSami Mujawarendif 1426e15591aaSNicolas Boulenguez ${Q}${MAKE} PLAT=${PLAT} --no-print-directory -C ${CRTTOOLPATH} realclean 142790aa901fSSumit Garg ${Q}${MAKE} PLAT=${PLAT} --no-print-directory -C ${ENCTOOLPATH} realclean 14285accce5bSRoberto Vargas ${Q}${MAKE} --no-print-directory -C ${ROMLIBPATH} clean 14294f6ad66aSAchin Gupta 143036eaaf37SIan Spraycheckcodebase: locate-checkpatch 143136eaaf37SIan Spray @echo " CHECKING STYLE" 143236eaaf37SIan Spray @if test -d .git ; then \ 14331ef35512SPaul Beesley git ls-files | grep -E -v 'libfdt|libc|docs|\.rst' | \ 14341a41e8c1SDan Handley while read GIT_FILE ; \ 14351a41e8c1SDan Handley do ${CHECKPATCH} ${CHECKCODE_ARGS} -f $$GIT_FILE ; \ 14361a41e8c1SDan Handley done ; \ 143736eaaf37SIan Spray else \ 14381a41e8c1SDan Handley find . -type f -not -iwholename "*.git*" \ 14391a41e8c1SDan Handley -not -iwholename "*build*" \ 14401a41e8c1SDan Handley -not -iwholename "*libfdt*" \ 144161f72a34SRoberto Vargas -not -iwholename "*libc*" \ 14421a41e8c1SDan Handley -not -iwholename "*docs*" \ 14431ef35512SPaul Beesley -not -iwholename "*.rst" \ 14441a41e8c1SDan Handley -exec ${CHECKPATCH} ${CHECKCODE_ARGS} -f {} \; ; \ 144536eaaf37SIan Spray fi 144636eaaf37SIan Spray 144736eaaf37SIan Spraycheckpatch: locate-checkpatch 144836eaaf37SIan Spray @echo " CHECKING STYLE" 144902a76d5fSYann Gautier @if test -n "${CHECKPATCH_OPTS}"; then \ 145002a76d5fSYann Gautier echo " with ${CHECKPATCH_OPTS} option(s)"; \ 145102a76d5fSYann Gautier fi 145251d28937SAntonio Nino Diaz ${Q}COMMON_COMMIT=$$(git merge-base HEAD ${BASE_COMMIT}); \ 145377a0a7f1SYann Gautier for commit in `git rev-list --no-merges $$COMMON_COMMIT..HEAD`; \ 145477a0a7f1SYann Gautier do \ 145551d28937SAntonio Nino Diaz printf "\n[*] Checking style of '$$commit'\n\n"; \ 145651d28937SAntonio Nino Diaz git log --format=email "$$commit~..$$commit" \ 145702a76d5fSYann Gautier -- ${CHECK_PATHS} | \ 145802a76d5fSYann Gautier ${CHECKPATCH} ${CHECKPATCH_OPTS} - || true; \ 145951d28937SAntonio Nino Diaz git diff --format=email "$$commit~..$$commit" \ 146002a76d5fSYann Gautier -- ${CHECK_PATHS} | \ 146102a76d5fSYann Gautier ${CHECKPATCH} ${CHECKPATCH_OPTS} - || true; \ 146251d28937SAntonio Nino Diaz done 146336eaaf37SIan Spray 146473c99d4eSJuan Castillocerttool: ${CRTTOOL} 146573c99d4eSJuan Castillo 1466a9812206SPali Rohár${CRTTOOL}: FORCE 1467fafd3ec9SManish V Badarkhe ${Q}${MAKE} PLAT=${PLAT} USE_TBBR_DEFS=${USE_TBBR_DEFS} COT=${COT} OPENSSL_DIR=${OPENSSL_DIR} CRTTOOL=${CRTTOOL} --no-print-directory -C ${CRTTOOLPATH} 1468f1477d4aSEvan Lloyd @${ECHO_BLANK_LINE} 14696f971622SJuan Castillo @echo "Built $@ successfully" 1470f1477d4aSEvan Lloyd @${ECHO_BLANK_LINE} 14716f971622SJuan Castillo 14726f971622SJuan Castilloifneq (${GENERATE_COT},0) 147373c99d4eSJuan Castillocertificates: ${CRT_DEPS} ${CRTTOOL} 14746f971622SJuan Castillo ${Q}${CRTTOOL} ${CRT_ARGS} 1475f1477d4aSEvan Lloyd @${ECHO_BLANK_LINE} 14766f971622SJuan Castillo @echo "Built $@ successfully" 14776f971622SJuan Castillo @echo "Certificates can be found in ${BUILD_PLAT}" 1478f1477d4aSEvan Lloyd @${ECHO_BLANK_LINE} 147973c99d4eSJuan Castilloendif 148027713fb4SSoby Mathew 148173c99d4eSJuan Castillo${BUILD_PLAT}/${FIP_NAME}: ${FIP_DEPS} ${FIPTOOL} 14824727fd13SPali Rohár $(eval ${CHECK_FIP_CMD}) 1483819281eeSdp-arm ${Q}${FIPTOOL} create ${FIP_ARGS} $@ 1484819281eeSdp-arm ${Q}${FIPTOOL} info $@ 1485f1477d4aSEvan Lloyd @${ECHO_BLANK_LINE} 14862f2cef46SJeenu Viswambharan @echo "Built $@ successfully" 1487f1477d4aSEvan Lloyd @${ECHO_BLANK_LINE} 1488f58ad36fSHarry Liebel 14890191262dSYatharth Kocharifneq (${GENERATE_COT},0) 14900191262dSYatharth Kocharfwu_certificates: ${FWU_CRT_DEPS} ${CRTTOOL} 14910191262dSYatharth Kochar ${Q}${CRTTOOL} ${FWU_CRT_ARGS} 1492052ab529SEvan Lloyd @${ECHO_BLANK_LINE} 14930191262dSYatharth Kochar @echo "Built $@ successfully" 14940191262dSYatharth Kochar @echo "FWU certificates can be found in ${BUILD_PLAT}" 1495052ab529SEvan Lloyd @${ECHO_BLANK_LINE} 14960191262dSYatharth Kocharendif 14970191262dSYatharth Kochar 14980191262dSYatharth Kochar${BUILD_PLAT}/${FWU_FIP_NAME}: ${FWU_FIP_DEPS} ${FIPTOOL} 14994727fd13SPali Rohár $(eval ${CHECK_FWU_FIP_CMD}) 1500819281eeSdp-arm ${Q}${FIPTOOL} create ${FWU_FIP_ARGS} $@ 1501819281eeSdp-arm ${Q}${FIPTOOL} info $@ 1502052ab529SEvan Lloyd @${ECHO_BLANK_LINE} 15030191262dSYatharth Kochar @echo "Built $@ successfully" 1504052ab529SEvan Lloyd @${ECHO_BLANK_LINE} 15050191262dSYatharth Kochar 150673c99d4eSJuan Castillofiptool: ${FIPTOOL} 150773c99d4eSJuan Castillofip: ${BUILD_PLAT}/${FIP_NAME} 15080191262dSYatharth Kocharfwu_fip: ${BUILD_PLAT}/${FWU_FIP_NAME} 150973c99d4eSJuan Castillo 1510a9812206SPali Rohár${FIPTOOL}: FORCE 151188a1cf1eSSami Mujawarifdef UNIX_MK 15120a956f81SRoss Burton ${Q}${MAKE} CPPFLAGS="-DVERSION='\"${VERSION_STRING}\"'" FIPTOOL=${FIPTOOL} OPENSSL_DIR=${OPENSSL_DIR} --no-print-directory -C ${FIPTOOLPATH} 151388a1cf1eSSami Mujawarelse 151488a1cf1eSSami Mujawar# Clear the MAKEFLAGS as we do not want 151588a1cf1eSSami Mujawar# to pass the gnumake flags to nmake. 151688a1cf1eSSami Mujawar ${Q}set MAKEFLAGS= && ${MSVC_NMAKE} /nologo /f ${FIPTOOLPATH}/Makefile.msvc FIPTOOLPATH=$(subst /,\,$(FIPTOOLPATH)) FIPTOOL=$(subst /,\,$(FIPTOOL)) 151788a1cf1eSSami Mujawarendif 1518f58ad36fSHarry Liebel 1519a9812206SPali Rohárromlib.bin: libraries FORCE 1520bbb24f61SJohn Tsichritzis ${Q}${MAKE} PLAT_DIR=${PLAT_DIR} BUILD_PLAT=${BUILD_PLAT} ENABLE_BTI=${ENABLE_BTI} ARM_ARCH_MINOR=${ARM_ARCH_MINOR} INCLUDES='${INCLUDES}' DEFINES='${DEFINES}' --no-print-directory -C ${ROMLIBPATH} all 15215accce5bSRoberto Vargas 1522cfe83910SLouis Mayencourt# Call print_memory_map tool 1523cfe83910SLouis Mayencourtmemmap: all 1524b890b36dSLouis Mayencourt ${Q}${PYTHON} ${PRINT_MEMORY_MAP} ${BUILD_PLAT} ${INVERTED_MEMMAP} 1525cfe83910SLouis Mayencourt 15266de32378SMadhukar Pappireddydoc: 15276de32378SMadhukar Pappireddy @echo " BUILD DOCUMENTATION" 15286de32378SMadhukar Pappireddy ${Q}${MAKE} --no-print-directory -C ${DOCS_PATH} html 15296de32378SMadhukar Pappireddy 153090aa901fSSumit Gargenctool: ${ENCTOOL} 153190aa901fSSumit Garg 1532a9812206SPali Rohár${ENCTOOL}: FORCE 1533fafd3ec9SManish V Badarkhe ${Q}${MAKE} PLAT=${PLAT} BUILD_INFO=0 OPENSSL_DIR=${OPENSSL_DIR} ENCTOOL=${ENCTOOL} --no-print-directory -C ${ENCTOOLPATH} 153490aa901fSSumit Garg @${ECHO_BLANK_LINE} 153590aa901fSSumit Garg @echo "Built $@ successfully" 153690aa901fSSumit Garg @${ECHO_BLANK_LINE} 153790aa901fSSumit Garg 153835fab8c9SJoakim Bechcscope: 153935fab8c9SJoakim Bech @echo " CSCOPE" 154035fab8c9SJoakim Bech ${Q}find ${CURDIR} -name "*.[chsS]" > cscope.files 154135fab8c9SJoakim Bech ${Q}cscope -b -q -k 154235fab8c9SJoakim Bech 154372ee3314SRyan Harkinhelp: 15447c23126cSJohn Tsichritzis @echo "usage: ${MAKE} [PLAT=<platform>] [OPTIONS] [TARGET]" 154572ee3314SRyan Harkin @echo "" 154672ee3314SRyan Harkin @echo "PLAT is used to specify which platform you wish to build." 154708c7ed0fSSandrine Bailleux @echo "If no platform is specified, PLAT defaults to: ${DEFAULT_PLAT}" 154872ee3314SRyan Harkin @echo "" 15497c23126cSJohn Tsichritzis @echo "platform = ${PLATFORM_LIST}" 15507c23126cSJohn Tsichritzis @echo "" 15511b578596SSandrine Bailleux @echo "Please refer to the User Guide for a list of all supported options." 15521b578596SSandrine Bailleux @echo "Note that the build system doesn't track dependencies for build " 15531b578596SSandrine Bailleux @echo "options. Therefore, if any of the build options are changed " 15541b578596SSandrine Bailleux @echo "from a previous build, a clean build must be performed." 15551b578596SSandrine Bailleux @echo "" 155672ee3314SRyan Harkin @echo "Supported Targets:" 15571b578596SSandrine Bailleux @echo " all Build all individual bootloader binaries" 155836eaaf37SIan Spray @echo " bl1 Build the BL1 binary" 15598aa559c0SJeenu Viswambharan @echo " bl2 Build the BL2 binary" 15609003fa0bSYatharth Kochar @echo " bl2u Build the BL2U binary" 1561d178637dSJuan Castillo @echo " bl31 Build the BL31 binary" 15629d29c227SSoby Mathew @echo " bl32 Build the BL32 binary. If ARCH=aarch32, then " 15639d29c227SSoby Mathew @echo " this builds secure payload specified by AARCH32_SP" 156473c99d4eSJuan Castillo @echo " certificates Build the certificates (requires 'GENERATE_COT=1')" 15651b578596SSandrine Bailleux @echo " fip Build the Firmware Image Package (FIP)" 15660191262dSYatharth Kochar @echo " fwu_fip Build the FWU Firmware Image Package (FIP)" 156736eaaf37SIan Spray @echo " checkcodebase Check the coding style of the entire source tree" 156836eaaf37SIan Spray @echo " checkpatch Check the coding style on changes in the current" 156936eaaf37SIan Spray @echo " branch against BASE_COMMIT (default origin/master)" 157072ee3314SRyan Harkin @echo " clean Clean the build for the selected platform" 157135fab8c9SJoakim Bech @echo " cscope Generate cscope index" 157272ee3314SRyan Harkin @echo " distclean Remove all build artifacts for all platforms" 15736f971622SJuan Castillo @echo " certtool Build the Certificate generation tool" 157490aa901fSSumit Garg @echo " enctool Build the Firmware encryption tool" 1575f58ad36fSHarry Liebel @echo " fiptool Build the Firmware Image Package (FIP) creation tool" 1576ce2b1ec6SManish Pandey @echo " sp Build the Secure Partition Packages" 157726010da1SAntonio Nino Diaz @echo " sptool Build the Secure Partition Package creation tool" 157838c14d88SSoby Mathew @echo " dtbs Build the Device Tree Blobs (if required for the platform)" 1579cfe83910SLouis Mayencourt @echo " memmap Print the memory map of the built binaries" 15806de32378SMadhukar Pappireddy @echo " doc Build html based documentation using Sphinx tool" 158172ee3314SRyan Harkin @echo "" 15821b578596SSandrine Bailleux @echo "Note: most build targets require PLAT to be set to a specific platform." 158372ee3314SRyan Harkin @echo "" 158472ee3314SRyan Harkin @echo "example: build all targets for the FVP platform:" 158572ee3314SRyan Harkin @echo " CROSS_COMPILE=aarch64-none-elf- make PLAT=fvp all" 1586a9812206SPali Rohár 1587a9812206SPali Rohár.PHONY: FORCE 1588a9812206SPali RohárFORCE:; 1589