14f6ad66aSAchin Gupta# 254035fc4SSandrine Bailleux# Copyright (c) 2013-2016, ARM Limited and Contributors. All rights reserved. 34f6ad66aSAchin Gupta# 44f6ad66aSAchin Gupta# Redistribution and use in source and binary forms, with or without 54f6ad66aSAchin Gupta# modification, are permitted provided that the following conditions are met: 64f6ad66aSAchin Gupta# 74f6ad66aSAchin Gupta# Redistributions of source code must retain the above copyright notice, this 84f6ad66aSAchin Gupta# list of conditions and the following disclaimer. 94f6ad66aSAchin Gupta# 104f6ad66aSAchin Gupta# Redistributions in binary form must reproduce the above copyright notice, 114f6ad66aSAchin Gupta# this list of conditions and the following disclaimer in the documentation 124f6ad66aSAchin Gupta# and/or other materials provided with the distribution. 134f6ad66aSAchin Gupta# 144f6ad66aSAchin Gupta# Neither the name of ARM nor the names of its contributors may be used 154f6ad66aSAchin Gupta# to endorse or promote products derived from this software without specific 164f6ad66aSAchin Gupta# prior written permission. 174f6ad66aSAchin Gupta# 184f6ad66aSAchin Gupta# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 194f6ad66aSAchin Gupta# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 204f6ad66aSAchin Gupta# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 214f6ad66aSAchin Gupta# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 224f6ad66aSAchin Gupta# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 234f6ad66aSAchin Gupta# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 244f6ad66aSAchin Gupta# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 254f6ad66aSAchin Gupta# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 264f6ad66aSAchin Gupta# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 274f6ad66aSAchin Gupta# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 284f6ad66aSAchin Gupta# POSSIBILITY OF SUCH DAMAGE. 294f6ad66aSAchin Gupta# 304f6ad66aSAchin Gupta 31e35c4045SJeenu Viswambharan# 32aaa3e722SJuan Castillo# Trusted Firmware Version 33aaa3e722SJuan Castillo# 34c6249aaaSDan HandleyVERSION_MAJOR := 1 356791f52eSDan HandleyVERSION_MINOR := 2 36aaa3e722SJuan Castillo 3788154678SJuan Castillo# Default goal is build all images 3888154678SJuan Castillo.DEFAULT_GOAL := all 3988154678SJuan Castillo 40231c1470SEvan LloydMAKE_HELPERS_DIRECTORY := make_helpers/ 41231c1470SEvan Lloydinclude ${MAKE_HELPERS_DIRECTORY}build_macros.mk 42e7f54dbdSEvan Lloydinclude ${MAKE_HELPERS_DIRECTORY}build_env.mk 4373c99d4eSJuan Castillo 4473c99d4eSJuan Castillo################################################################################ 45e35c4045SJeenu Viswambharan# Default values for build configurations 4673c99d4eSJuan Castillo################################################################################ 47e35c4045SJeenu Viswambharan 48*9d29c227SSoby Mathew# The Target build architecture. Supported values are: aarch64, aarch32. 49031dbb12SSoby MathewARCH := aarch64 50e35c4045SJeenu Viswambharan# Build verbosity 51e35c4045SJeenu ViswambharanV := 0 52e35c4045SJeenu Viswambharan# Debug build 53e35c4045SJeenu ViswambharanDEBUG := 0 54e35c4045SJeenu Viswambharan# Build platform 55e35c4045SJeenu ViswambharanDEFAULT_PLAT := fvp 56e35c4045SJeenu ViswambharanPLAT := ${DEFAULT_PLAT} 57e35c4045SJeenu Viswambharan# SPD choice 58e35c4045SJeenu ViswambharanSPD := none 59*9d29c227SSoby Mathew# The AArch32 Secure Payload to be built as BL32 image 60*9d29c227SSoby MathewAARCH32_SP := none 61e35c4045SJeenu Viswambharan# Base commit to perform code check on 62e35c4045SJeenu ViswambharanBASE_COMMIT := origin/master 632da8d8bfSJeenu Viswambharan# NS timer register save and restore 642da8d8bfSJeenu ViswambharanNS_TIMER_SWITCH := 0 651645d3eeSSandrine Bailleux# By default, BL1 acts as the reset handler, not BL31 66dbad1bacSVikram KanigiriRESET_TO_BL31 := 0 670f21c547SJuan Castillo# Include FP registers in cpu context 680f21c547SJuan CastilloCTX_INCLUDE_FPREGS := 0 698cd16e6bSSoby Mathew# Build flag to include AArch32 registers in cpu context save and restore 708cd16e6bSSoby Mathew# during world switch. This flag must be set to 0 for AArch64-only platforms. 718cd16e6bSSoby MathewCTX_INCLUDE_AARCH32_REGS := 1 722b98e789SSandrine Bailleux# Determine the version of ARM GIC architecture to use for interrupt management 732b98e789SSandrine Bailleux# in EL3. The platform port can change this value if needed. 742b98e789SSandrine BailleuxARM_GIC_ARCH := 2 7523e47edeSVikram Kanigiri# Determine the version of ARM CCI product used in the platform. The platform 7623e47edeSVikram Kanigiri# port can change this value if needed. 7723e47edeSVikram KanigiriARM_CCI_PRODUCT_ID := 400 78bc920128SSoby Mathew# Flag used to indicate if ASM_ASSERTION should be enabled for the build. 79bc920128SSoby Mathew# This defaults to being present in DEBUG builds only. 80bc920128SSoby MathewASM_ASSERTION := ${DEBUG} 818c5fe0b5SSoby Mathew# Build option to choose whether Trusted firmware uses Coherent memory or not. 828c5fe0b5SSoby MathewUSE_COHERENT_MEM := 1 838ee24980SSoby Mathew# Flag used to choose the power state format viz Extended State-ID or the Original 848ee24980SSoby Mathew# format. 858ee24980SSoby MathewPSCI_EXTENDED_STATE_ID := 0 867f48fab9SJuan Castillo# Default FIP file name 877f48fab9SJuan CastilloFIP_NAME := fip.bin 880191262dSYatharth Kochar# Default FWU_FIP file name 890191262dSYatharth KocharFWU_FIP_NAME := fwu_fip.bin 90db6071c9SJuan Castillo# By default, use the -pedantic option in the gcc command line 91db6071c9SJuan CastilloDISABLE_PEDANTIC := 0 926f971622SJuan Castillo# Flags to generate the Chain of Trust 936f971622SJuan CastilloGENERATE_COT := 0 946f971622SJuan CastilloCREATE_KEYS := 1 95fd34e7baSJuan CastilloSAVE_KEYS := 0 966eadf762SJuan Castillo# Flags to build TF with Trusted Boot support 976eadf762SJuan CastilloTRUSTED_BOARD_BOOT := 0 98bf031bbaSSandrine Bailleux# By default, consider that the platform's reset address is not programmable. 99bf031bbaSSandrine Bailleux# The platform Makefile is free to override this value. 100bf031bbaSSandrine BailleuxPROGRAMMABLE_RESET_ADDRESS := 0 1017a24cba5SSoby Mathew# Build flag to treat usage of deprecated platform and framework APIs as error. 1027a24cba5SSoby MathewERROR_DEPRECATED := 0 103a9bec67dSSandrine Bailleux# By default, consider that the platform may release several CPUs out of reset. 104a9bec67dSSandrine Bailleux# The platform Makefile is free to override this value. 105a9bec67dSSandrine BailleuxCOLD_BOOT_SINGLE_CPU := 0 10635e8c766SSandrine Bailleux# Flag to introduce an infinite loop in BL1 just before it exits into the next 10735e8c766SSandrine Bailleux# image. This is meant to help debugging the post-BL2 phase. 10835e8c766SSandrine BailleuxSPIN_ON_BL1_EXIT := 0 10912f654b6SJuan Castillo# Build PL011 UART driver in minimal generic UART mode 11012f654b6SJuan CastilloPL011_GENERIC_UART := 0 111a31d8983SYatharth Kochar# Flag to enable Performance Measurement Framework 112a31d8983SYatharth KocharENABLE_PMF := 0 113170fb93dSYatharth Kochar# Flag to enable PSCI STATs functionality 114170fb93dSYatharth KocharENABLE_PSCI_STAT := 0 1155d1c104fSSandrine Bailleux# Whether code and read-only data should be put on separate memory pages. 1165d1c104fSSandrine Bailleux# The platform Makefile is free to override this value. 1175d1c104fSSandrine BailleuxSEPARATE_CODE_AND_RODATA := 0 1185d1c104fSSandrine Bailleux 11973c99d4eSJuan Castillo 12073c99d4eSJuan Castillo################################################################################ 12173c99d4eSJuan Castillo# Checkpatch script options 12273c99d4eSJuan Castillo################################################################################ 12373c99d4eSJuan Castillo 124f607739cSSandrine BailleuxCHECKCODE_ARGS := --no-patch 125f0b489c1SDan Handley# Do not check the coding style on imported library files or documentation files 126f0b489c1SDan HandleyINC_LIB_DIRS_TO_CHECK := $(sort $(filter-out \ 1271a41e8c1SDan Handley include/lib/libfdt \ 128f0b489c1SDan Handley include/lib/stdlib, \ 129f0b489c1SDan Handley $(wildcard include/lib/*))) 130f0b489c1SDan HandleyINC_DIRS_TO_CHECK := $(sort $(filter-out \ 131f0b489c1SDan Handley include/lib, \ 132f0b489c1SDan Handley $(wildcard include/*))) 133f0b489c1SDan HandleyLIB_DIRS_TO_CHECK := $(sort $(filter-out \ 1341a41e8c1SDan Handley lib/libfdt \ 135f0b489c1SDan Handley lib/stdlib, \ 136f0b489c1SDan Handley $(wildcard lib/*))) 137f0b489c1SDan HandleyROOT_DIRS_TO_CHECK := $(sort $(filter-out \ 138f0b489c1SDan Handley lib \ 139f0b489c1SDan Handley include \ 140f0b489c1SDan Handley docs \ 141f0b489c1SDan Handley %.md, \ 142f0b489c1SDan Handley $(wildcard *))) 143f0b489c1SDan HandleyCHECK_PATHS := ${ROOT_DIRS_TO_CHECK} \ 144f0b489c1SDan Handley ${INC_DIRS_TO_CHECK} \ 145f0b489c1SDan Handley ${INC_LIB_DIRS_TO_CHECK} \ 146f0b489c1SDan Handley ${LIB_DIRS_TO_CHECK} 14736eaaf37SIan Spray 14873c99d4eSJuan Castillo 14973c99d4eSJuan Castillo################################################################################ 15073c99d4eSJuan Castillo# Process build options 15173c99d4eSJuan Castillo################################################################################ 15273c99d4eSJuan Castillo 15373c99d4eSJuan Castillo# Verbose flag 154e35c4045SJeenu Viswambharanifeq (${V},0) 155b169f6a9SEvan Lloyd Q:=@ 15636eaaf37SIan Spray CHECKCODE_ARGS += --no-summary --terse 1574f6ad66aSAchin Guptaelse 158b169f6a9SEvan Lloyd Q:= 1594f6ad66aSAchin Guptaendif 1602f2cef46SJeenu Viswambharanexport Q 1612f2cef46SJeenu Viswambharan 16273c99d4eSJuan Castillo# Process Debug flag 16373c99d4eSJuan Castillo$(eval $(call add_define,DEBUG)) 164eaaeece2SJames Morrisseyifneq (${DEBUG}, 0) 165eaaeece2SJames Morrissey BUILD_TYPE := debug 166403973c9SSandrine Bailleux TF_CFLAGS += -g 16773c99d4eSJuan Castillo ASFLAGS += -g -Wa,--gdwarf-2 168289c28a8SDan Handley # Use LOG_LEVEL_INFO by default for debug builds 169289c28a8SDan Handley LOG_LEVEL := 40 170eaaeece2SJames Morrisseyelse 171eaaeece2SJames Morrissey BUILD_TYPE := release 17273c99d4eSJuan Castillo $(eval $(call add_define,NDEBUG)) 173289c28a8SDan Handley # Use LOG_LEVEL_NOTICE by default for release builds 174289c28a8SDan Handley LOG_LEVEL := 20 175eaaeece2SJames Morrisseyendif 176eaaeece2SJames Morrissey 177aaa3e722SJuan Castillo# Default build string (git branch and commit) 178aaa3e722SJuan Castilloifeq (${BUILD_STRING},) 179aaa3e722SJuan Castillo BUILD_STRING := $(shell git log -n 1 --pretty=format:"%h") 180aaa3e722SJuan Castilloendif 181aaa3e722SJuan CastilloVERSION_STRING := v${VERSION_MAJOR}.${VERSION_MINOR}(${BUILD_TYPE}):${BUILD_STRING} 182aaa3e722SJuan Castillo 18373c99d4eSJuan Castillo# The cert_create tool cannot generate certificates individually, so we use the 18473c99d4eSJuan Castillo# target 'certificates' to create them all 18573c99d4eSJuan Castilloifneq (${GENERATE_COT},0) 18673c99d4eSJuan Castillo FIP_DEPS += certificates 1870191262dSYatharth Kochar FWU_FIP_DEPS += fwu_certificates 18873c99d4eSJuan Castilloendif 18973c99d4eSJuan Castillo 19073c99d4eSJuan Castillo 19173c99d4eSJuan Castillo################################################################################ 19273c99d4eSJuan Castillo# Toolchain 19373c99d4eSJuan Castillo################################################################################ 19473c99d4eSJuan Castillo 19573c99d4eSJuan CastilloCC := ${CROSS_COMPILE}gcc 19673c99d4eSJuan CastilloCPP := ${CROSS_COMPILE}cpp 19773c99d4eSJuan CastilloAS := ${CROSS_COMPILE}gcc 19873c99d4eSJuan CastilloAR := ${CROSS_COMPILE}ar 19973c99d4eSJuan CastilloLD := ${CROSS_COMPILE}ld 20073c99d4eSJuan CastilloOC := ${CROSS_COMPILE}objcopy 20173c99d4eSJuan CastilloOD := ${CROSS_COMPILE}objdump 20273c99d4eSJuan CastilloNM := ${CROSS_COMPILE}nm 20373c99d4eSJuan CastilloPP := ${CROSS_COMPILE}gcc -E 20473c99d4eSJuan Castillo 205*9d29c227SSoby MathewASFLAGS_aarch64 = -mgeneral-regs-only 206*9d29c227SSoby MathewTF_CFLAGS_aarch64 = -mgeneral-regs-only -mstrict-align 207*9d29c227SSoby Mathew 208*9d29c227SSoby MathewASFLAGS_aarch32 = -march=armv8-a 209*9d29c227SSoby MathewTF_CFLAGS_aarch32 = -march=armv8-a 210*9d29c227SSoby Mathew 21173c99d4eSJuan CastilloASFLAGS += -nostdinc -ffreestanding -Wa,--fatal-warnings \ 21273c99d4eSJuan Castillo -Werror -Wmissing-include-dirs \ 213*9d29c227SSoby Mathew -D__ASSEMBLY__ $(ASFLAGS_$(ARCH)) \ 21473c99d4eSJuan Castillo ${DEFINES} ${INCLUDES} 215403973c9SSandrine BailleuxTF_CFLAGS += -nostdinc -ffreestanding -Wall \ 21673c99d4eSJuan Castillo -Werror -Wmissing-include-dirs \ 217fa1d3712SJuan Castillo -std=c99 -c -Os \ 218*9d29c227SSoby Mathew $(TF_CFLAGS_$(ARCH)) \ 21973c99d4eSJuan Castillo ${DEFINES} ${INCLUDES} 220403973c9SSandrine BailleuxTF_CFLAGS += -ffunction-sections -fdata-sections 22173c99d4eSJuan Castillo 22273c99d4eSJuan CastilloLDFLAGS += --fatal-warnings -O1 22373c99d4eSJuan CastilloLDFLAGS += --gc-sections 22473c99d4eSJuan Castillo 22573c99d4eSJuan Castillo 22673c99d4eSJuan Castillo################################################################################ 22773c99d4eSJuan Castillo# Common sources and include directories 22873c99d4eSJuan Castillo################################################################################ 229f0b489c1SDan Handleyinclude lib/stdlib/stdlib.mk 23073c99d4eSJuan Castillo 23173c99d4eSJuan CastilloBL_COMMON_SOURCES += common/bl_common.c \ 232b79af934SSoby Mathew common/tf_printf.c \ 233*9d29c227SSoby Mathew common/${ARCH}/debug.S \ 234*9d29c227SSoby Mathew lib/${ARCH}/cache_helpers.S \ 235*9d29c227SSoby Mathew lib/${ARCH}/misc_helpers.S \ 236*9d29c227SSoby Mathew plat/common/${ARCH}/platform_helpers.S \ 237f0b489c1SDan Handley ${STDLIB_SRCS} 238d7a6b0f8SRyan Harkin 23948bfb88eSYatharth KocharINCLUDES += -Iinclude/bl1 \ 24048bfb88eSYatharth Kochar -Iinclude/bl31 \ 2414ecca339SDan Handley -Iinclude/common \ 242*9d29c227SSoby Mathew -Iinclude/common/${ARCH} \ 2434ecca339SDan Handley -Iinclude/drivers \ 2444ecca339SDan Handley -Iinclude/drivers/arm \ 2451779ba6bSJuan Castillo -Iinclude/drivers/auth \ 246935db693SDan Handley -Iinclude/drivers/io \ 247c13b2e32SVarun Wadekar -Iinclude/drivers/ti/uart \ 2484ecca339SDan Handley -Iinclude/lib \ 249*9d29c227SSoby Mathew -Iinclude/lib/${ARCH} \ 250*9d29c227SSoby Mathew -Iinclude/lib/cpus/${ARCH} \ 251532ed618SSoby Mathew -Iinclude/lib/el3_runtime \ 252*9d29c227SSoby Mathew -Iinclude/lib/el3_runtime/${ARCH} \ 253532ed618SSoby Mathew -Iinclude/lib/psci \ 2545f0cdb05SDan Handley -Iinclude/plat/common \ 255532ed618SSoby Mathew -Iinclude/services \ 256375f538aSAchin Gupta ${PLAT_INCLUDES} \ 257375f538aSAchin Gupta ${SPD_INCLUDES} 2584f6ad66aSAchin Gupta 25973c99d4eSJuan Castillo 26073c99d4eSJuan Castillo################################################################################ 26173c99d4eSJuan Castillo# Generic definitions 26273c99d4eSJuan Castillo################################################################################ 26373c99d4eSJuan Castillo 264231c1470SEvan Lloydinclude ${MAKE_HELPERS_DIRECTORY}plat_helpers.mk 265231c1470SEvan Lloyd 26673c99d4eSJuan CastilloBUILD_BASE := ./build 26773c99d4eSJuan CastilloBUILD_PLAT := ${BUILD_BASE}/${PLAT}/${BUILD_TYPE} 26873c99d4eSJuan Castillo 269231c1470SEvan LloydSPDS := $(sort $(filter-out none, $(patsubst services/spd/%,%,$(wildcard services/spd/*)))) 27073c99d4eSJuan Castillo 27173c99d4eSJuan Castillo# Platforms providing their own TBB makefile may override this value 27273c99d4eSJuan CastilloINCLUDE_TBBR_MK := 1 27373c99d4eSJuan Castillo 27473c99d4eSJuan Castillo 27573c99d4eSJuan Castillo################################################################################ 27673c99d4eSJuan Castillo# Include SPD Makefile if one has been specified 27773c99d4eSJuan Castillo################################################################################ 27873c99d4eSJuan Castillo 27973c99d4eSJuan Castilloifneq (${SPD},none) 280*9d29c227SSoby Mathewifeq (${ARCH},aarch32) 281*9d29c227SSoby Mathew $(error "Error: SPD is incompatible with AArch32.") 282*9d29c227SSoby Mathewendif 2834c117f6cSSandrine Bailleuxifdef EL3_PAYLOAD_BASE 2844c117f6cSSandrine Bailleux $(warning "SPD and EL3_PAYLOAD_BASE are incompatible build options.") 2854c117f6cSSandrine Bailleux $(warning "The SPD and its BL32 companion will be present but ignored.") 2864c117f6cSSandrine Bailleuxendif 28773c99d4eSJuan Castillo # We expect to locate an spd.mk under the specified SPD directory 288231c1470SEvan Lloyd SPD_MAKE := $(wildcard services/spd/${SPD}/${SPD}.mk) 28973c99d4eSJuan Castillo 29073c99d4eSJuan Castillo ifeq (${SPD_MAKE},) 29173c99d4eSJuan Castillo $(error Error: No services/spd/${SPD}/${SPD}.mk located) 29273c99d4eSJuan Castillo endif 29373c99d4eSJuan Castillo $(info Including ${SPD_MAKE}) 29473c99d4eSJuan Castillo include ${SPD_MAKE} 29573c99d4eSJuan Castillo 29670d1fc53SJuan Castillo # If there's BL32 companion for the chosen SPD, we expect that the SPD's 29770d1fc53SJuan Castillo # Makefile would set NEED_BL32 to "yes". In this case, the build system 29870d1fc53SJuan Castillo # supports two mutually exclusive options: 29970d1fc53SJuan Castillo # * BL32 is built from source: then BL32_SOURCES must contain the list 30070d1fc53SJuan Castillo # of source files to build BL32 30170d1fc53SJuan Castillo # * BL32 is a prebuilt binary: then BL32 must point to the image file 30270d1fc53SJuan Castillo # that will be included in the FIP 30370d1fc53SJuan Castillo # If both BL32_SOURCES and BL32 are defined, the binary takes precedence 30470d1fc53SJuan Castillo # over the sources. 305e35c4045SJeenu Viswambharanendif 306e35c4045SJeenu Viswambharan 307c04d2606SDan Handley 30873c99d4eSJuan Castillo################################################################################ 30973c99d4eSJuan Castillo# Include the platform specific Makefile after the SPD Makefile (the platform 31073c99d4eSJuan Castillo# makefile may use all previous definitions in this file) 31173c99d4eSJuan Castillo################################################################################ 3122da8d8bfSJeenu Viswambharan 31373c99d4eSJuan Castilloinclude ${PLAT_MAKEFILE_FULL} 3140f21c547SJuan Castillo 315*9d29c227SSoby Mathew# Platform compatibility is not supported in AArch32 316*9d29c227SSoby Mathewifneq (${ARCH},aarch32) 31793271a1eSAchin Gupta# If the platform has not defined ENABLE_PLAT_COMPAT, then enable it by default 31893271a1eSAchin Guptaifndef ENABLE_PLAT_COMPAT 31993271a1eSAchin GuptaENABLE_PLAT_COMPAT := 1 32093271a1eSAchin Guptaendif 32193271a1eSAchin Gupta 32293271a1eSAchin Gupta# Include the platform compatibility helpers for PSCI 32393271a1eSAchin Guptaifneq (${ENABLE_PLAT_COMPAT}, 0) 32493271a1eSAchin Guptainclude plat/compat/plat_compat.mk 32593271a1eSAchin Guptaendif 326*9d29c227SSoby Mathewendif 32793271a1eSAchin Gupta 32854035fc4SSandrine Bailleux# Include the CPU specific operations makefile, which provides default 32954035fc4SSandrine Bailleux# values for all CPU errata workarounds and CPU specific optimisations. 33054035fc4SSandrine Bailleux# This can be overridden by the platform. 33173c99d4eSJuan Castilloinclude lib/cpus/cpu-ops.mk 3324f6ad66aSAchin Gupta 3334f6ad66aSAchin Gupta 33473c99d4eSJuan Castillo################################################################################ 335cf2c8a33SAntonio Nino Diaz# Check incompatible options 336cf2c8a33SAntonio Nino Diaz################################################################################ 337cf2c8a33SAntonio Nino Diaz 338cf2c8a33SAntonio Nino Diazifdef EL3_PAYLOAD_BASE 33968450a6dSAntonio Nino Diaz ifdef PRELOADED_BL33_BASE 34068450a6dSAntonio Nino Diaz $(warning "PRELOADED_BL33_BASE and EL3_PAYLOAD_BASE are \ 34168450a6dSAntonio Nino Diaz incompatible build options. EL3_PAYLOAD_BASE has priority.") 342cf2c8a33SAntonio Nino Diaz endif 343cf2c8a33SAntonio Nino Diazendif 344cf2c8a33SAntonio Nino Diaz 345cf2c8a33SAntonio Nino Diazifeq (${NEED_BL33},yes) 346cf2c8a33SAntonio Nino Diaz ifdef EL3_PAYLOAD_BASE 347cf2c8a33SAntonio Nino Diaz $(warning "BL33 image is not needed when option \ 348cf2c8a33SAntonio Nino Diaz BL33_PAYLOAD_BASE is used and won't be added to the FIP file.") 349cf2c8a33SAntonio Nino Diaz endif 35068450a6dSAntonio Nino Diaz ifdef PRELOADED_BL33_BASE 35168450a6dSAntonio Nino Diaz $(warning "BL33 image is not needed when option \ 35268450a6dSAntonio Nino Diaz PRELOADED_BL33_BASE is used and won't be added to the FIP \ 35368450a6dSAntonio Nino Diaz file.") 354cf2c8a33SAntonio Nino Diaz endif 355cf2c8a33SAntonio Nino Diazendif 356cf2c8a33SAntonio Nino Diaz 357cf2c8a33SAntonio Nino Diaz 358cf2c8a33SAntonio Nino Diaz################################################################################ 35973c99d4eSJuan Castillo# Process platform overrideable behaviour 36073c99d4eSJuan Castillo################################################################################ 3614f6ad66aSAchin Gupta 36273c99d4eSJuan Castillo# Check if -pedantic option should be used 36373c99d4eSJuan Castilloifeq (${DISABLE_PEDANTIC},0) 364403973c9SSandrine Bailleux TF_CFLAGS += -pedantic 36573c99d4eSJuan Castilloendif 366f58ad36fSHarry Liebel 3671645d3eeSSandrine Bailleux# Using the ARM Trusted Firmware BL2 implies that a BL33 image also needs to be 36873c99d4eSJuan Castillo# supplied for the FIP and Certificate generation tools. This flag can be 36973c99d4eSJuan Castillo# overridden by the platform. 37073c99d4eSJuan Castilloifdef BL2_SOURCES 371cf2c8a33SAntonio Nino Diaz ifdef EL3_PAYLOAD_BASE 372cf2c8a33SAntonio Nino Diaz # If booting an EL3 payload there is no need for a BL33 image 373cf2c8a33SAntonio Nino Diaz # in the FIP file. 3744c117f6cSSandrine Bailleux NEED_BL33 := no 375cf2c8a33SAntonio Nino Diaz else 37668450a6dSAntonio Nino Diaz ifdef PRELOADED_BL33_BASE 377cf2c8a33SAntonio Nino Diaz # If booting a BL33 preloaded image there is no need of 378cf2c8a33SAntonio Nino Diaz # another one in the FIP file. 379cf2c8a33SAntonio Nino Diaz NEED_BL33 := no 380cf2c8a33SAntonio Nino Diaz else 381cf2c8a33SAntonio Nino Diaz NEED_BL33 ?= yes 382cf2c8a33SAntonio Nino Diaz endif 3834c117f6cSSandrine Bailleux endif 38473c99d4eSJuan Castilloendif 3856f971622SJuan Castillo 38673c99d4eSJuan Castillo# Process TBB related flags 3876f971622SJuan Castilloifneq (${GENERATE_COT},0) 38873c99d4eSJuan Castillo # Common cert_create options 3896f971622SJuan Castillo ifneq (${CREATE_KEYS},0) 3906f971622SJuan Castillo $(eval CRT_ARGS += -n) 3910191262dSYatharth Kochar $(eval FWU_CRT_ARGS += -n) 392fd34e7baSJuan Castillo ifneq (${SAVE_KEYS},0) 393fd34e7baSJuan Castillo $(eval CRT_ARGS += -k) 3940191262dSYatharth Kochar $(eval FWU_CRT_ARGS += -k) 395fd34e7baSJuan Castillo endif 3966f971622SJuan Castillo endif 39773c99d4eSJuan Castillo # Include TBBR makefile (unless the platform indicates otherwise) 39873c99d4eSJuan Castillo ifeq (${INCLUDE_TBBR_MK},1) 39973c99d4eSJuan Castillo include make_helpers/tbbr/tbbr_tools.mk 40073c99d4eSJuan Castillo endif 4016f971622SJuan Castilloendif 4026f971622SJuan Castillo 403170fb93dSYatharth Kochar# Make sure PMF is enabled if PSCI STAT is enabled. 404170fb93dSYatharth Kocharifeq (${ENABLE_PSCI_STAT},1) 405170fb93dSYatharth KocharENABLE_PMF := 1 406170fb93dSYatharth Kocharendif 40773c99d4eSJuan Castillo 40873c99d4eSJuan Castillo################################################################################ 409819281eeSdp-arm# Auxiliary tools (fiptool, cert_create, etc) 41073c99d4eSJuan Castillo################################################################################ 41173c99d4eSJuan Castillo 41273c99d4eSJuan Castillo# Variables for use with Certificate Generation Tool 41373c99d4eSJuan CastilloCRTTOOLPATH ?= tools/cert_create 41442a45b51SEvan LloydCRTTOOL ?= ${CRTTOOLPATH}/cert_create${BIN_EXT} 41573c99d4eSJuan Castillo 41673c99d4eSJuan Castillo# Variables for use with Firmware Image Package 417819281eeSdp-armFIPTOOLPATH ?= tools/fiptool 418819281eeSdp-armFIPTOOL ?= ${FIPTOOLPATH}/fiptool${BIN_EXT} 41973c99d4eSJuan Castillo 42073c99d4eSJuan Castillo 42173c99d4eSJuan Castillo################################################################################ 42273c99d4eSJuan Castillo# Build options checks 42373c99d4eSJuan Castillo################################################################################ 42473c99d4eSJuan Castillo 42573c99d4eSJuan Castillo$(eval $(call assert_boolean,DEBUG)) 42673c99d4eSJuan Castillo$(eval $(call assert_boolean,NS_TIMER_SWITCH)) 42773c99d4eSJuan Castillo$(eval $(call assert_boolean,RESET_TO_BL31)) 42873c99d4eSJuan Castillo$(eval $(call assert_boolean,CTX_INCLUDE_FPREGS)) 4298cd16e6bSSoby Mathew$(eval $(call assert_boolean,CTX_INCLUDE_AARCH32_REGS)) 43073c99d4eSJuan Castillo$(eval $(call assert_boolean,ASM_ASSERTION)) 43173c99d4eSJuan Castillo$(eval $(call assert_boolean,USE_COHERENT_MEM)) 43273c99d4eSJuan Castillo$(eval $(call assert_boolean,DISABLE_PEDANTIC)) 43373c99d4eSJuan Castillo$(eval $(call assert_boolean,GENERATE_COT)) 43473c99d4eSJuan Castillo$(eval $(call assert_boolean,CREATE_KEYS)) 43573c99d4eSJuan Castillo$(eval $(call assert_boolean,SAVE_KEYS)) 43673c99d4eSJuan Castillo$(eval $(call assert_boolean,TRUSTED_BOARD_BOOT)) 43773c99d4eSJuan Castillo$(eval $(call assert_boolean,PROGRAMMABLE_RESET_ADDRESS)) 438a9bec67dSSandrine Bailleux$(eval $(call assert_boolean,COLD_BOOT_SINGLE_CPU)) 43973c99d4eSJuan Castillo$(eval $(call assert_boolean,PSCI_EXTENDED_STATE_ID)) 4407a24cba5SSoby Mathew$(eval $(call assert_boolean,ERROR_DEPRECATED)) 44193271a1eSAchin Gupta$(eval $(call assert_boolean,ENABLE_PLAT_COMPAT)) 44235e8c766SSandrine Bailleux$(eval $(call assert_boolean,SPIN_ON_BL1_EXIT)) 44312f654b6SJuan Castillo$(eval $(call assert_boolean,PL011_GENERIC_UART)) 444a31d8983SYatharth Kochar$(eval $(call assert_boolean,ENABLE_PMF)) 445170fb93dSYatharth Kochar$(eval $(call assert_boolean,ENABLE_PSCI_STAT)) 4465d1c104fSSandrine Bailleux$(eval $(call assert_boolean,SEPARATE_CODE_AND_RODATA)) 44773c99d4eSJuan Castillo 44873c99d4eSJuan Castillo 44973c99d4eSJuan Castillo################################################################################ 45073c99d4eSJuan Castillo# Add definitions to the cpp preprocessor based on the current build options. 45173c99d4eSJuan Castillo# This is done after including the platform specific makefile to allow the 45273c99d4eSJuan Castillo# platform to overwrite the default options 45373c99d4eSJuan Castillo################################################################################ 45473c99d4eSJuan Castillo 45573c99d4eSJuan Castillo$(eval $(call add_define,PLAT_${PLAT})) 45681d139d5SAntonio Nino Diaz$(eval $(call add_define,SPD_${SPD})) 45773c99d4eSJuan Castillo$(eval $(call add_define,NS_TIMER_SWITCH)) 45873c99d4eSJuan Castillo$(eval $(call add_define,RESET_TO_BL31)) 45973c99d4eSJuan Castillo$(eval $(call add_define,CTX_INCLUDE_FPREGS)) 4608cd16e6bSSoby Mathew$(eval $(call add_define,CTX_INCLUDE_AARCH32_REGS)) 46173c99d4eSJuan Castillo$(eval $(call add_define,ARM_GIC_ARCH)) 46273c99d4eSJuan Castillo$(eval $(call add_define,ARM_CCI_PRODUCT_ID)) 46373c99d4eSJuan Castillo$(eval $(call add_define,ASM_ASSERTION)) 46473c99d4eSJuan Castillo$(eval $(call add_define,LOG_LEVEL)) 46573c99d4eSJuan Castillo$(eval $(call add_define,USE_COHERENT_MEM)) 46673c99d4eSJuan Castillo$(eval $(call add_define,TRUSTED_BOARD_BOOT)) 46773c99d4eSJuan Castillo$(eval $(call add_define,PROGRAMMABLE_RESET_ADDRESS)) 468a9bec67dSSandrine Bailleux$(eval $(call add_define,COLD_BOOT_SINGLE_CPU)) 46973c99d4eSJuan Castillo$(eval $(call add_define,PSCI_EXTENDED_STATE_ID)) 4707a24cba5SSoby Mathew$(eval $(call add_define,ERROR_DEPRECATED)) 47193271a1eSAchin Gupta$(eval $(call add_define,ENABLE_PLAT_COMPAT)) 47235e8c766SSandrine Bailleux$(eval $(call add_define,SPIN_ON_BL1_EXIT)) 473cf2c8a33SAntonio Nino Diaz$(eval $(call add_define,PL011_GENERIC_UART)) 474a31d8983SYatharth Kochar$(eval $(call add_define,ENABLE_PMF)) 475170fb93dSYatharth Kochar$(eval $(call add_define,ENABLE_PSCI_STAT)) 4765d1c104fSSandrine Bailleux$(eval $(call add_define,SEPARATE_CODE_AND_RODATA)) 4774c117f6cSSandrine Bailleux# Define the EL3_PAYLOAD_BASE flag only if it is provided. 4784c117f6cSSandrine Bailleuxifdef EL3_PAYLOAD_BASE 4794c117f6cSSandrine Bailleux $(eval $(call add_define,EL3_PAYLOAD_BASE)) 480cf2c8a33SAntonio Nino Diazelse 48168450a6dSAntonio Nino Diaz # Define the PRELOADED_BL33_BASE flag only if it is provided and 48268450a6dSAntonio Nino Diaz # EL3_PAYLOAD_BASE is not defined, as it has priority. 48368450a6dSAntonio Nino Diaz ifdef PRELOADED_BL33_BASE 48468450a6dSAntonio Nino Diaz $(eval $(call add_define,PRELOADED_BL33_BASE)) 4854c117f6cSSandrine Bailleux endif 486cf2c8a33SAntonio Nino Diazendif 487031dbb12SSoby Mathew# Define the AARCH32/AARCH64 flag based on the ARCH flag 488031dbb12SSoby Mathewifeq (${ARCH},aarch32) 489031dbb12SSoby Mathew $(eval $(call add_define,AARCH32)) 490031dbb12SSoby Mathewelse 491031dbb12SSoby Mathew $(eval $(call add_define,AARCH64)) 492031dbb12SSoby Mathewendif 49373c99d4eSJuan Castillo 49473c99d4eSJuan Castillo################################################################################ 49573c99d4eSJuan Castillo# Include BL specific makefiles 49673c99d4eSJuan Castillo################################################################################ 497*9d29c227SSoby Mathew# BL31 is not needed and BL1, BL2 & BL2U are not currently supported in AArch32 498*9d29c227SSoby Mathewifneq (${ARCH},aarch32) 49973c99d4eSJuan Castilloifdef BL1_SOURCES 50073c99d4eSJuan CastilloNEED_BL1 := yes 50173c99d4eSJuan Castilloinclude bl1/bl1.mk 50273c99d4eSJuan Castilloendif 50373c99d4eSJuan Castillo 50473c99d4eSJuan Castilloifdef BL2_SOURCES 50573c99d4eSJuan CastilloNEED_BL2 := yes 50673c99d4eSJuan Castilloinclude bl2/bl2.mk 50773c99d4eSJuan Castilloendif 50873c99d4eSJuan Castillo 5099003fa0bSYatharth Kocharifdef BL2U_SOURCES 5109003fa0bSYatharth KocharNEED_BL2U := yes 5119003fa0bSYatharth Kocharinclude bl2u/bl2u.mk 5129003fa0bSYatharth Kocharendif 5139003fa0bSYatharth Kochar 51473c99d4eSJuan Castilloifdef BL31_SOURCES 5154c117f6cSSandrine Bailleux# When booting an EL3 payload, there is no need to compile the BL31 image nor 5164c117f6cSSandrine Bailleux# put it in the FIP. 5174c117f6cSSandrine Bailleuxifndef EL3_PAYLOAD_BASE 51873c99d4eSJuan CastilloNEED_BL31 := yes 51973c99d4eSJuan Castilloinclude bl31/bl31.mk 52073c99d4eSJuan Castilloendif 5214c117f6cSSandrine Bailleuxendif 522*9d29c227SSoby Mathewendif 52373c99d4eSJuan Castillo 524*9d29c227SSoby Mathewifeq (${ARCH},aarch32) 525*9d29c227SSoby MathewNEED_BL32 := yes 526*9d29c227SSoby Mathew 527*9d29c227SSoby Mathew################################################################################ 528*9d29c227SSoby Mathew# Build `AARCH32_SP` as BL32 image for AArch32 529*9d29c227SSoby Mathew################################################################################ 530*9d29c227SSoby Mathewifneq (${AARCH32_SP},none) 531*9d29c227SSoby Mathew# We expect to locate an sp.mk under the specified AARCH32_SP directory 532*9d29c227SSoby MathewAARCH32_SP_MAKE := $(wildcard bl32/${AARCH32_SP}/${AARCH32_SP}.mk) 533*9d29c227SSoby Mathew 534*9d29c227SSoby Mathewifeq (${AARCH32_SP_MAKE},) 535*9d29c227SSoby Mathew $(error Error: No bl32/${AARCH32_SP}/${AARCH32_SP}.mk located) 536*9d29c227SSoby Mathewendif 537*9d29c227SSoby Mathew 538*9d29c227SSoby Mathew$(info Including ${AARCH32_SP_MAKE}) 539*9d29c227SSoby Mathewinclude ${AARCH32_SP_MAKE} 540*9d29c227SSoby Mathewendif 541*9d29c227SSoby Mathew 542*9d29c227SSoby Mathewendif 54373c99d4eSJuan Castillo 54473c99d4eSJuan Castillo################################################################################ 54573c99d4eSJuan Castillo# Build targets 54673c99d4eSJuan Castillo################################################################################ 54773c99d4eSJuan Castillo 5480191262dSYatharth Kochar.PHONY: all msg_start clean realclean distclean cscope locate-checkpatch checkcodebase checkpatch fiptool fip fwu_fip certtool 54973c99d4eSJuan Castillo.SUFFIXES: 55073c99d4eSJuan Castillo 55173c99d4eSJuan Castilloall: msg_start 55273c99d4eSJuan Castillo 55373c99d4eSJuan Castillomsg_start: 55473c99d4eSJuan Castillo @echo "Building ${PLAT}" 55573c99d4eSJuan Castillo 5567a24cba5SSoby Mathew# Check if deprecated declarations should be treated as error or not. 5577a24cba5SSoby Mathewifeq (${ERROR_DEPRECATED},0) 558403973c9SSandrine Bailleux TF_CFLAGS += -Wno-error=deprecated-declarations 5597a24cba5SSoby Mathewendif 5607a24cba5SSoby Mathew 56173c99d4eSJuan Castillo# Expand build macros for the different images 56273c99d4eSJuan Castilloifeq (${NEED_BL1},yes) 56373c99d4eSJuan Castillo$(eval $(call MAKE_BL,1)) 56473c99d4eSJuan Castilloendif 56573c99d4eSJuan Castillo 56673c99d4eSJuan Castilloifeq (${NEED_BL2},yes) 5678f0617efSJuan Castillo$(if ${BL2}, $(eval $(call MAKE_TOOL_ARGS,2,${BL2},tb-fw)),\ 5688f0617efSJuan Castillo $(eval $(call MAKE_BL,2,tb-fw))) 56973c99d4eSJuan Castilloendif 57073c99d4eSJuan Castillo 57173c99d4eSJuan Castilloifeq (${NEED_BL31},yes) 57273c99d4eSJuan CastilloBL31_SOURCES += ${SPD_SOURCES} 5738f0617efSJuan Castillo$(if ${BL31}, $(eval $(call MAKE_TOOL_ARGS,31,${BL31},soc-fw)),\ 5748f0617efSJuan Castillo $(eval $(call MAKE_BL,31,soc-fw))) 57573c99d4eSJuan Castilloendif 57673c99d4eSJuan Castillo 57770d1fc53SJuan Castillo# If a BL32 image is needed but neither BL32 nor BL32_SOURCES is defined, the 57870d1fc53SJuan Castillo# build system will call FIP_ADD_IMG to print a warning message and abort the 57970d1fc53SJuan Castillo# process. Note that the dependency on BL32 applies to the FIP only. 58073c99d4eSJuan Castilloifeq (${NEED_BL32},yes) 5818f0617efSJuan Castillo$(if ${BL32}, $(eval $(call MAKE_TOOL_ARGS,32,${BL32},tos-fw)),\ 5828f0617efSJuan Castillo $(if ${BL32_SOURCES}, $(eval $(call MAKE_BL,32,tos-fw)),\ 5838f0617efSJuan Castillo $(eval $(call FIP_ADD_IMG,BL32,--tos-fw)))) 58473c99d4eSJuan Castilloendif 58573c99d4eSJuan Castillo 58673c99d4eSJuan Castillo# Add the BL33 image if required by the platform 58773c99d4eSJuan Castilloifeq (${NEED_BL33},yes) 5888f0617efSJuan Castillo$(eval $(call FIP_ADD_IMG,BL33,--nt-fw)) 589db6071c9SJuan Castilloendif 590db6071c9SJuan Castillo 5919003fa0bSYatharth Kocharifeq (${NEED_BL2U},yes) 5929003fa0bSYatharth KocharBL2U_PATH := $(if ${BL2U},${BL2U},$(call IMG_BIN,2u)) 5939003fa0bSYatharth Kochar$(if ${BL2U}, ,$(eval $(call MAKE_BL,2u))) 5948f0617efSJuan Castillo$(eval $(call FWU_FIP_ADD_PAYLOAD,${BL2U_PATH},--ap-fwu-cfg)) 5959003fa0bSYatharth Kocharendif 5969003fa0bSYatharth Kochar 59736eaaf37SIan Spraylocate-checkpatch: 59836eaaf37SIan Sprayifndef CHECKPATCH 59936eaaf37SIan Spray $(error "Please set CHECKPATCH to point to the Linux checkpatch.pl file, eg: CHECKPATCH=../linux/script/checkpatch.pl") 60036eaaf37SIan Sprayelse 60136eaaf37SIan Sprayifeq (,$(wildcard ${CHECKPATCH})) 60236eaaf37SIan Spray $(error "The file CHECKPATCH points to cannot be found, use eg: CHECKPATCH=../linux/script/checkpatch.pl") 60336eaaf37SIan Sprayendif 60436eaaf37SIan Sprayendif 60536eaaf37SIan Spray 6064f6ad66aSAchin Guptaclean: 6074f6ad66aSAchin Gupta @echo " CLEAN" 608f1477d4aSEvan Lloyd $(call SHELL_REMOVE_DIR,${BUILD_PLAT}) 6092f2cef46SJeenu Viswambharan ${Q}${MAKE} --no-print-directory -C ${FIPTOOLPATH} clean 6106f971622SJuan Castillo ${Q}${MAKE} PLAT=${PLAT} --no-print-directory -C ${CRTTOOLPATH} clean 6114f6ad66aSAchin Gupta 612eaaeece2SJames Morrisseyrealclean distclean: 613eaaeece2SJames Morrissey @echo " REALCLEAN" 614f1477d4aSEvan Lloyd $(call SHELL_REMOVE_DIR,${BUILD_BASE}) 615f1477d4aSEvan Lloyd $(call SHELL_DELETE_ALL, ${CURDIR}/cscope.*) 6162f2cef46SJeenu Viswambharan ${Q}${MAKE} --no-print-directory -C ${FIPTOOLPATH} clean 6176f971622SJuan Castillo ${Q}${MAKE} PLAT=${PLAT} --no-print-directory -C ${CRTTOOLPATH} clean 6184f6ad66aSAchin Gupta 61936eaaf37SIan Spraycheckcodebase: locate-checkpatch 62036eaaf37SIan Spray @echo " CHECKING STYLE" 62136eaaf37SIan Spray @if test -d .git ; then \ 6221a41e8c1SDan Handley git ls-files | grep -E -v libfdt\|stdlib\|docs\|\.md | \ 6231a41e8c1SDan Handley while read GIT_FILE ; \ 6241a41e8c1SDan Handley do ${CHECKPATCH} ${CHECKCODE_ARGS} -f $$GIT_FILE ; \ 6251a41e8c1SDan Handley done ; \ 62636eaaf37SIan Spray else \ 6271a41e8c1SDan Handley find . -type f -not -iwholename "*.git*" \ 6281a41e8c1SDan Handley -not -iwholename "*build*" \ 6291a41e8c1SDan Handley -not -iwholename "*libfdt*" \ 6301a41e8c1SDan Handley -not -iwholename "*stdlib*" \ 6311a41e8c1SDan Handley -not -iwholename "*docs*" \ 6321a41e8c1SDan Handley -not -iwholename "*.md" \ 6331a41e8c1SDan Handley -exec ${CHECKPATCH} ${CHECKCODE_ARGS} -f {} \; ; \ 63436eaaf37SIan Spray fi 63536eaaf37SIan Spray 63636eaaf37SIan Spraycheckpatch: locate-checkpatch 63736eaaf37SIan Spray @echo " CHECKING STYLE" 638f607739cSSandrine Bailleux ${Q}git log -p ${BASE_COMMIT}..HEAD -- ${CHECK_PATHS} | ${CHECKPATCH} - || true 63936eaaf37SIan Spray 64073c99d4eSJuan Castillocerttool: ${CRTTOOL} 64173c99d4eSJuan Castillo 6426f971622SJuan Castillo.PHONY: ${CRTTOOL} 6436f971622SJuan Castillo${CRTTOOL}: 6446f971622SJuan Castillo ${Q}${MAKE} PLAT=${PLAT} --no-print-directory -C ${CRTTOOLPATH} 645f1477d4aSEvan Lloyd @${ECHO_BLANK_LINE} 6466f971622SJuan Castillo @echo "Built $@ successfully" 647f1477d4aSEvan Lloyd @${ECHO_BLANK_LINE} 6486f971622SJuan Castillo 6496f971622SJuan Castilloifneq (${GENERATE_COT},0) 65073c99d4eSJuan Castillocertificates: ${CRT_DEPS} ${CRTTOOL} 6516f971622SJuan Castillo ${Q}${CRTTOOL} ${CRT_ARGS} 652f1477d4aSEvan Lloyd @${ECHO_BLANK_LINE} 6536f971622SJuan Castillo @echo "Built $@ successfully" 6546f971622SJuan Castillo @echo "Certificates can be found in ${BUILD_PLAT}" 655f1477d4aSEvan Lloyd @${ECHO_BLANK_LINE} 65673c99d4eSJuan Castilloendif 65727713fb4SSoby Mathew 65873c99d4eSJuan Castillo${BUILD_PLAT}/${FIP_NAME}: ${FIP_DEPS} ${FIPTOOL} 659819281eeSdp-arm ${Q}${FIPTOOL} create ${FIP_ARGS} $@ 660819281eeSdp-arm ${Q}${FIPTOOL} info $@ 661f1477d4aSEvan Lloyd @${ECHO_BLANK_LINE} 6622f2cef46SJeenu Viswambharan @echo "Built $@ successfully" 663f1477d4aSEvan Lloyd @${ECHO_BLANK_LINE} 664f58ad36fSHarry Liebel 6650191262dSYatharth Kocharifneq (${GENERATE_COT},0) 6660191262dSYatharth Kocharfwu_certificates: ${FWU_CRT_DEPS} ${CRTTOOL} 6670191262dSYatharth Kochar ${Q}${CRTTOOL} ${FWU_CRT_ARGS} 6680191262dSYatharth Kochar @echo 6690191262dSYatharth Kochar @echo "Built $@ successfully" 6700191262dSYatharth Kochar @echo "FWU certificates can be found in ${BUILD_PLAT}" 6710191262dSYatharth Kochar @echo 6720191262dSYatharth Kocharendif 6730191262dSYatharth Kochar 6740191262dSYatharth Kochar${BUILD_PLAT}/${FWU_FIP_NAME}: ${FWU_FIP_DEPS} ${FIPTOOL} 675819281eeSdp-arm ${Q}${FIPTOOL} create ${FWU_FIP_ARGS} $@ 676819281eeSdp-arm ${Q}${FIPTOOL} info $@ 6770191262dSYatharth Kochar @echo 6780191262dSYatharth Kochar @echo "Built $@ successfully" 6790191262dSYatharth Kochar @echo 6800191262dSYatharth Kochar 68173c99d4eSJuan Castillofiptool: ${FIPTOOL} 68273c99d4eSJuan Castillofip: ${BUILD_PLAT}/${FIP_NAME} 6830191262dSYatharth Kocharfwu_fip: ${BUILD_PLAT}/${FWU_FIP_NAME} 68473c99d4eSJuan Castillo 68573c99d4eSJuan Castillo.PHONY: ${FIPTOOL} 68673c99d4eSJuan Castillo${FIPTOOL}: 687819281eeSdp-arm ${Q}${MAKE} CPPFLAGS="-DVERSION='\"${VERSION_STRING}\"'" --no-print-directory -C ${FIPTOOLPATH} 688f58ad36fSHarry Liebel 68935fab8c9SJoakim Bechcscope: 69035fab8c9SJoakim Bech @echo " CSCOPE" 69135fab8c9SJoakim Bech ${Q}find ${CURDIR} -name "*.[chsS]" > cscope.files 69235fab8c9SJoakim Bech ${Q}cscope -b -q -k 69335fab8c9SJoakim Bech 69472ee3314SRyan Harkinhelp: 695231c1470SEvan Lloyd @echo "usage: ${MAKE} PLAT=<${PLATFORM_LIST}> [OPTIONS] [TARGET]" 69672ee3314SRyan Harkin @echo "" 69772ee3314SRyan Harkin @echo "PLAT is used to specify which platform you wish to build." 69808c7ed0fSSandrine Bailleux @echo "If no platform is specified, PLAT defaults to: ${DEFAULT_PLAT}" 69972ee3314SRyan Harkin @echo "" 7001b578596SSandrine Bailleux @echo "Please refer to the User Guide for a list of all supported options." 7011b578596SSandrine Bailleux @echo "Note that the build system doesn't track dependencies for build " 7021b578596SSandrine Bailleux @echo "options. Therefore, if any of the build options are changed " 7031b578596SSandrine Bailleux @echo "from a previous build, a clean build must be performed." 7041b578596SSandrine Bailleux @echo "" 70572ee3314SRyan Harkin @echo "Supported Targets:" 7061b578596SSandrine Bailleux @echo " all Build all individual bootloader binaries" 70736eaaf37SIan Spray @echo " bl1 Build the BL1 binary" 7088aa559c0SJeenu Viswambharan @echo " bl2 Build the BL2 binary" 7099003fa0bSYatharth Kochar @echo " bl2u Build the BL2U binary" 710d178637dSJuan Castillo @echo " bl31 Build the BL31 binary" 711*9d29c227SSoby Mathew @echo " bl32 Build the BL32 binary. If ARCH=aarch32, then " 712*9d29c227SSoby Mathew @echo " this builds secure payload specified by AARCH32_SP" 71373c99d4eSJuan Castillo @echo " certificates Build the certificates (requires 'GENERATE_COT=1')" 7141b578596SSandrine Bailleux @echo " fip Build the Firmware Image Package (FIP)" 7150191262dSYatharth Kochar @echo " fwu_fip Build the FWU Firmware Image Package (FIP)" 71636eaaf37SIan Spray @echo " checkcodebase Check the coding style of the entire source tree" 71736eaaf37SIan Spray @echo " checkpatch Check the coding style on changes in the current" 71836eaaf37SIan Spray @echo " branch against BASE_COMMIT (default origin/master)" 71972ee3314SRyan Harkin @echo " clean Clean the build for the selected platform" 72035fab8c9SJoakim Bech @echo " cscope Generate cscope index" 72172ee3314SRyan Harkin @echo " distclean Remove all build artifacts for all platforms" 7226f971622SJuan Castillo @echo " certtool Build the Certificate generation tool" 723f58ad36fSHarry Liebel @echo " fiptool Build the Firmware Image Package(FIP) creation tool" 72472ee3314SRyan Harkin @echo "" 7251b578596SSandrine Bailleux @echo "Note: most build targets require PLAT to be set to a specific platform." 72672ee3314SRyan Harkin @echo "" 72772ee3314SRyan Harkin @echo "example: build all targets for the FVP platform:" 72872ee3314SRyan Harkin @echo " CROSS_COMPILE=aarch64-none-elf- make PLAT=fvp all" 729