| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
VERSION_MAJOR := 2 |
| 11 |
VERSION_MINOR := 12 |
| 12 |
|
| 13 |
VERSION_PATCH := 1 |
| 14 |
VERSION := ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH} |
| 15 |
|
| 16 |
|
| 17 |
.DEFAULT_GOAL := all |
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
MAKEOVERRIDES = |
| 23 |
|
| 24 |
MAKE_HELPERS_DIRECTORY := make_helpers/ |
| 25 |
include ${MAKE_HELPERS_DIRECTORY}build_macros.mk |
| 26 |
include ${MAKE_HELPERS_DIRECTORY}build_env.mk |
| 27 |
include ${MAKE_HELPERS_DIRECTORY}build-rules.mk |
| 28 |
include ${MAKE_HELPERS_DIRECTORY}common.mk |
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
include ${MAKE_HELPERS_DIRECTORY}defaults.mk |
| 35 |
PLAT := ${DEFAULT_PLAT} |
| 36 |
include ${MAKE_HELPERS_DIRECTORY}plat_helpers.mk |
| 37 |
|
| 38 |
|
| 39 |
ifneq ($(PLAT_DEFAULTS_MAKEFILE_FULL),) |
| 40 |
include ${PLAT_DEFAULTS_MAKEFILE_FULL} |
| 41 |
endif |
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
include ${MAKE_HELPERS_DIRECTORY}toolchain.mk |
| 48 |
|
| 49 |
|
| 50 |
ENABLE_ASSERTIONS := ${DEBUG} |
| 51 |
ENABLE_PMF := ${ENABLE_RUNTIME_INSTRUMENTATION} |
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
CHECKCODE_ARGS := --no-patch |
| 58 |
|
| 59 |
INC_DRV_DIRS_TO_CHECK := $(sort $(filter-out \ |
| 60 |
include/drivers/arm, \ |
| 61 |
$(wildcard include/drivers/*))) |
| 62 |
INC_LIB_DIRS_TO_CHECK := $(sort $(filter-out \ |
| 63 |
include/lib/libfdt \ |
| 64 |
include/lib/libc, \ |
| 65 |
$(wildcard include/lib/*))) |
| 66 |
INC_DIRS_TO_CHECK := $(sort $(filter-out \ |
| 67 |
include/lib \ |
| 68 |
include/drivers, \ |
| 69 |
$(wildcard include/*))) |
| 70 |
LIB_DIRS_TO_CHECK := $(sort $(filter-out \ |
| 71 |
lib/compiler-rt \ |
| 72 |
lib/libfdt% \ |
| 73 |
lib/libc, \ |
| 74 |
lib/zlib \ |
| 75 |
$(wildcard lib/*))) |
| 76 |
ROOT_DIRS_TO_CHECK := $(sort $(filter-out \ |
| 77 |
lib \ |
| 78 |
include \ |
| 79 |
docs \ |
| 80 |
%.rst, \ |
| 81 |
$(wildcard *))) |
| 82 |
CHECK_PATHS := ${ROOT_DIRS_TO_CHECK} \ |
| 83 |
${INC_DIRS_TO_CHECK} \ |
| 84 |
${INC_LIB_DIRS_TO_CHECK} \ |
| 85 |
${LIB_DIRS_TO_CHECK} \ |
| 86 |
${INC_DRV_DIRS_TO_CHECK} \ |
| 87 |
${INC_ARM_DIRS_TO_CHECK} |
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
ifeq ($(verbose),) |
| 94 |
CHECKCODE_ARGS += --no-summary --terse |
| 95 |
endif |
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
CRTTOOLPATH ?= tools/cert_create |
| 103 |
CRTTOOL ?= ${CRTTOOLPATH}/cert_create${BIN_EXT} |
| 104 |
|
| 105 |
|
| 106 |
ENCTOOLPATH ?= tools/encrypt_fw |
| 107 |
ENCTOOL ?= ${ENCTOOLPATH}/encrypt_fw${BIN_EXT} |
| 108 |
|
| 109 |
|
| 110 |
FIPTOOLPATH ?= tools/fiptool |
| 111 |
FIPTOOL ?= ${FIPTOOLPATH}/fiptool${BIN_EXT} |
| 112 |
|
| 113 |
|
| 114 |
SPTOOLPATH ?= tools/sptool |
| 115 |
SPTOOL ?= ${SPTOOLPATH}/sptool.py |
| 116 |
SP_MK_GEN ?= ${SPTOOLPATH}/sp_mk_generator.py |
| 117 |
SP_DTS_LIST_FRAGMENT ?= ${BUILD_PLAT}/sp_list_fragment.dts |
| 118 |
|
| 119 |
|
| 120 |
ROMLIBPATH ?= lib/romlib |
| 121 |
|
| 122 |
|
| 123 |
PYTHON ?= python3 |
| 124 |
|
| 125 |
|
| 126 |
DOCS_PATH ?= docs |
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
|
| 131 |
ifeq (${ARM_ARCH_MAJOR},7) |
| 132 |
target32-directive = -target arm-none-eabi |
| 133 |
|
| 134 |
else |
| 135 |
target32-directive = -target armv8a-none-eabi |
| 136 |
endif |
| 137 |
|
| 138 |
|
| 139 |
|
| 140 |
|
| 141 |
arch-features = ${ARM_ARCH_FEATURE} |
| 142 |
|
| 143 |
ifneq ($(filter %-clang,$($(ARCH)-cc-id)),) |
| 144 |
ifeq ($($(ARCH)-cc-id),arm-clang) |
| 145 |
TF_CFLAGS_aarch32 := -target arm-arm-none-eabi |
| 146 |
TF_CFLAGS_aarch64 := -target aarch64-arm-none-eabi |
| 147 |
else |
| 148 |
TF_CFLAGS_aarch32 = $(target32-directive) |
| 149 |
TF_CFLAGS_aarch64 := -target aarch64-elf |
| 150 |
endif |
| 151 |
|
| 152 |
else ifeq ($($(ARCH)-cc-id),gnu-gcc) |
| 153 |
# Enable LTO only for aarch64 |
| 154 |
ifeq (${ARCH},aarch64) |
| 155 |
LTO_CFLAGS = $(if $(filter-out 0,$(ENABLE_LTO)),-flto) |
| 156 |
endif |
| 157 |
endif |
| 158 |
|
| 159 |
|
| 160 |
$(eval $(call add_define,DEBUG)) |
| 161 |
ifneq (${DEBUG}, 0) |
| 162 |
BUILD_TYPE := debug |
| 163 |
TF_CFLAGS += -g -gdwarf-4 |
| 164 |
ASFLAGS += -g -Wa,-gdwarf-4 |
| 165 |
|
| 166 |
# Use LOG_LEVEL_INFO by default for debug builds |
| 167 |
LOG_LEVEL := 40 |
| 168 |
else |
| 169 |
BUILD_TYPE := release |
| 170 |
# Use LOG_LEVEL_NOTICE by default for release builds |
| 171 |
LOG_LEVEL := 20 |
| 172 |
endif |
| 173 |
|
| 174 |
|
| 175 |
ifeq (${BUILD_STRING},) |
| 176 |
BUILD_STRING := $(shell git describe --always --dirty --tags 2> /dev/null) |
| 177 |
endif |
| 178 |
VERSION_STRING := v${VERSION}(${BUILD_TYPE}):${BUILD_STRING} |
| 179 |
|
| 180 |
ifeq (${AARCH32_INSTRUCTION_SET},A32) |
| 181 |
TF_CFLAGS_aarch32 += -marm |
| 182 |
else ifeq (${AARCH32_INSTRUCTION_SET},T32) |
| 183 |
TF_CFLAGS_aarch32 += -mthumb |
| 184 |
else |
| 185 |
$(error Error: Unknown AArch32 instruction set ${AARCH32_INSTRUCTION_SET}) |
| 186 |
endif |
| 187 |
|
| 188 |
TF_CFLAGS_aarch32 += -mno-unaligned-access |
| 189 |
TF_CFLAGS_aarch64 += -mgeneral-regs-only -mstrict-align |
| 190 |
|
| 191 |
|
| 192 |
|
| 193 |
|
| 194 |
|
| 195 |
WARNINGS := -Wall -Wmissing-include-dirs -Wunused \ |
| 196 |
-Wdisabled-optimization -Wvla -Wshadow \ |
| 197 |
-Wredundant-decls |
| 198 |
|
| 199 |
WARNINGS += -Wextra -Wno-trigraphs |
| 200 |
|
| 201 |
WARNINGS += -Wno-missing-field-initializers \ |
| 202 |
-Wno-type-limits -Wno-sign-compare \ |
| 203 |
# on clang this flag gets reset if -Wextra is set after it. No difference on gcc |
| 204 |
WARNINGS += -Wno-unused-parameter |
| 205 |
|
| 206 |
|
| 207 |
|
| 208 |
|
| 209 |
WARNING1 += -Wsign-compare |
| 210 |
WARNING1 += -Wtype-limits |
| 211 |
WARNING1 += -Wmissing-field-initializers |
| 212 |
|
| 213 |
|
| 214 |
|
| 215 |
|
| 216 |
WARNING2 += -Wold-style-definition |
| 217 |
WARNING2 += -Wmissing-prototypes |
| 218 |
WARNING2 += -Wmissing-format-attribute |
| 219 |
|
| 220 |
WARNING2 += -Wundef |
| 221 |
|
| 222 |
WARNING2 += -Wunused-const-variable=2 |
| 223 |
|
| 224 |
|
| 225 |
WARNING3 := -Wbad-function-cast |
| 226 |
WARNING3 += -Waggregate-return |
| 227 |
WARNING3 += -Wnested-externs |
| 228 |
WARNING3 += -Wcast-align |
| 229 |
WARNING3 += -Wcast-qual |
| 230 |
WARNING3 += -Wconversion |
| 231 |
WARNING3 += -Wpacked |
| 232 |
WARNING3 += -Wpointer-arith |
| 233 |
WARNING3 += -Wswitch-default |
| 234 |
|
| 235 |
|
| 236 |
|
| 237 |
|
| 238 |
ifdef W |
| 239 |
ifneq (${W},0) |
| 240 |
E ?= 0 |
| 241 |
endif |
| 242 |
endif |
| 243 |
|
| 244 |
ifeq (${W},1) |
| 245 |
WARNINGS += $(WARNING1) |
| 246 |
else ifeq (${W},2) |
| 247 |
WARNINGS += $(WARNING1) $(WARNING2) |
| 248 |
else ifeq (${W},3) |
| 249 |
WARNINGS += $(WARNING1) $(WARNING2) $(WARNING3) |
| 250 |
endif |
| 251 |
|
| 252 |
|
| 253 |
ifeq ($(filter %-clang,$($(ARCH)-cc-id)),) |
| 254 |
|
| 255 |
WARNINGS += -Wunused-but-set-variable -Wmaybe-uninitialized \ |
| 256 |
-Wpacked-bitfield-compat -Wshift-overflow=2 \ |
| 257 |
-Wlogical-op |
| 258 |
|
| 259 |
|
| 260 |
TF_CFLAGS_MIN_PAGE_SIZE := $(call cc_option, --param=min-pagesize=0) |
| 261 |
TF_CFLAGS += $(TF_CFLAGS_MIN_PAGE_SIZE) |
| 262 |
|
| 263 |
ifeq ($(HARDEN_SLS), 1) |
| 264 |
TF_CFLAGS_MHARDEN_SLS := $(call cc_option, -mharden-sls=all) |
| 265 |
TF_CFLAGS_aarch64 += $(TF_CFLAGS_MHARDEN_SLS) |
| 266 |
endif |
| 267 |
|
| 268 |
else |
| 269 |
|
| 270 |
WARNINGS += -Wshift-overflow -Wshift-sign-overflow \ |
| 271 |
-Wlogical-op-parentheses |
| 272 |
endif |
| 273 |
|
| 274 |
ifneq (${E},0) |
| 275 |
ERRORS := -Werror |
| 276 |
endif |
| 277 |
|
| 278 |
|
| 279 |
|
| 280 |
|
| 281 |
CPPFLAGS = ${DEFINES} ${INCLUDES} ${MBEDTLS_INC} -nostdinc \ |
| 282 |
$(ERRORS) $(WARNINGS) |
| 283 |
ASFLAGS += $(CPPFLAGS) \ |
| 284 |
-ffreestanding -Wa,--fatal-warnings |
| 285 |
TF_CFLAGS += $(CPPFLAGS) $(TF_CFLAGS_$(ARCH)) \ |
| 286 |
-ffunction-sections -fdata-sections \ |
| 287 |
-ffreestanding -fno-builtin -fno-common \ |
| 288 |
-Os -std=gnu99 |
| 289 |
|
| 290 |
ifeq (${SANITIZE_UB},on) |
| 291 |
TF_CFLAGS += -fsanitize=undefined -fno-sanitize-recover |
| 292 |
endif |
| 293 |
|
| 294 |
ifeq (${SANITIZE_UB},trap) |
| 295 |
TF_CFLAGS += -fsanitize=undefined -fno-sanitize-recover \ |
| 296 |
-fsanitize-undefined-trap-on-error |
| 297 |
endif |
| 298 |
|
| 299 |
GCC_V_OUTPUT := $(if $($(ARCH)-cc),$(shell $($(ARCH)-cc) -v 2>&1)) |
| 300 |
|
| 301 |
TF_LDFLAGS += -z noexecstack |
| 302 |
|
| 303 |
|
| 304 |
ifeq ($($(ARCH)-ld-id),arm-link) |
| 305 |
TF_LDFLAGS += --diag_error=warning --lto_level=O1 |
| 306 |
TF_LDFLAGS += --remove --info=unused,unusedsymbols |
| 307 |
TF_LDFLAGS += $(TF_LDFLAGS_$(ARCH)) |
| 308 |
|
| 309 |
|
| 310 |
else ifeq ($($(ARCH)-ld-id),gnu-gcc) |
| 311 |
# Pass ld options with Wl or Xlinker switches |
| 312 |
TF_LDFLAGS += $(call ld_option,-Xlinker --no-warn-rwx-segments) |
| 313 |
TF_LDFLAGS += -Wl,--fatal-warnings -O1 |
| 314 |
TF_LDFLAGS += -Wl,--gc-sections |
| 315 |
|
| 316 |
TF_LDFLAGS += -Wl,-z,common-page-size=4096 #Configure page size constants |
| 317 |
TF_LDFLAGS += -Wl,-z,max-page-size=4096 |
| 318 |
TF_LDFLAGS += -Wl,--build-id=none |
| 319 |
|
| 320 |
ifeq ($(ENABLE_LTO),1) |
| 321 |
ifeq (${ARCH},aarch64) |
| 322 |
TF_LDFLAGS += -flto -fuse-linker-plugin |
| 323 |
TF_LDFLAGS += -flto-partition=one |
| 324 |
endif |
| 325 |
endif #(ENABLE_LTO) |
| 326 |
|
| 327 |
|
| 328 |
|
| 329 |
ifeq (${ARCH},aarch64) |
| 330 |
ifneq (${ERRATA_A53_843419},1) |
| 331 |
TF_LDFLAGS += -mno-fix-cortex-a53-843419 |
| 332 |
endif |
| 333 |
endif |
| 334 |
TF_LDFLAGS += -nostdlib |
| 335 |
TF_LDFLAGS += $(subst --,-Xlinker --,$(TF_LDFLAGS_$(ARCH))) |
| 336 |
|
| 337 |
|
| 338 |
else |
| 339 |
|
| 340 |
|
| 341 |
TF_LDFLAGS += $(call ld_option, --no-warn-rwx-segments) |
| 342 |
TF_LDFLAGS += -O1 |
| 343 |
TF_LDFLAGS += --gc-sections |
| 344 |
|
| 345 |
TF_LDFLAGS += -z common-page-size=4096 # Configure page size constants |
| 346 |
TF_LDFLAGS += -z max-page-size=4096 |
| 347 |
TF_LDFLAGS += --build-id=none |
| 348 |
|
| 349 |
|
| 350 |
|
| 351 |
|
| 352 |
|
| 353 |
ifneq ($($(ARCH)-ld-id),llvm-lld) |
| 354 |
TF_LDFLAGS += $(TF_LDFLAGS_$(ARCH)) --fatal-warnings |
| 355 |
endif |
| 356 |
|
| 357 |
endif |
| 358 |
|
| 359 |
|
| 360 |
|
| 361 |
|
| 362 |
ifeq (${ENABLE_RME},1) |
| 363 |
ARM_ARCH_MAJOR := 9 |
| 364 |
ARM_ARCH_MINOR := 2 |
| 365 |
endif |
| 366 |
|
| 367 |
|
| 368 |
|
| 369 |
|
| 370 |
include lib/compiler-rt/compiler-rt.mk |
| 371 |
|
| 372 |
|
| 373 |
|
| 374 |
|
| 375 |
BUILD_MESSAGE_TIMESTAMP ?= __TIME__", "__DATE__ |
| 376 |
|
| 377 |
DEFINES += -DBUILD_MESSAGE_TIMESTAMP='$(BUILD_MESSAGE_TIMESTAMP)' |
| 378 |
DEFINES += -DBUILD_MESSAGE_VERSION_STRING='"$(VERSION_STRING)"' |
| 379 |
DEFINES += -DBUILD_MESSAGE_VERSION='"$(VERSION)"' |
| 380 |
|
| 381 |
BL_COMMON_SOURCES += common/bl_common.c \ |
| 382 |
common/tf_log.c \ |
| 383 |
common/${ARCH}/debug.S \ |
| 384 |
drivers/console/multi_console.c \ |
| 385 |
lib/${ARCH}/cache_helpers.S \ |
| 386 |
lib/${ARCH}/misc_helpers.S \ |
| 387 |
lib/extensions/pmuv3/${ARCH}/pmuv3.c \ |
| 388 |
plat/common/plat_bl_common.c \ |
| 389 |
plat/common/plat_log_common.c \ |
| 390 |
plat/common/${ARCH}/plat_common.c \ |
| 391 |
plat/common/${ARCH}/platform_helpers.S \ |
| 392 |
${COMPILER_RT_SRCS} |
| 393 |
|
| 394 |
ifeq ($($(ARCH)-cc-id),arm-clang) |
| 395 |
BL_COMMON_SOURCES += lib/${ARCH}/armclang_printf.S |
| 396 |
endif |
| 397 |
|
| 398 |
ifeq (${SANITIZE_UB},on) |
| 399 |
BL_COMMON_SOURCES += plat/common/ubsan.c |
| 400 |
endif |
| 401 |
|
| 402 |
INCLUDES += -Iinclude \ |
| 403 |
-Iinclude/arch/${ARCH} \ |
| 404 |
-Iinclude/lib/cpus/${ARCH} \ |
| 405 |
-Iinclude/lib/el3_runtime/${ARCH} \ |
| 406 |
${PLAT_INCLUDES} \ |
| 407 |
${SPD_INCLUDES} |
| 408 |
|
| 409 |
DTC_FLAGS += -I dts -O dtb |
| 410 |
DTC_CPPFLAGS += -P -nostdinc $(INCLUDES) -Ifdts -undef \ |
| 411 |
-x assembler-with-cpp $(DEFINES) |
| 412 |
|
| 413 |
include common/backtrace/backtrace.mk |
| 414 |
|
| 415 |
|
| 416 |
|
| 417 |
|
| 418 |
|
| 419 |
ifeq (${BUILD_BASE},) |
| 420 |
BUILD_BASE := ./build |
| 421 |
endif |
| 422 |
BUILD_PLAT := $(abspath ${BUILD_BASE})/${PLAT}/${BUILD_TYPE} |
| 423 |
|
| 424 |
SPDS := $(sort $(filter-out none, $(patsubst services/spd/%,%,$(wildcard services/spd/*)))) |
| 425 |
|
| 426 |
|
| 427 |
INCLUDE_TBBR_MK := 1 |
| 428 |
|
| 429 |
|
| 430 |
|
| 431 |
|
| 432 |
|
| 433 |
ifneq (${SPD},none) |
| 434 |
ifeq (${ARCH},aarch32) |
| 435 |
$(error "Error: SPD is incompatible with AArch32.") |
| 436 |
endif |
| 437 |
|
| 438 |
ifdef EL3_PAYLOAD_BASE |
| 439 |
$(warning "SPD and EL3_PAYLOAD_BASE are incompatible build options.") |
| 440 |
$(warning "The SPD and its BL32 companion will be present but \ |
| 441 |
ignored.") |
| 442 |
endif |
| 443 |
|
| 444 |
ifeq (${SPD},spmd) |
| 445 |
# SPMD is located in std_svc directory |
| 446 |
SPD_DIR := std_svc |
| 447 |
|
| 448 |
ifeq ($(SPMD_SPM_AT_SEL2),1) |
| 449 |
CTX_INCLUDE_EL2_REGS := 1 |
| 450 |
ifeq ($(SPMC_AT_EL3),1) |
| 451 |
$(error SPM cannot be enabled in both S-EL2 and EL3.) |
| 452 |
endif |
| 453 |
ifeq ($(CTX_INCLUDE_SVE_REGS),1) |
| 454 |
$(error SVE context management not needed with Hafnium SPMC.) |
| 455 |
endif |
| 456 |
endif |
| 457 |
|
| 458 |
ifeq ($(findstring optee_sp,$(ARM_SPMC_MANIFEST_DTS)),optee_sp) |
| 459 |
DTC_CPPFLAGS += -DOPTEE_SP_FW_CONFIG |
| 460 |
endif |
| 461 |
|
| 462 |
ifeq ($(findstring trusty_sp,$(ARM_SPMC_MANIFEST_DTS)),trusty_sp) |
| 463 |
DTC_CPPFLAGS += -DTRUSTY_SP_FW_CONFIG |
| 464 |
endif |
| 465 |
|
| 466 |
ifeq ($(TS_SP_FW_CONFIG),1) |
| 467 |
DTC_CPPFLAGS += -DTS_SP_FW_CONFIG |
| 468 |
endif |
| 469 |
|
| 470 |
ifneq ($(ARM_BL2_SP_LIST_DTS),) |
| 471 |
DTC_CPPFLAGS += -DARM_BL2_SP_LIST_DTS=$(ARM_BL2_SP_LIST_DTS) |
| 472 |
endif |
| 473 |
|
| 474 |
ifneq ($(SP_LAYOUT_FILE),) |
| 475 |
BL2_ENABLE_SP_LOAD := 1 |
| 476 |
endif |
| 477 |
|
| 478 |
ifeq ($(SPMC_AT_EL3_SEL0_SP),1) |
| 479 |
ifneq ($(SPMC_AT_EL3),1) |
| 480 |
$(error SEL0 SP cannot be enabled without SPMC at EL3) |
| 481 |
endif |
| 482 |
endif |
| 483 |
else |
| 484 |
# All other SPDs in spd directory |
| 485 |
SPD_DIR := spd |
| 486 |
endif #(SPD) |
| 487 |
|
| 488 |
# We expect to locate an spd.mk under the specified SPD directory |
| 489 |
SPD_MAKE := $(wildcard services/${SPD_DIR}/${SPD}/${SPD}.mk) |
| 490 |
|
| 491 |
ifeq (${SPD_MAKE},) |
| 492 |
$(error Error: No services/${SPD_DIR}/${SPD}/${SPD}.mk located) |
| 493 |
endif |
| 494 |
$(info Including ${SPD_MAKE}) |
| 495 |
include ${SPD_MAKE} |
| 496 |
|
| 497 |
# If there's BL32 companion for the chosen SPD, we expect that the SPD's |
| 498 |
# Makefile would set NEED_BL32 to "yes". In this case, the build system |
| 499 |
# supports two mutually exclusive options: |
| 500 |
# * BL32 is built from source: then BL32_SOURCES must contain the list |
| 501 |
# of source files to build BL32 |
| 502 |
# * BL32 is a prebuilt binary: then BL32 must point to the image file |
| 503 |
# that will be included in the FIP |
| 504 |
# If both BL32_SOURCES and BL32 are defined, the binary takes precedence |
| 505 |
# over the sources. |
| 506 |
endif |
| 507 |
|
| 508 |
ifeq (${ENABLE_SPMD_LP}, 1) |
| 509 |
ifneq (${SPD},spmd) |
| 510 |
$(error Error: ENABLE_SPMD_LP requires SPD=spmd.) |
| 511 |
endif |
| 512 |
ifeq ($(SPMC_AT_EL3),1) |
| 513 |
$(error SPMC at EL3 not supported when enabling SPMD Logical partitions.) |
| 514 |
endif |
| 515 |
endif |
| 516 |
|
| 517 |
|
| 518 |
|
| 519 |
|
| 520 |
|
| 521 |
ifeq (${BRANCH_PROTECTION},0) |
| 522 |
# Default value turns off all types of branch protection |
| 523 |
BP_OPTION := none |
| 524 |
else ifneq (${ARCH},aarch64) |
| 525 |
$(error BRANCH_PROTECTION requires AArch64) |
| 526 |
else ifeq (${BRANCH_PROTECTION},1) |
| 527 |
# Enables all types of branch protection features |
| 528 |
BP_OPTION := standard |
| 529 |
ENABLE_BTI := 1 |
| 530 |
ENABLE_PAUTH := 1 |
| 531 |
else ifeq (${BRANCH_PROTECTION},2) |
| 532 |
# Return address signing to its standard level |
| 533 |
BP_OPTION := pac-ret |
| 534 |
ENABLE_PAUTH := 1 |
| 535 |
else ifeq (${BRANCH_PROTECTION},3) |
| 536 |
# Extend the signing to include leaf functions |
| 537 |
BP_OPTION := pac-ret+leaf |
| 538 |
ENABLE_PAUTH := 1 |
| 539 |
else ifeq (${BRANCH_PROTECTION},4) |
| 540 |
# Turn on branch target identification mechanism |
| 541 |
BP_OPTION := bti |
| 542 |
ENABLE_BTI := 1 |
| 543 |
else |
| 544 |
$(error Unknown BRANCH_PROTECTION value ${BRANCH_PROTECTION}) |
| 545 |
endif |
| 546 |
|
| 547 |
ifeq ($(ENABLE_PAUTH),1) |
| 548 |
CTX_INCLUDE_PAUTH_REGS := 1 |
| 549 |
endif |
| 550 |
ifneq (${BP_OPTION},none) |
| 551 |
TF_CFLAGS_aarch64 += -mbranch-protection=${BP_OPTION} |
| 552 |
endif |
| 553 |
|
| 554 |
|
| 555 |
ifeq (${ENABLE_PAUTH}, 1) |
| 556 |
|
| 557 |
|
| 558 |
BL_COMMON_SOURCES += lib/extensions/pauth/pauth_helpers.S |
| 559 |
endif |
| 560 |
|
| 561 |
|
| 562 |
|
| 563 |
|
| 564 |
|
| 565 |
include ${PLAT_MAKEFILE_FULL} |
| 566 |
|
| 567 |
|
| 568 |
|
| 569 |
|
| 570 |
|
| 571 |
include ${MAKE_HELPERS_DIRECTORY}arch_features.mk |
| 572 |
|
| 573 |
|
| 574 |
|
| 575 |
|
| 576 |
|
| 577 |
|
| 578 |
ifeq (${SUPPORT_STACK_MEMTAG},yes) |
| 579 |
ifdef mem_tag_arch_support |
| 580 |
|
| 581 |
ifneq ($(filter %-clang,$($(ARCH)-cc-id)),) |
| 582 |
|
| 583 |
ifeq ( ,$(findstring memtag,$(arch-features))) |
| 584 |
arch-features := $(arch-features)+memtag |
| 585 |
endif |
| 586 |
ifeq ($($(ARCH)-cc-id),arm-clang) |
| 587 |
TF_CFLAGS += -mmemtag-stack |
| 588 |
else ifeq ($($(ARCH)-cc-id),llvm-clang) |
| 589 |
TF_CFLAGS += -fsanitize=memtag |
| 590 |
endif |
| 591 |
endif |
| 592 |
else |
| 593 |
$(error "Error: stack memory tagging is not supported for \ |
| 594 |
architecture ${ARCH},armv${ARM_ARCH_MAJOR}.${ARM_ARCH_MINOR}-a") |
| 595 |
endif #(mem_tag_arch_support) |
| 596 |
endif |
| 597 |
|
| 598 |
|
| 599 |
|
| 600 |
|
| 601 |
|
| 602 |
ifeq (${ENABLE_RME},1) |
| 603 |
# RME doesn't support PIE |
| 604 |
ifneq (${ENABLE_PIE},0) |
| 605 |
$(error ENABLE_RME does not support PIE) |
| 606 |
endif |
| 607 |
|
| 608 |
# RME requires AARCH64 |
| 609 |
ifneq (${ARCH},aarch64) |
| 610 |
$(error ENABLE_RME requires AArch64) |
| 611 |
endif |
| 612 |
|
| 613 |
# RME requires el2 context to be saved for now. |
| 614 |
CTX_INCLUDE_EL2_REGS := 1 |
| 615 |
CTX_INCLUDE_AARCH32_REGS := 0 |
| 616 |
CTX_INCLUDE_PAUTH_REGS := 1 |
| 617 |
|
| 618 |
# RME enables CSV2_2 extension by default. |
| 619 |
ENABLE_FEAT_CSV2_2 = 1 |
| 620 |
endif |
| 621 |
|
| 622 |
|
| 623 |
|
| 624 |
|
| 625 |
ifneq (${ENABLE_RME},0) |
| 626 |
ifneq (${ARCH},aarch64) |
| 627 |
$(error ENABLE_RME requires AArch64) |
| 628 |
endif |
| 629 |
ifeq ($(SPMC_AT_EL3),1) |
| 630 |
$(error SPMC_AT_EL3 and ENABLE_RME cannot both be enabled.) |
| 631 |
endif |
| 632 |
|
| 633 |
ifneq (${SPD}, none) |
| 634 |
ifneq (${SPD}, spmd) |
| 635 |
$(error ENABLE_RME is incompatible with SPD=${SPD}. Use SPD=spmd) |
| 636 |
endif |
| 637 |
endif |
| 638 |
include services/std_svc/rmmd/rmmd.mk |
| 639 |
$(warning "RME is an experimental feature") |
| 640 |
endif |
| 641 |
|
| 642 |
ifeq (${CTX_INCLUDE_EL2_REGS}, 1) |
| 643 |
ifeq (${SPD},none) |
| 644 |
ifeq (${ENABLE_RME},0) |
| 645 |
$(error CTX_INCLUDE_EL2_REGS is available only when SPD \ |
| 646 |
or RME is enabled) |
| 647 |
endif |
| 648 |
endif |
| 649 |
endif |
| 650 |
|
| 651 |
|
| 652 |
|
| 653 |
|
| 654 |
ifneq (${ENABLE_FEAT_D128}, 0) |
| 655 |
BL_COMMON_SOURCES += lib/extensions/sysreg128/sysreg128.S |
| 656 |
endif |
| 657 |
|
| 658 |
|
| 659 |
|
| 660 |
|
| 661 |
|
| 662 |
include ${MAKE_HELPERS_DIRECTORY}march.mk |
| 663 |
|
| 664 |
TF_CFLAGS += $(march-directive) |
| 665 |
ASFLAGS += $(march-directive) |
| 666 |
|
| 667 |
|
| 668 |
|
| 669 |
|
| 670 |
|
| 671 |
|
| 672 |
ifeq (${RESET_TO_BL2},1) |
| 673 |
BL2_RUNS_AT_EL3 := 1 |
| 674 |
ifeq (${ENABLE_RME},1) |
| 675 |
$(error RESET_TO_BL2=1 and ENABLE_RME=1 configuration is not \ |
| 676 |
supported at the moment.) |
| 677 |
endif |
| 678 |
else ifeq (${ENABLE_RME},1) |
| 679 |
BL2_RUNS_AT_EL3 := 1 |
| 680 |
else |
| 681 |
BL2_RUNS_AT_EL3 := 0 |
| 682 |
endif |
| 683 |
|
| 684 |
|
| 685 |
|
| 686 |
ifeq ($(HANDLE_EA_EL3_FIRST_NS),1) |
| 687 |
FFH_SUPPORT := 1 |
| 688 |
else |
| 689 |
FFH_SUPPORT := 0 |
| 690 |
endif |
| 691 |
|
| 692 |
ifeq (${ARM_ARCH_MAJOR},7) |
| 693 |
include make_helpers/armv7-a-cpus.mk |
| 694 |
endif |
| 695 |
|
| 696 |
PIE_FOUND := $(findstring --enable-default-pie,${GCC_V_OUTPUT}) |
| 697 |
ifneq ($(PIE_FOUND),) |
| 698 |
TF_CFLAGS += -fno-PIE |
| 699 |
ifeq ($($(ARCH)-ld-id),gnu-gcc) |
| 700 |
TF_LDFLAGS += -no-pie |
| 701 |
endif |
| 702 |
endif |
| 703 |
|
| 704 |
ifeq ($($(ARCH)-ld-id),gnu-gcc) |
| 705 |
PIE_LDFLAGS += -Wl,-pie -Wl,--no-dynamic-linker |
| 706 |
else |
| 707 |
PIE_LDFLAGS += -pie --no-dynamic-linker |
| 708 |
endif |
| 709 |
|
| 710 |
ifeq ($(ENABLE_PIE),1) |
| 711 |
ifeq ($(RESET_TO_BL2),1) |
| 712 |
ifneq ($(BL2_IN_XIP_MEM),1) |
| 713 |
BL2_CPPFLAGS += -fpie |
| 714 |
BL2_CFLAGS += -fpie |
| 715 |
BL2_LDFLAGS += $(PIE_LDFLAGS) |
| 716 |
endif #(BL2_IN_XIP_MEM) |
| 717 |
endif #(RESET_TO_BL2) |
| 718 |
BL31_CPPFLAGS += -fpie |
| 719 |
BL31_CFLAGS += -fpie |
| 720 |
BL31_LDFLAGS += $(PIE_LDFLAGS) |
| 721 |
|
| 722 |
BL32_CPPFLAGS += -fpie |
| 723 |
BL32_CFLAGS += -fpie |
| 724 |
BL32_LDFLAGS += $(PIE_LDFLAGS) |
| 725 |
endif |
| 726 |
|
| 727 |
BL1_CPPFLAGS += -DREPORT_ERRATA=${DEBUG} |
| 728 |
BL31_CPPFLAGS += -DREPORT_ERRATA=${DEBUG} |
| 729 |
BL32_CPPFLAGS += -DREPORT_ERRATA=${DEBUG} |
| 730 |
|
| 731 |
BL1_CPPFLAGS += -DIMAGE_AT_EL3 |
| 732 |
ifeq ($(RESET_TO_BL2),1) |
| 733 |
BL2_CPPFLAGS += -DIMAGE_AT_EL3 |
| 734 |
else |
| 735 |
BL2_CPPFLAGS += -DIMAGE_AT_EL1 |
| 736 |
endif |
| 737 |
|
| 738 |
ifeq (${ARCH},aarch64) |
| 739 |
BL2U_CPPFLAGS += -DIMAGE_AT_EL1 |
| 740 |
BL31_CPPFLAGS += -DIMAGE_AT_EL3 |
| 741 |
BL32_CPPFLAGS += -DIMAGE_AT_EL1 |
| 742 |
else |
| 743 |
BL32_CPPFLAGS += -DIMAGE_AT_EL3 |
| 744 |
endif |
| 745 |
|
| 746 |
|
| 747 |
|
| 748 |
|
| 749 |
include lib/cpus/cpu-ops.mk |
| 750 |
|
| 751 |
|
| 752 |
|
| 753 |
|
| 754 |
ifeq (${ARCH},aarch32) |
| 755 |
NEED_BL32 := yes |
| 756 |
|
| 757 |
ifneq (${AARCH32_SP},none) |
| 758 |
|
| 759 |
AARCH32_SP_MAKE := $(wildcard bl32/${AARCH32_SP}/${AARCH32_SP}.mk) |
| 760 |
|
| 761 |
ifeq (${AARCH32_SP_MAKE},) |
| 762 |
$(error Error: No bl32/${AARCH32_SP}/${AARCH32_SP}.mk located) |
| 763 |
endif |
| 764 |
$(info Including ${AARCH32_SP_MAKE}) |
| 765 |
include ${AARCH32_SP_MAKE} |
| 766 |
endif |
| 767 |
endif |
| 768 |
|
| 769 |
|
| 770 |
|
| 771 |
|
| 772 |
ifeq (${OVERRIDE_LIBC},0) |
| 773 |
include lib/libc/libc.mk |
| 774 |
endif |
| 775 |
|
| 776 |
|
| 777 |
|
| 778 |
|
| 779 |
|
| 780 |
|
| 781 |
ifeq (${USE_DEBUGFS},1) |
| 782 |
ifeq (${DEBUG},1) |
| 783 |
$(warning DEBUGFS experimental feature is enabled.) |
| 784 |
else |
| 785 |
$(warning DEBUGFS experimental, recommended in DEBUG builds ONLY) |
| 786 |
endif |
| 787 |
endif |
| 788 |
|
| 789 |
|
| 790 |
ifeq (${USE_SPINLOCK_CAS},1) |
| 791 |
ifneq (${ARCH},aarch64) |
| 792 |
$(error USE_SPINLOCK_CAS requires AArch64) |
| 793 |
endif |
| 794 |
endif |
| 795 |
|
| 796 |
|
| 797 |
|
| 798 |
ifneq (${GENERATE_COT},0) |
| 799 |
FIP_DEPS += certificates |
| 800 |
FWU_FIP_DEPS += fwu_certificates |
| 801 |
endif |
| 802 |
|
| 803 |
ifneq (${DECRYPTION_SUPPORT},none) |
| 804 |
ENC_ARGS += -f ${FW_ENC_STATUS} |
| 805 |
ENC_ARGS += -k ${ENC_KEY} |
| 806 |
ENC_ARGS += -n ${ENC_NONCE} |
| 807 |
FIP_DEPS += enctool |
| 808 |
FWU_FIP_DEPS += enctool |
| 809 |
endif |
| 810 |
|
| 811 |
ifdef EL3_PAYLOAD_BASE |
| 812 |
ifdef PRELOADED_BL33_BASE |
| 813 |
$(warning "PRELOADED_BL33_BASE and EL3_PAYLOAD_BASE are \ |
| 814 |
incompatible build options. EL3_PAYLOAD_BASE has priority.") |
| 815 |
endif |
| 816 |
ifneq (${GENERATE_COT},0) |
| 817 |
$(error "GENERATE_COT and EL3_PAYLOAD_BASE are incompatible \ |
| 818 |
build options.") |
| 819 |
endif |
| 820 |
ifneq (${TRUSTED_BOARD_BOOT},0) |
| 821 |
$(error "TRUSTED_BOARD_BOOT and EL3_PAYLOAD_BASE are \ |
| 822 |
incompatible \ build options.") |
| 823 |
endif |
| 824 |
endif |
| 825 |
|
| 826 |
ifeq (${NEED_BL33},yes) |
| 827 |
ifdef EL3_PAYLOAD_BASE |
| 828 |
$(warning "BL33 image is not needed when option \ |
| 829 |
BL33_PAYLOAD_BASE is used and won't be added to the FIP file.") |
| 830 |
endif |
| 831 |
ifdef PRELOADED_BL33_BASE |
| 832 |
$(warning "BL33 image is not needed when option \ |
| 833 |
PRELOADED_BL33_BASE is used and won't be added to the FIP file.") |
| 834 |
endif |
| 835 |
endif |
| 836 |
|
| 837 |
|
| 838 |
|
| 839 |
ifeq ($(HW_ASSISTED_COHERENCY)-$(USE_COHERENT_MEM),1-1) |
| 840 |
$(error USE_COHERENT_MEM cannot be enabled with HW_ASSISTED_COHERENCY) |
| 841 |
endif |
| 842 |
|
| 843 |
|
| 844 |
ifeq ($(RESET_TO_BL2)-$(BL2_IN_XIP_MEM),0-1) |
| 845 |
$(error "BL2_IN_XIP_MEM is only supported when RESET_TO_BL2 is enabled") |
| 846 |
endif |
| 847 |
|
| 848 |
|
| 849 |
ifeq ($(RAS_EXTENSION),1) |
| 850 |
$(error "RAS_EXTENSION is now deprecated, please use ENABLE_FEAT_RAS \ |
| 851 |
and HANDLE_EA_EL3_FIRST_NS instead") |
| 852 |
endif |
| 853 |
|
| 854 |
|
| 855 |
|
| 856 |
ifeq ($(FAULT_INJECTION_SUPPORT),1) |
| 857 |
ifeq ($(ENABLE_FEAT_RAS),0) |
| 858 |
$(error For FAULT_INJECTION_SUPPORT, ENABLE_FEAT_RAS must not be 0) |
| 859 |
endif |
| 860 |
endif |
| 861 |
|
| 862 |
|
| 863 |
ifeq ($(DYN_DISABLE_AUTH), 1) |
| 864 |
ifeq (${TRUSTED_BOARD_BOOT}, 0) |
| 865 |
$(error "TRUSTED_BOARD_BOOT must be enabled for DYN_DISABLE_AUTH \ |
| 866 |
to be set.") |
| 867 |
endif |
| 868 |
endif |
| 869 |
|
| 870 |
ifeq ($(MEASURED_BOOT)-$(TRUSTED_BOARD_BOOT),1-1) |
| 871 |
|
| 872 |
CRYPTO_SUPPORT := 3 |
| 873 |
else ifeq ($(DRTM_SUPPORT)-$(TRUSTED_BOARD_BOOT),1-1) |
| 874 |
|
| 875 |
CRYPTO_SUPPORT := 3 |
| 876 |
else ifneq ($(filter 1,${MEASURED_BOOT} ${DRTM_SUPPORT}),) |
| 877 |
|
| 878 |
CRYPTO_SUPPORT := 2 |
| 879 |
else ifeq (${TRUSTED_BOARD_BOOT},1) |
| 880 |
|
| 881 |
CRYPTO_SUPPORT := 1 |
| 882 |
else |
| 883 |
CRYPTO_SUPPORT := 0 |
| 884 |
endif |
| 885 |
|
| 886 |
|
| 887 |
ifeq ($(SDEI_SUPPORT)-$(SDEI_IN_FCONF),0-1) |
| 888 |
$(error "SDEI_IN_FCONF is only supported when SDEI_SUPPORT is enabled") |
| 889 |
endif |
| 890 |
|
| 891 |
|
| 892 |
|
| 893 |
|
| 894 |
ifeq ($(ENABLE_PAUTH),1) |
| 895 |
ifeq ($(CTX_INCLUDE_PAUTH_REGS),0) |
| 896 |
$(error Pointer Authentication requires CTX_INCLUDE_PAUTH_REGS=1) |
| 897 |
endif |
| 898 |
endif |
| 899 |
|
| 900 |
ifeq ($(CTX_INCLUDE_PAUTH_REGS),1) |
| 901 |
ifneq (${ARCH},aarch64) |
| 902 |
$(error CTX_INCLUDE_PAUTH_REGS requires AArch64) |
| 903 |
endif |
| 904 |
endif |
| 905 |
|
| 906 |
ifeq ($(FEATURE_DETECTION),1) |
| 907 |
$(info FEATURE_DETECTION is an experimental feature) |
| 908 |
endif |
| 909 |
|
| 910 |
ifneq ($(ENABLE_SME2_FOR_NS), 0) |
| 911 |
ifeq (${ENABLE_SME_FOR_NS}, 0) |
| 912 |
$(warning "ENABLE_SME2_FOR_NS requires ENABLE_SME_FOR_NS also \ |
| 913 |
to be set") |
| 914 |
$(warning "Forced ENABLE_SME_FOR_NS=1") |
| 915 |
override ENABLE_SME_FOR_NS := 1 |
| 916 |
endif |
| 917 |
endif |
| 918 |
|
| 919 |
ifeq (${ARM_XLAT_TABLES_LIB_V1}, 1) |
| 920 |
ifeq (${ALLOW_RO_XLAT_TABLES}, 1) |
| 921 |
$(error "ALLOW_RO_XLAT_TABLES requires translation tables \ |
| 922 |
library v2") |
| 923 |
endif |
| 924 |
endif |
| 925 |
|
| 926 |
ifneq (${DECRYPTION_SUPPORT},none) |
| 927 |
ifeq (${TRUSTED_BOARD_BOOT}, 0) |
| 928 |
$(error TRUSTED_BOARD_BOOT must be enabled for DECRYPTION_SUPPORT \ |
| 929 |
to be set) |
| 930 |
endif |
| 931 |
endif |
| 932 |
|
| 933 |
|
| 934 |
ifeq (${ARCH},aarch32) |
| 935 |
|
| 936 |
# SME/SVE only supported on AArch64 |
| 937 |
ifneq (${ENABLE_SME_FOR_NS},0) |
| 938 |
$(error "ENABLE_SME_FOR_NS cannot be used with ARCH=aarch32") |
| 939 |
endif |
| 940 |
|
| 941 |
ifeq (${ENABLE_SVE_FOR_NS},1) |
| 942 |
# Warning instead of error due to CI dependency on this |
| 943 |
$(error "ENABLE_SVE_FOR_NS cannot be used with ARCH=aarch32") |
| 944 |
endif |
| 945 |
|
| 946 |
# BRBE is not supported in AArch32 |
| 947 |
ifeq (${ENABLE_BRBE_FOR_NS},1) |
| 948 |
$(error "ENABLE_BRBE_FOR_NS cannot be used with ARCH=aarch32") |
| 949 |
endif |
| 950 |
|
| 951 |
# FEAT_RNG_TRAP is not supported in AArch32 |
| 952 |
ifeq (${ENABLE_FEAT_RNG_TRAP},1) |
| 953 |
$(error "ENABLE_FEAT_RNG_TRAP cannot be used with ARCH=aarch32") |
| 954 |
endif |
| 955 |
endif |
| 956 |
|
| 957 |
ifneq (${ENABLE_SME_FOR_NS},0) |
| 958 |
ifeq (${ENABLE_SVE_FOR_NS},0) |
| 959 |
$(error "ENABLE_SME_FOR_NS requires ENABLE_SVE_FOR_NS") |
| 960 |
endif |
| 961 |
endif |
| 962 |
|
| 963 |
|
| 964 |
ifeq (${ENABLE_SME_FOR_SWD},1) |
| 965 |
ifeq (${ENABLE_SME_FOR_NS},0) |
| 966 |
$(error "ENABLE_SME_FOR_SWD requires ENABLE_SME_FOR_NS") |
| 967 |
endif |
| 968 |
ifeq (${ENABLE_SVE_FOR_SWD},0) |
| 969 |
$(error "ENABLE_SME_FOR_SWD requires ENABLE_SVE_FOR_SWD") |
| 970 |
endif |
| 971 |
endif |
| 972 |
|
| 973 |
|
| 974 |
|
| 975 |
ifeq (${ENABLE_SVE_FOR_SWD},1) |
| 976 |
ifeq (${ENABLE_SVE_FOR_NS},0) |
| 977 |
$(error "ENABLE_SVE_FOR_SWD requires ENABLE_SVE_FOR_NS") |
| 978 |
endif |
| 979 |
endif |
| 980 |
|
| 981 |
|
| 982 |
|
| 983 |
ifeq (${ENABLE_SVE_FOR_SWD}, 1) |
| 984 |
ifneq (${ENABLE_SVE_FOR_NS}, 0) |
| 985 |
ifeq (${CTX_INCLUDE_SVE_REGS}-$(SPMD_SPM_AT_SEL2),0-0) |
| 986 |
$(warning "ENABLE_SVE_FOR_SWD and ENABLE_SVE_FOR_NS together require CTX_INCLUDE_SVE_REGS") |
| 987 |
endif |
| 988 |
endif |
| 989 |
endif |
| 990 |
|
| 991 |
|
| 992 |
|
| 993 |
|
| 994 |
ifeq (${CTX_INCLUDE_FPREGS}, 1) |
| 995 |
ifneq (${ENABLE_SVE_FOR_NS},0) |
| 996 |
ifeq (${CTX_INCLUDE_SVE_REGS},0) |
| 997 |
# Warning instead of error due to CI dependency on this |
| 998 |
$(warning "CTX_INCLUDE_FPREGS and ENABLE_SVE_FOR_NS together require CTX_INCLUDE_SVE_REGS") |
| 999 |
$(warning "Forced ENABLE_SVE_FOR_NS=0") |
| 1000 |
override ENABLE_SVE_FOR_NS := 0 |
| 1001 |
endif |
| 1002 |
endif |
| 1003 |
endif |
| 1004 |
|
| 1005 |
|
| 1006 |
|
| 1007 |
ifeq (${CTX_INCLUDE_SVE_REGS},1) |
| 1008 |
ifeq (${ENABLE_SVE_FOR_SWD},0) |
| 1009 |
$(error "CTX_INCLUDE_SVE_REGS requires ENABLE_SVE_FOR_SWD to also be enabled") |
| 1010 |
endif |
| 1011 |
endif |
| 1012 |
|
| 1013 |
|
| 1014 |
|
| 1015 |
ifeq (${CTX_INCLUDE_FPREGS},1) |
| 1016 |
ifneq (${ENABLE_SME_FOR_NS},0) |
| 1017 |
$(error "ENABLE_SME_FOR_NS cannot be used with CTX_INCLUDE_FPREGS") |
| 1018 |
endif |
| 1019 |
endif |
| 1020 |
|
| 1021 |
ifeq ($(DRTM_SUPPORT),1) |
| 1022 |
$(info DRTM_SUPPORT is an experimental feature) |
| 1023 |
endif |
| 1024 |
|
| 1025 |
ifeq (${TRANSFER_LIST},1) |
| 1026 |
$(info TRANSFER_LIST is an experimental feature) |
| 1027 |
endif |
| 1028 |
|
| 1029 |
ifeq (${ENABLE_RME},1) |
| 1030 |
ifneq (${SEPARATE_CODE_AND_RODATA},1) |
| 1031 |
$(error `ENABLE_RME=1` requires `SEPARATE_CODE_AND_RODATA=1`) |
| 1032 |
endif |
| 1033 |
endif |
| 1034 |
|
| 1035 |
ifeq ($(PSA_CRYPTO),1) |
| 1036 |
$(info PSA_CRYPTO is an experimental feature) |
| 1037 |
endif |
| 1038 |
|
| 1039 |
ifeq ($(DICE_PROTECTION_ENVIRONMENT),1) |
| 1040 |
$(info DICE_PROTECTION_ENVIRONMENT is an experimental feature) |
| 1041 |
endif |
| 1042 |
|
| 1043 |
|
| 1044 |
|
| 1045 |
|
| 1046 |
|
| 1047 |
ifdef BL1_SOURCES |
| 1048 |
NEED_BL1 := yes |
| 1049 |
endif |
| 1050 |
|
| 1051 |
ifdef BL2_SOURCES |
| 1052 |
NEED_BL2 := yes |
| 1053 |
|
| 1054 |
# Using BL2 implies that a BL33 image also needs to be supplied for the FIP and |
| 1055 |
# Certificate generation tools. This flag can be overridden by the platform. |
| 1056 |
ifdef EL3_PAYLOAD_BASE |
| 1057 |
# If booting an EL3 payload there is no need for a BL33 image |
| 1058 |
# in the FIP file. |
| 1059 |
NEED_BL33 := no |
| 1060 |
else |
| 1061 |
ifdef PRELOADED_BL33_BASE |
| 1062 |
# If booting a BL33 preloaded image there is no need of |
| 1063 |
# another one in the FIP file. |
| 1064 |
NEED_BL33 := no |
| 1065 |
else |
| 1066 |
NEED_BL33 ?= yes |
| 1067 |
endif |
| 1068 |
endif |
| 1069 |
endif |
| 1070 |
|
| 1071 |
ifdef BL2U_SOURCES |
| 1072 |
NEED_BL2U := yes |
| 1073 |
endif |
| 1074 |
|
| 1075 |
|
| 1076 |
ifdef SCP_BL2 |
| 1077 |
NEED_SCP_BL2 := yes |
| 1078 |
endif |
| 1079 |
|
| 1080 |
|
| 1081 |
ifneq (${ARCH},aarch32) |
| 1082 |
ifdef BL31_SOURCES |
| 1083 |
# When booting an EL3 payload, there is no need to compile the BL31 |
| 1084 |
# image nor put it in the FIP. |
| 1085 |
ifndef EL3_PAYLOAD_BASE |
| 1086 |
NEED_BL31 := yes |
| 1087 |
endif |
| 1088 |
endif |
| 1089 |
endif |
| 1090 |
|
| 1091 |
|
| 1092 |
ifneq (${GENERATE_COT},0) |
| 1093 |
# Common cert_create options |
| 1094 |
ifneq (${CREATE_KEYS},0) |
| 1095 |
$(eval CRT_ARGS += -n) |
| 1096 |
$(eval FWU_CRT_ARGS += -n) |
| 1097 |
ifneq (${SAVE_KEYS},0) |
| 1098 |
$(eval CRT_ARGS += -k) |
| 1099 |
$(eval FWU_CRT_ARGS += -k) |
| 1100 |
endif |
| 1101 |
endif |
| 1102 |
# Include TBBR makefile (unless the platform indicates otherwise) |
| 1103 |
ifeq (${INCLUDE_TBBR_MK},1) |
| 1104 |
include make_helpers/tbbr/tbbr_tools.mk |
| 1105 |
endif |
| 1106 |
endif |
| 1107 |
|
| 1108 |
ifneq (${FIP_ALIGN},0) |
| 1109 |
FIP_ARGS += --align ${FIP_ALIGN} |
| 1110 |
endif |
| 1111 |
|
| 1112 |
ifdef FDT_SOURCES |
| 1113 |
NEED_FDT := yes |
| 1114 |
endif |
| 1115 |
|
| 1116 |
|
| 1117 |
|
| 1118 |
|
| 1119 |
|
| 1120 |
include lib/stack_protector/stack_protector.mk |
| 1121 |
|
| 1122 |
|
| 1123 |
|
| 1124 |
|
| 1125 |
|
| 1126 |
ifeq (${NEED_BL1},yes) |
| 1127 |
include bl1/bl1.mk |
| 1128 |
endif |
| 1129 |
|
| 1130 |
ifeq (${NEED_BL2},yes) |
| 1131 |
include bl2/bl2.mk |
| 1132 |
endif |
| 1133 |
|
| 1134 |
ifeq (${NEED_BL2U},yes) |
| 1135 |
include bl2u/bl2u.mk |
| 1136 |
endif |
| 1137 |
|
| 1138 |
ifeq (${NEED_BL31},yes) |
| 1139 |
include bl31/bl31.mk |
| 1140 |
endif |
| 1141 |
|
| 1142 |
|
| 1143 |
|
| 1144 |
|
| 1145 |
|
| 1146 |
|
| 1147 |
$(eval $(call assert_booleans,\ |
| 1148 |
$(sort \ |
| 1149 |
ALLOW_RO_XLAT_TABLES \ |
| 1150 |
BL2_ENABLE_SP_LOAD \ |
| 1151 |
COLD_BOOT_SINGLE_CPU \ |
| 1152 |
CREATE_KEYS \ |
| 1153 |
CTX_INCLUDE_AARCH32_REGS \ |
| 1154 |
CTX_INCLUDE_FPREGS \ |
| 1155 |
CTX_INCLUDE_SVE_REGS \ |
| 1156 |
CTX_INCLUDE_EL2_REGS \ |
| 1157 |
CTX_INCLUDE_MPAM_REGS \ |
| 1158 |
DEBUG \ |
| 1159 |
DYN_DISABLE_AUTH \ |
| 1160 |
EL3_EXCEPTION_HANDLING \ |
| 1161 |
ENABLE_AMU_AUXILIARY_COUNTERS \ |
| 1162 |
ENABLE_AMU_FCONF \ |
| 1163 |
AMU_RESTRICT_COUNTERS \ |
| 1164 |
ENABLE_ASSERTIONS \ |
| 1165 |
ENABLE_PIE \ |
| 1166 |
ENABLE_PMF \ |
| 1167 |
ENABLE_PSCI_STAT \ |
| 1168 |
ENABLE_RUNTIME_INSTRUMENTATION \ |
| 1169 |
ENABLE_SME_FOR_SWD \ |
| 1170 |
ENABLE_SVE_FOR_SWD \ |
| 1171 |
ENABLE_FEAT_RAS \ |
| 1172 |
FFH_SUPPORT \ |
| 1173 |
ERROR_DEPRECATED \ |
| 1174 |
FAULT_INJECTION_SUPPORT \ |
| 1175 |
GENERATE_COT \ |
| 1176 |
GICV2_G0_FOR_EL3 \ |
| 1177 |
HANDLE_EA_EL3_FIRST_NS \ |
| 1178 |
HARDEN_SLS \ |
| 1179 |
HW_ASSISTED_COHERENCY \ |
| 1180 |
MEASURED_BOOT \ |
| 1181 |
DICE_PROTECTION_ENVIRONMENT \ |
| 1182 |
RMMD_ENABLE_EL3_TOKEN_SIGN \ |
| 1183 |
DRTM_SUPPORT \ |
| 1184 |
NS_TIMER_SWITCH \ |
| 1185 |
OVERRIDE_LIBC \ |
| 1186 |
PL011_GENERIC_UART \ |
| 1187 |
PROGRAMMABLE_RESET_ADDRESS \ |
| 1188 |
PSCI_EXTENDED_STATE_ID \ |
| 1189 |
PSCI_OS_INIT_MODE \ |
| 1190 |
RESET_TO_BL31 \ |
| 1191 |
SAVE_KEYS \ |
| 1192 |
SEPARATE_CODE_AND_RODATA \ |
| 1193 |
SEPARATE_BL2_NOLOAD_REGION \ |
| 1194 |
SEPARATE_NOBITS_REGION \ |
| 1195 |
SEPARATE_RWDATA_REGION \ |
| 1196 |
SEPARATE_SIMD_SECTION \ |
| 1197 |
SPIN_ON_BL1_EXIT \ |
| 1198 |
SPM_MM \ |
| 1199 |
SPMC_AT_EL3 \ |
| 1200 |
SPMC_AT_EL3_SEL0_SP \ |
| 1201 |
SPMD_SPM_AT_SEL2 \ |
| 1202 |
ENABLE_SPMD_LP \ |
| 1203 |
TRANSFER_LIST \ |
| 1204 |
TRUSTED_BOARD_BOOT \ |
| 1205 |
USE_COHERENT_MEM \ |
| 1206 |
USE_DEBUGFS \ |
| 1207 |
ARM_IO_IN_DTB \ |
| 1208 |
SDEI_IN_FCONF \ |
| 1209 |
SEC_INT_DESC_IN_FCONF \ |
| 1210 |
USE_ROMLIB \ |
| 1211 |
USE_TBBR_DEFS \ |
| 1212 |
WARMBOOT_ENABLE_DCACHE_EARLY \ |
| 1213 |
RESET_TO_BL2 \ |
| 1214 |
BL2_IN_XIP_MEM \ |
| 1215 |
BL2_INV_DCACHE \ |
| 1216 |
USE_SPINLOCK_CAS \ |
| 1217 |
ENCRYPT_BL31 \ |
| 1218 |
ENCRYPT_BL32 \ |
| 1219 |
ERRATA_SPECULATIVE_AT \ |
| 1220 |
RAS_TRAP_NS_ERR_REC_ACCESS \ |
| 1221 |
COT_DESC_IN_DTB \ |
| 1222 |
USE_SP804_TIMER \ |
| 1223 |
PSA_FWU_SUPPORT \ |
| 1224 |
PSA_FWU_METADATA_FW_STORE_DESC \ |
| 1225 |
ENABLE_MPMM \ |
| 1226 |
ENABLE_MPMM_FCONF \ |
| 1227 |
FEATURE_DETECTION \ |
| 1228 |
TRNG_SUPPORT \ |
| 1229 |
ERRATA_ABI_SUPPORT \ |
| 1230 |
ERRATA_NON_ARM_INTERCONNECT \ |
| 1231 |
CONDITIONAL_CMO \ |
| 1232 |
PSA_CRYPTO \ |
| 1233 |
ENABLE_CONSOLE_GETC \ |
| 1234 |
INIT_UNUSED_NS_EL2 \ |
| 1235 |
PLATFORM_REPORT_CTX_MEM_USE \ |
| 1236 |
EARLY_CONSOLE \ |
| 1237 |
PRESERVE_DSU_PMU_REGS \ |
| 1238 |
))) |
| 1239 |
|
| 1240 |
|
| 1241 |
$(eval $(call assert_numerics,\ |
| 1242 |
$(sort \ |
| 1243 |
ARM_ARCH_MAJOR \ |
| 1244 |
ARM_ARCH_MINOR \ |
| 1245 |
BRANCH_PROTECTION \ |
| 1246 |
CTX_INCLUDE_PAUTH_REGS \ |
| 1247 |
CTX_INCLUDE_NEVE_REGS \ |
| 1248 |
CRYPTO_SUPPORT \ |
| 1249 |
DISABLE_MTPMU \ |
| 1250 |
ENABLE_BRBE_FOR_NS \ |
| 1251 |
ENABLE_TRBE_FOR_NS \ |
| 1252 |
ENABLE_BTI \ |
| 1253 |
ENABLE_PAUTH \ |
| 1254 |
ENABLE_FEAT_AMU \ |
| 1255 |
ENABLE_FEAT_AMUv1p1 \ |
| 1256 |
ENABLE_FEAT_CSV2_2 \ |
| 1257 |
ENABLE_FEAT_CSV2_3 \ |
| 1258 |
ENABLE_FEAT_DEBUGV8P9 \ |
| 1259 |
ENABLE_FEAT_DIT \ |
| 1260 |
ENABLE_FEAT_ECV \ |
| 1261 |
ENABLE_FEAT_FGT \ |
| 1262 |
ENABLE_FEAT_FGT2 \ |
| 1263 |
ENABLE_FEAT_HCX \ |
| 1264 |
ENABLE_FEAT_LS64_ACCDATA \ |
| 1265 |
ENABLE_FEAT_MTE2 \ |
| 1266 |
ENABLE_FEAT_PAN \ |
| 1267 |
ENABLE_FEAT_RNG \ |
| 1268 |
ENABLE_FEAT_RNG_TRAP \ |
| 1269 |
ENABLE_FEAT_SEL2 \ |
| 1270 |
ENABLE_FEAT_TCR2 \ |
| 1271 |
ENABLE_FEAT_THE \ |
| 1272 |
ENABLE_FEAT_SB \ |
| 1273 |
ENABLE_FEAT_S2PIE \ |
| 1274 |
ENABLE_FEAT_S1PIE \ |
| 1275 |
ENABLE_FEAT_S2POE \ |
| 1276 |
ENABLE_FEAT_S1POE \ |
| 1277 |
ENABLE_FEAT_SCTLR2 \ |
| 1278 |
ENABLE_FEAT_D128 \ |
| 1279 |
ENABLE_FEAT_GCS \ |
| 1280 |
ENABLE_FEAT_VHE \ |
| 1281 |
ENABLE_FEAT_MPAM \ |
| 1282 |
ENABLE_RME \ |
| 1283 |
ENABLE_SPE_FOR_NS \ |
| 1284 |
ENABLE_SYS_REG_TRACE_FOR_NS \ |
| 1285 |
ENABLE_SME_FOR_NS \ |
| 1286 |
ENABLE_SME2_FOR_NS \ |
| 1287 |
ENABLE_SVE_FOR_NS \ |
| 1288 |
ENABLE_TRF_FOR_NS \ |
| 1289 |
FW_ENC_STATUS \ |
| 1290 |
NR_OF_FW_BANKS \ |
| 1291 |
NR_OF_IMAGES_IN_FW_BANK \ |
| 1292 |
TWED_DELAY \ |
| 1293 |
ENABLE_FEAT_TWED \ |
| 1294 |
SVE_VECTOR_LEN \ |
| 1295 |
IMPDEF_SYSREG_TRAP \ |
| 1296 |
))) |
| 1297 |
|
| 1298 |
ifdef KEY_SIZE |
| 1299 |
$(eval $(call assert_numeric,KEY_SIZE)) |
| 1300 |
endif |
| 1301 |
|
| 1302 |
ifeq ($(filter $(SANITIZE_UB), on off trap),) |
| 1303 |
$(error "Invalid value for SANITIZE_UB: can be one of on, off, trap") |
| 1304 |
endif |
| 1305 |
|
| 1306 |
|
| 1307 |
|
| 1308 |
|
| 1309 |
|
| 1310 |
|
| 1311 |
|
| 1312 |
$(eval $(call add_defines,\ |
| 1313 |
$(sort \ |
| 1314 |
ALLOW_RO_XLAT_TABLES \ |
| 1315 |
ARM_ARCH_MAJOR \ |
| 1316 |
ARM_ARCH_MINOR \ |
| 1317 |
BL2_ENABLE_SP_LOAD \ |
| 1318 |
COLD_BOOT_SINGLE_CPU \ |
| 1319 |
CTX_INCLUDE_AARCH32_REGS \ |
| 1320 |
CTX_INCLUDE_FPREGS \ |
| 1321 |
CTX_INCLUDE_SVE_REGS \ |
| 1322 |
CTX_INCLUDE_PAUTH_REGS \ |
| 1323 |
CTX_INCLUDE_MPAM_REGS \ |
| 1324 |
EL3_EXCEPTION_HANDLING \ |
| 1325 |
CTX_INCLUDE_EL2_REGS \ |
| 1326 |
CTX_INCLUDE_NEVE_REGS \ |
| 1327 |
DECRYPTION_SUPPORT_${DECRYPTION_SUPPORT} \ |
| 1328 |
DISABLE_MTPMU \ |
| 1329 |
ENABLE_FEAT_AMU \ |
| 1330 |
ENABLE_AMU_AUXILIARY_COUNTERS \ |
| 1331 |
ENABLE_AMU_FCONF \ |
| 1332 |
AMU_RESTRICT_COUNTERS \ |
| 1333 |
ENABLE_ASSERTIONS \ |
| 1334 |
ENABLE_BTI \ |
| 1335 |
ENABLE_FEAT_DEBUGV8P9 \ |
| 1336 |
ENABLE_FEAT_MPAM \ |
| 1337 |
ENABLE_PAUTH \ |
| 1338 |
ENABLE_PIE \ |
| 1339 |
ENABLE_PMF \ |
| 1340 |
ENABLE_PSCI_STAT \ |
| 1341 |
ENABLE_RME \ |
| 1342 |
RMMD_ENABLE_EL3_TOKEN_SIGN \ |
| 1343 |
ENABLE_RUNTIME_INSTRUMENTATION \ |
| 1344 |
ENABLE_SME_FOR_NS \ |
| 1345 |
ENABLE_SME2_FOR_NS \ |
| 1346 |
ENABLE_SME_FOR_SWD \ |
| 1347 |
ENABLE_SPE_FOR_NS \ |
| 1348 |
ENABLE_SVE_FOR_NS \ |
| 1349 |
ENABLE_SVE_FOR_SWD \ |
| 1350 |
ENABLE_FEAT_RAS \ |
| 1351 |
FFH_SUPPORT \ |
| 1352 |
ENCRYPT_BL31 \ |
| 1353 |
ENCRYPT_BL32 \ |
| 1354 |
ERROR_DEPRECATED \ |
| 1355 |
FAULT_INJECTION_SUPPORT \ |
| 1356 |
GICV2_G0_FOR_EL3 \ |
| 1357 |
HANDLE_EA_EL3_FIRST_NS \ |
| 1358 |
HW_ASSISTED_COHERENCY \ |
| 1359 |
LOG_LEVEL \ |
| 1360 |
MEASURED_BOOT \ |
| 1361 |
DICE_PROTECTION_ENVIRONMENT \ |
| 1362 |
DRTM_SUPPORT \ |
| 1363 |
NS_TIMER_SWITCH \ |
| 1364 |
PL011_GENERIC_UART \ |
| 1365 |
PLAT_${PLAT} \ |
| 1366 |
PROGRAMMABLE_RESET_ADDRESS \ |
| 1367 |
PSCI_EXTENDED_STATE_ID \ |
| 1368 |
PSCI_OS_INIT_MODE \ |
| 1369 |
RESET_TO_BL31 \ |
| 1370 |
RME_GPT_BITLOCK_BLOCK \ |
| 1371 |
RME_GPT_MAX_BLOCK \ |
| 1372 |
SEPARATE_CODE_AND_RODATA \ |
| 1373 |
SEPARATE_BL2_NOLOAD_REGION \ |
| 1374 |
SEPARATE_NOBITS_REGION \ |
| 1375 |
SEPARATE_RWDATA_REGION \ |
| 1376 |
SEPARATE_SIMD_SECTION \ |
| 1377 |
RECLAIM_INIT_CODE \ |
| 1378 |
SPD_${SPD} \ |
| 1379 |
SPIN_ON_BL1_EXIT \ |
| 1380 |
SPM_MM \ |
| 1381 |
SPMC_AT_EL3 \ |
| 1382 |
SPMC_AT_EL3_SEL0_SP \ |
| 1383 |
SPMD_SPM_AT_SEL2 \ |
| 1384 |
TRANSFER_LIST \ |
| 1385 |
TRUSTED_BOARD_BOOT \ |
| 1386 |
CRYPTO_SUPPORT \ |
| 1387 |
TRNG_SUPPORT \ |
| 1388 |
ERRATA_ABI_SUPPORT \ |
| 1389 |
ERRATA_NON_ARM_INTERCONNECT \ |
| 1390 |
USE_COHERENT_MEM \ |
| 1391 |
USE_DEBUGFS \ |
| 1392 |
ARM_IO_IN_DTB \ |
| 1393 |
SDEI_IN_FCONF \ |
| 1394 |
SEC_INT_DESC_IN_FCONF \ |
| 1395 |
USE_ROMLIB \ |
| 1396 |
USE_TBBR_DEFS \ |
| 1397 |
WARMBOOT_ENABLE_DCACHE_EARLY \ |
| 1398 |
RESET_TO_BL2 \ |
| 1399 |
BL2_RUNS_AT_EL3 \ |
| 1400 |
BL2_IN_XIP_MEM \ |
| 1401 |
BL2_INV_DCACHE \ |
| 1402 |
USE_SPINLOCK_CAS \ |
| 1403 |
ERRATA_SPECULATIVE_AT \ |
| 1404 |
RAS_TRAP_NS_ERR_REC_ACCESS \ |
| 1405 |
COT_DESC_IN_DTB \ |
| 1406 |
USE_SP804_TIMER \ |
| 1407 |
ENABLE_FEAT_RNG \ |
| 1408 |
ENABLE_FEAT_RNG_TRAP \ |
| 1409 |
ENABLE_FEAT_SB \ |
| 1410 |
ENABLE_FEAT_DIT \ |
| 1411 |
NR_OF_FW_BANKS \ |
| 1412 |
NR_OF_IMAGES_IN_FW_BANK \ |
| 1413 |
PSA_FWU_SUPPORT \ |
| 1414 |
PSA_FWU_METADATA_FW_STORE_DESC \ |
| 1415 |
ENABLE_BRBE_FOR_NS \ |
| 1416 |
ENABLE_TRBE_FOR_NS \ |
| 1417 |
ENABLE_SYS_REG_TRACE_FOR_NS \ |
| 1418 |
ENABLE_TRF_FOR_NS \ |
| 1419 |
ENABLE_FEAT_HCX \ |
| 1420 |
ENABLE_MPMM \ |
| 1421 |
ENABLE_MPMM_FCONF \ |
| 1422 |
ENABLE_FEAT_FGT \ |
| 1423 |
ENABLE_FEAT_FGT2 \ |
| 1424 |
ENABLE_FEAT_ECV \ |
| 1425 |
ENABLE_FEAT_AMUv1p1 \ |
| 1426 |
ENABLE_FEAT_SEL2 \ |
| 1427 |
ENABLE_FEAT_VHE \ |
| 1428 |
ENABLE_FEAT_CSV2_2 \ |
| 1429 |
ENABLE_FEAT_CSV2_3 \ |
| 1430 |
ENABLE_FEAT_LS64_ACCDATA \ |
| 1431 |
ENABLE_FEAT_PAN \ |
| 1432 |
ENABLE_FEAT_TCR2 \ |
| 1433 |
ENABLE_FEAT_THE \ |
| 1434 |
ENABLE_FEAT_S2PIE \ |
| 1435 |
ENABLE_FEAT_S1PIE \ |
| 1436 |
ENABLE_FEAT_S2POE \ |
| 1437 |
ENABLE_FEAT_S1POE \ |
| 1438 |
ENABLE_FEAT_SCTLR2 \ |
| 1439 |
ENABLE_FEAT_D128 \ |
| 1440 |
ENABLE_FEAT_GCS \ |
| 1441 |
ENABLE_FEAT_MTE2 \ |
| 1442 |
FEATURE_DETECTION \ |
| 1443 |
TWED_DELAY \ |
| 1444 |
ENABLE_FEAT_TWED \ |
| 1445 |
CONDITIONAL_CMO \ |
| 1446 |
IMPDEF_SYSREG_TRAP \ |
| 1447 |
SVE_VECTOR_LEN \ |
| 1448 |
ENABLE_SPMD_LP \ |
| 1449 |
PSA_CRYPTO \ |
| 1450 |
ENABLE_CONSOLE_GETC \ |
| 1451 |
INIT_UNUSED_NS_EL2 \ |
| 1452 |
PLATFORM_REPORT_CTX_MEM_USE \ |
| 1453 |
EARLY_CONSOLE \ |
| 1454 |
PRESERVE_DSU_PMU_REGS \ |
| 1455 |
))) |
| 1456 |
|
| 1457 |
ifeq (${PLATFORM_REPORT_CTX_MEM_USE}, 1) |
| 1458 |
ifeq (${DEBUG}, 0) |
| 1459 |
$(warning "PLATFORM_REPORT_CTX_MEM_USE can be applied when DEBUG=1 only") |
| 1460 |
override PLATFORM_REPORT_CTX_MEM_USE := 0 |
| 1461 |
endif |
| 1462 |
endif |
| 1463 |
|
| 1464 |
ifeq (${SANITIZE_UB},trap) |
| 1465 |
$(eval $(call add_define,MONITOR_TRAPS)) |
| 1466 |
endif |
| 1467 |
|
| 1468 |
|
| 1469 |
ifdef EL3_PAYLOAD_BASE |
| 1470 |
$(eval $(call add_define,EL3_PAYLOAD_BASE)) |
| 1471 |
else |
| 1472 |
|
| 1473 |
|
| 1474 |
ifdef PRELOADED_BL33_BASE |
| 1475 |
$(eval $(call add_define,PRELOADED_BL33_BASE)) |
| 1476 |
endif |
| 1477 |
endif |
| 1478 |
|
| 1479 |
|
| 1480 |
ifeq (${DYN_DISABLE_AUTH},1) |
| 1481 |
$(eval $(call add_define,DYN_DISABLE_AUTH)) |
| 1482 |
endif |
| 1483 |
|
| 1484 |
ifeq ($($(ARCH)-ld-id),arm-link) |
| 1485 |
$(eval $(call add_define,USE_ARM_LINK)) |
| 1486 |
endif |
| 1487 |
|
| 1488 |
|
| 1489 |
ifeq (${SPD},spmd) |
| 1490 |
ifdef SP_LAYOUT_FILE |
| 1491 |
-include $(BUILD_PLAT)/sp_gen.mk |
| 1492 |
FIP_DEPS += sp |
| 1493 |
CRT_DEPS += sp |
| 1494 |
NEED_SP_PKG := yes |
| 1495 |
else |
| 1496 |
ifeq (${SPMD_SPM_AT_SEL2},1) |
| 1497 |
$(error "SPMD with SPM at S-EL2 require SP_LAYOUT_FILE") |
| 1498 |
endif |
| 1499 |
endif |
| 1500 |
endif |
| 1501 |
|
| 1502 |
|
| 1503 |
|
| 1504 |
|
| 1505 |
|
| 1506 |
.PHONY: all msg_start clean realclean distclean cscope locate-checkpatch checkcodebase checkpatch fiptool sptool fip sp tl fwu_fip certtool dtbs memmap doc enctool |
| 1507 |
.SUFFIXES: |
| 1508 |
|
| 1509 |
all: msg_start |
| 1510 |
|
| 1511 |
msg_start: |
| 1512 |
$(s)echo "Building ${PLAT}" |
| 1513 |
|
| 1514 |
ifeq (${ERROR_DEPRECATED},0) |
| 1515 |
|
| 1516 |
ifneq ($(filter %-clang,$($(ARCH)-cc-id)),) |
| 1517 |
CPPFLAGS += -Wno-error=deprecated-declarations |
| 1518 |
else |
| 1519 |
CPPFLAGS += -Wno-error=deprecated-declarations -Wno-error=cpp |
| 1520 |
endif |
| 1521 |
endif |
| 1522 |
|
| 1523 |
$(eval $(call MAKE_LIB,c)) |
| 1524 |
|
| 1525 |
|
| 1526 |
ifeq (${NEED_BL1},yes) |
| 1527 |
BL1_SOURCES := $(sort ${BL1_SOURCES}) |
| 1528 |
$(eval $(call MAKE_BL,bl1)) |
| 1529 |
endif |
| 1530 |
|
| 1531 |
ifeq (${NEED_BL2},yes) |
| 1532 |
|
| 1533 |
ifeq (${RESET_TO_BL2}, 0) |
| 1534 |
FIP_BL2_ARGS := tb-fw |
| 1535 |
endif |
| 1536 |
|
| 1537 |
BL2_SOURCES := $(sort ${BL2_SOURCES}) |
| 1538 |
|
| 1539 |
$(if ${BL2}, $(eval $(call TOOL_ADD_IMG,bl2,--${FIP_BL2_ARGS})),\ |
| 1540 |
$(eval $(call MAKE_BL,bl2,${FIP_BL2_ARGS}))) |
| 1541 |
|
| 1542 |
endif |
| 1543 |
|
| 1544 |
ifeq (${NEED_SCP_BL2},yes) |
| 1545 |
$(eval $(call TOOL_ADD_IMG,scp_bl2,--scp-fw)) |
| 1546 |
endif |
| 1547 |
|
| 1548 |
ifeq (${NEED_BL31},yes) |
| 1549 |
BL31_SOURCES += ${SPD_SOURCES} |
| 1550 |
|
| 1551 |
BL31_SOURCES := $(sort ${BL31_SOURCES}) |
| 1552 |
ifneq (${DECRYPTION_SUPPORT},none) |
| 1553 |
$(if ${BL31}, $(eval $(call TOOL_ADD_IMG,bl31,--soc-fw,,$(ENCRYPT_BL31))),\ |
| 1554 |
$(eval $(call MAKE_BL,bl31,soc-fw,,$(ENCRYPT_BL31)))) |
| 1555 |
else |
| 1556 |
$(if ${BL31}, $(eval $(call TOOL_ADD_IMG,bl31,--soc-fw)),\ |
| 1557 |
$(eval $(call MAKE_BL,bl31,soc-fw))) |
| 1558 |
endif |
| 1559 |
endif |
| 1560 |
|
| 1561 |
|
| 1562 |
|
| 1563 |
|
| 1564 |
ifeq (${NEED_BL32},yes) |
| 1565 |
|
| 1566 |
BL32_SOURCES := $(sort ${BL32_SOURCES}) |
| 1567 |
BUILD_BL32 := $(if $(BL32),,$(if $(BL32_SOURCES),1)) |
| 1568 |
|
| 1569 |
ifneq (${DECRYPTION_SUPPORT},none) |
| 1570 |
$(if ${BUILD_BL32}, $(eval $(call MAKE_BL,bl32,tos-fw,,$(ENCRYPT_BL32))),\ |
| 1571 |
$(eval $(call TOOL_ADD_IMG,bl32,--tos-fw,,$(ENCRYPT_BL32)))) |
| 1572 |
else |
| 1573 |
$(if ${BUILD_BL32}, $(eval $(call MAKE_BL,bl32,tos-fw)),\ |
| 1574 |
$(eval $(call TOOL_ADD_IMG,bl32,--tos-fw))) |
| 1575 |
endif |
| 1576 |
endif |
| 1577 |
|
| 1578 |
|
| 1579 |
|
| 1580 |
ifeq (${NEED_RMM},yes) |
| 1581 |
|
| 1582 |
RMM_SOURCES := $(sort ${RMM_SOURCES}) |
| 1583 |
BUILD_RMM := $(if $(RMM),,$(if $(RMM_SOURCES),1)) |
| 1584 |
|
| 1585 |
$(if ${BUILD_RMM}, $(eval $(call MAKE_BL,rmm,rmm-fw)),\ |
| 1586 |
$(eval $(call TOOL_ADD_IMG,rmm,--rmm-fw))) |
| 1587 |
endif |
| 1588 |
|
| 1589 |
|
| 1590 |
ifeq (${NEED_BL33},yes) |
| 1591 |
$(eval $(call TOOL_ADD_IMG,bl33,--nt-fw)) |
| 1592 |
endif |
| 1593 |
|
| 1594 |
ifeq (${NEED_BL2U},yes) |
| 1595 |
$(if ${BL2U}, $(eval $(call TOOL_ADD_IMG,bl2u,--ap-fwu-cfg,FWU_)),\ |
| 1596 |
$(eval $(call MAKE_BL,bl2u,ap-fwu-cfg,FWU_))) |
| 1597 |
endif |
| 1598 |
|
| 1599 |
|
| 1600 |
ifeq (${NEED_FDT},yes) |
| 1601 |
$(eval $(call MAKE_DTBS,$(BUILD_PLAT)/fdts,$(FDT_SOURCES))) |
| 1602 |
endif |
| 1603 |
|
| 1604 |
|
| 1605 |
ifeq (${NEED_SP_PKG},yes) |
| 1606 |
$(BUILD_PLAT)/sp_gen.mk: ${SP_MK_GEN} ${SP_LAYOUT_FILE} | $$(@D)/ |
| 1607 |
$(q)${PYTHON} "$<" "$@" $(filter-out $<,$^) $(BUILD_PLAT) ${COT} ${SP_DTS_LIST_FRAGMENT} |
| 1608 |
sp: $(DTBS) $(BUILD_PLAT)/sp_gen.mk $(SP_PKGS) |
| 1609 |
$(s)echo |
| 1610 |
$(s)echo "Built SP Images successfully" |
| 1611 |
$(s)echo |
| 1612 |
endif |
| 1613 |
|
| 1614 |
locate-checkpatch: |
| 1615 |
ifndef CHECKPATCH |
| 1616 |
$(error "Please set CHECKPATCH to point to the Linux checkpatch.pl file, eg: CHECKPATCH=../linux/scripts/checkpatch.pl") |
| 1617 |
else |
| 1618 |
ifeq (,$(wildcard ${CHECKPATCH})) |
| 1619 |
$(error "The file CHECKPATCH points to cannot be found, use eg: CHECKPATCH=../linux/scripts/checkpatch.pl") |
| 1620 |
endif |
| 1621 |
endif |
| 1622 |
|
| 1623 |
clean: |
| 1624 |
$(s)echo " CLEAN" |
| 1625 |
$(call SHELL_REMOVE_DIR,${BUILD_PLAT}) |
| 1626 |
ifdef UNIX_MK |
| 1627 |
$(q)${MAKE} --no-print-directory -C ${FIPTOOLPATH} clean |
| 1628 |
else |
| 1629 |
|
| 1630 |
|
| 1631 |
$(q)set MAKEFLAGS= && ${MSVC_NMAKE} /nologo /f ${FIPTOOLPATH}/Makefile.msvc FIPTOOLPATH=$(subst /,\,$(FIPTOOLPATH)) FIPTOOL=$(subst /,\,$(FIPTOOL)) clean |
| 1632 |
endif |
| 1633 |
$(q)${MAKE} PLAT=${PLAT} --no-print-directory -C ${CRTTOOLPATH} clean |
| 1634 |
$(q)${MAKE} PLAT=${PLAT} --no-print-directory -C ${ENCTOOLPATH} clean |
| 1635 |
$(q)${MAKE} --no-print-directory -C ${ROMLIBPATH} clean |
| 1636 |
|
| 1637 |
realclean distclean: |
| 1638 |
$(s)echo " REALCLEAN" |
| 1639 |
$(call SHELL_REMOVE_DIR,${BUILD_BASE}) |
| 1640 |
$(call SHELL_DELETE_ALL, ${CURDIR}/cscope.*) |
| 1641 |
ifdef UNIX_MK |
| 1642 |
$(q)${MAKE} --no-print-directory -C ${FIPTOOLPATH} clean |
| 1643 |
else |
| 1644 |
|
| 1645 |
|
| 1646 |
$(q)set MAKEFLAGS= && ${MSVC_NMAKE} /nologo /f ${FIPTOOLPATH}/Makefile.msvc FIPTOOLPATH=$(subst /,\,$(FIPTOOLPATH)) FIPTOOL=$(subst /,\,$(FIPTOOL)) realclean |
| 1647 |
endif |
| 1648 |
$(q)${MAKE} PLAT=${PLAT} --no-print-directory -C ${CRTTOOLPATH} realclean |
| 1649 |
$(q)${MAKE} PLAT=${PLAT} --no-print-directory -C ${ENCTOOLPATH} realclean |
| 1650 |
$(q)${MAKE} --no-print-directory -C ${ROMLIBPATH} clean |
| 1651 |
|
| 1652 |
checkcodebase: locate-checkpatch |
| 1653 |
$(s)echo " CHECKING STYLE" |
| 1654 |
$(q)if test -d .git ; then \ |
| 1655 |
git ls-files | grep -E -v 'libfdt|libc|docs|\.rst' | \ |
| 1656 |
while read GIT_FILE ; \ |
| 1657 |
do ${CHECKPATCH} ${CHECKCODE_ARGS} -f $$GIT_FILE ; \ |
| 1658 |
done ; \ |
| 1659 |
else \ |
| 1660 |
find . -type f -not -iwholename "*.git*" \ |
| 1661 |
-not -iwholename "*build*" \ |
| 1662 |
-not -iwholename "*libfdt*" \ |
| 1663 |
-not -iwholename "*libc*" \ |
| 1664 |
-not -iwholename "*docs*" \ |
| 1665 |
-not -iwholename "*.rst" \ |
| 1666 |
-exec ${CHECKPATCH} ${CHECKCODE_ARGS} -f {} \; ; \ |
| 1667 |
fi |
| 1668 |
|
| 1669 |
checkpatch: locate-checkpatch |
| 1670 |
$(s)echo " CHECKING STYLE" |
| 1671 |
$(q)if test -n "${CHECKPATCH_OPTS}"; then \ |
| 1672 |
echo " with ${CHECKPATCH_OPTS} option(s)"; \ |
| 1673 |
fi |
| 1674 |
$(q)COMMON_COMMIT=$$(git merge-base HEAD ${BASE_COMMIT}); \ |
| 1675 |
for commit in `git rev-list --no-merges $$COMMON_COMMIT..HEAD`; \ |
| 1676 |
do \ |
| 1677 |
printf "\n[*] Checking style of '$$commit'\n\n"; \ |
| 1678 |
( git log --format=email "$$commit~..$$commit" \ |
| 1679 |
-- ${CHECK_PATHS} ; \ |
| 1680 |
git diff --format=email "$$commit~..$$commit" \ |
| 1681 |
-- ${CHECK_PATHS}; ) | \ |
| 1682 |
${CHECKPATCH} ${CHECKPATCH_OPTS} - || true; \ |
| 1683 |
done |
| 1684 |
|
| 1685 |
certtool: ${CRTTOOL} |
| 1686 |
|
| 1687 |
${CRTTOOL}: FORCE |
| 1688 |
$(q)${MAKE} PLAT=${PLAT} USE_TBBR_DEFS=${USE_TBBR_DEFS} COT=${COT} OPENSSL_DIR=${OPENSSL_DIR} CRTTOOL=${CRTTOOL} DEBUG=${DEBUG} --no-print-directory -C ${CRTTOOLPATH} all |
| 1689 |
$(s)echo |
| 1690 |
$(s)echo "Built $@ successfully" |
| 1691 |
$(s)echo |
| 1692 |
|
| 1693 |
ifneq (${GENERATE_COT},0) |
| 1694 |
certificates: ${CRT_DEPS} ${CRTTOOL} |
| 1695 |
$(q)${CRTTOOL} ${CRT_ARGS} |
| 1696 |
$(s)echo |
| 1697 |
$(s)echo "Built $@ successfully" |
| 1698 |
$(s)echo "Certificates can be found in ${BUILD_PLAT}" |
| 1699 |
$(s)echo |
| 1700 |
endif |
| 1701 |
|
| 1702 |
${BUILD_PLAT}/${FIP_NAME}: ${FIP_DEPS} ${FIPTOOL} |
| 1703 |
$(eval ${CHECK_FIP_CMD}) |
| 1704 |
$(q)${FIPTOOL} create ${FIP_ARGS} $@ |
| 1705 |
$(q)${FIPTOOL} info $@ |
| 1706 |
$(s)echo |
| 1707 |
$(s)echo "Built $@ successfully" |
| 1708 |
$(s)echo |
| 1709 |
|
| 1710 |
ifneq (${GENERATE_COT},0) |
| 1711 |
fwu_certificates: ${FWU_CRT_DEPS} ${CRTTOOL} |
| 1712 |
$(q)${CRTTOOL} ${FWU_CRT_ARGS} |
| 1713 |
$(s)echo |
| 1714 |
$(s)echo "Built $@ successfully" |
| 1715 |
$(s)echo "FWU certificates can be found in ${BUILD_PLAT}" |
| 1716 |
$(s)echo |
| 1717 |
endif |
| 1718 |
|
| 1719 |
${BUILD_PLAT}/${FWU_FIP_NAME}: ${FWU_FIP_DEPS} ${FIPTOOL} |
| 1720 |
$(eval ${CHECK_FWU_FIP_CMD}) |
| 1721 |
$(q)${FIPTOOL} create ${FWU_FIP_ARGS} $@ |
| 1722 |
$(q)${FIPTOOL} info $@ |
| 1723 |
$(s)echo |
| 1724 |
$(s)echo "Built $@ successfully" |
| 1725 |
$(s)echo |
| 1726 |
|
| 1727 |
fiptool: ${FIPTOOL} |
| 1728 |
fip: ${BUILD_PLAT}/${FIP_NAME} |
| 1729 |
fwu_fip: ${BUILD_PLAT}/${FWU_FIP_NAME} |
| 1730 |
|
| 1731 |
${FIPTOOL}: FORCE |
| 1732 |
ifdef UNIX_MK |
| 1733 |
$(q)${MAKE} PLAT=${PLAT} CPPFLAGS="-DVERSION='\"${VERSION_STRING}\"'" FIPTOOL=${FIPTOOL} OPENSSL_DIR=${OPENSSL_DIR} DEBUG=${DEBUG} --no-print-directory -C ${FIPTOOLPATH} all |
| 1734 |
else |
| 1735 |
|
| 1736 |
|
| 1737 |
$(q)set MAKEFLAGS= && ${MSVC_NMAKE} /nologo /f ${FIPTOOLPATH}/Makefile.msvc FIPTOOLPATH=$(subst /,\,$(FIPTOOLPATH)) FIPTOOL=$(subst /,\,$(FIPTOOL)) |
| 1738 |
endif |
| 1739 |
|
| 1740 |
romlib.bin: libraries FORCE |
| 1741 |
$(q)${MAKE} PLAT_DIR=${PLAT_DIR} BUILD_PLAT=${BUILD_PLAT} ENABLE_BTI=${ENABLE_BTI} ARM_ARCH_MINOR=${ARM_ARCH_MINOR} INCLUDES=$(call escape-shell,$(INCLUDES)) DEFINES=$(call escape-shell,$(DEFINES)) --no-print-directory -C ${ROMLIBPATH} all |
| 1742 |
|
| 1743 |
memmap: all |
| 1744 |
ifdef UNIX_MK |
| 1745 |
$(q)PYTHONPATH=${CURDIR}/tools/memory \ |
| 1746 |
${PYTHON} -m memory.memmap -sr ${BUILD_PLAT} |
| 1747 |
else |
| 1748 |
$(q)set PYTHONPATH=${CURDIR}/tools/memory && \ |
| 1749 |
${PYTHON} -m memory.memmap -sr ${BUILD_PLAT} |
| 1750 |
endif |
| 1751 |
|
| 1752 |
tl: ${BUILD_PLAT}/tl.bin |
| 1753 |
${BUILD_PLAT}/tl.bin: ${HW_CONFIG} |
| 1754 |
$(if $(host-poetry),$(q)poetry -q install) |
| 1755 |
$(q)$(if $(host-poetry),poetry run )tlc create --fdt $< -s ${FW_HANDOFF_SIZE} $@ |
| 1756 |
|
| 1757 |
doc: |
| 1758 |
$(s)echo " BUILD DOCUMENTATION" |
| 1759 |
$(q)${MAKE} --no-print-directory -C ${DOCS_PATH} html |
| 1760 |
|
| 1761 |
enctool: ${ENCTOOL} |
| 1762 |
|
| 1763 |
${ENCTOOL}: FORCE |
| 1764 |
$(q)${MAKE} PLAT=${PLAT} BUILD_INFO=0 OPENSSL_DIR=${OPENSSL_DIR} ENCTOOL=${ENCTOOL} DEBUG=${DEBUG} --no-print-directory -C ${ENCTOOLPATH} all |
| 1765 |
$(s)echo |
| 1766 |
$(s)echo "Built $@ successfully" |
| 1767 |
$(s)echo |
| 1768 |
|
| 1769 |
cscope: |
| 1770 |
$(s)echo " CSCOPE" |
| 1771 |
$(q)find ${CURDIR} -name "*.[chsS]" > cscope.files |
| 1772 |
$(q)cscope -b -q -k |
| 1773 |
|
| 1774 |
help: |
| 1775 |
$(s)echo "usage: ${MAKE} [PLAT=<platform>] [OPTIONS] [TARGET]" |
| 1776 |
$(s)echo "" |
| 1777 |
$(s)echo "PLAT is used to specify which platform you wish to build." |
| 1778 |
$(s)echo "If no platform is specified, PLAT defaults to: ${DEFAULT_PLAT}" |
| 1779 |
$(s)echo "" |
| 1780 |
$(s)echo "platform = ${PLATFORM_LIST}" |
| 1781 |
$(s)echo "" |
| 1782 |
$(s)echo "Please refer to the User Guide for a list of all supported options." |
| 1783 |
$(s)echo "Note that the build system doesn't track dependencies for build " |
| 1784 |
$(s)echo "options. Therefore, if any of the build options are changed " |
| 1785 |
$(s)echo "from a previous build, a clean build must be performed." |
| 1786 |
$(s)echo "" |
| 1787 |
$(s)echo "Supported Targets:" |
| 1788 |
$(s)echo " all Build all individual bootloader binaries" |
| 1789 |
$(s)echo " bl1 Build the BL1 binary" |
| 1790 |
$(s)echo " bl2 Build the BL2 binary" |
| 1791 |
$(s)echo " bl2u Build the BL2U binary" |
| 1792 |
$(s)echo " bl31 Build the BL31 binary" |
| 1793 |
$(s)echo " bl32 Build the BL32 binary. If ARCH=aarch32, then " |
| 1794 |
$(s)echo " this builds secure payload specified by AARCH32_SP" |
| 1795 |
$(s)echo " certificates Build the certificates (requires 'GENERATE_COT=1')" |
| 1796 |
$(s)echo " fip Build the Firmware Image Package (FIP)" |
| 1797 |
$(s)echo " fwu_fip Build the FWU Firmware Image Package (FIP)" |
| 1798 |
$(s)echo " checkcodebase Check the coding style of the entire source tree" |
| 1799 |
$(s)echo " checkpatch Check the coding style on changes in the current" |
| 1800 |
$(s)echo " branch against BASE_COMMIT (default origin/master)" |
| 1801 |
$(s)echo " clean Clean the build for the selected platform" |
| 1802 |
$(s)echo " cscope Generate cscope index" |
| 1803 |
$(s)echo " distclean Remove all build artifacts for all platforms" |
| 1804 |
$(s)echo " certtool Build the Certificate generation tool" |
| 1805 |
$(s)echo " enctool Build the Firmware encryption tool" |
| 1806 |
$(s)echo " fiptool Build the Firmware Image Package (FIP) creation tool" |
| 1807 |
$(s)echo " sp Build the Secure Partition Packages" |
| 1808 |
$(s)echo " sptool Build the Secure Partition Package creation tool" |
| 1809 |
$(s)echo " dtbs Build the Device Tree Blobs (if required for the platform)" |
| 1810 |
$(s)echo " memmap Print the memory map of the built binaries" |
| 1811 |
$(s)echo " doc Build html based documentation using Sphinx tool" |
| 1812 |
$(s)echo "" |
| 1813 |
$(s)echo "Note: most build targets require PLAT to be set to a specific platform." |
| 1814 |
$(s)echo "" |
| 1815 |
$(s)echo "example: build all targets for the FVP platform:" |
| 1816 |
$(s)echo " CROSS_COMPILE=aarch64-none-elf- make PLAT=fvp all" |
| 1817 |
|
| 1818 |
.PHONY: FORCE |
| 1819 |
FORCE:; |