Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 1 | # |
Chris Kay | c327370 | 2025-01-13 15:57:32 +0000 | [diff] [blame] | 2 | # Copyright (c) 2013-2025, Arm Limited and Contributors. All rights reserved. |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 3 | # |
dp-arm | 82cb2c1 | 2017-05-03 09:38:09 +0100 | [diff] [blame] | 4 | # SPDX-License-Identifier: BSD-3-Clause |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 5 | # |
| 6 | |
Jeenu Viswambharan | e35c404 | 2014-05-15 14:40:58 +0100 | [diff] [blame] | 7 | # |
Juan Castillo | aaa3e72 | 2014-06-30 11:41:46 +0100 | [diff] [blame] | 8 | # Trusted Firmware Version |
| 9 | # |
Soby Mathew | 1a0f112 | 2018-10-01 16:16:34 +0100 | [diff] [blame] | 10 | VERSION_MAJOR := 2 |
Govindraj Raja | 97a6de9 | 2025-05-07 13:51:45 -0500 | [diff] [blame] | 11 | VERSION_MINOR := 13 |
Yann Gautier | c25d1cc | 2024-02-08 18:40:27 +0100 | [diff] [blame] | 12 | # VERSION_PATCH is only used for LTS releases |
| 13 | VERSION_PATCH := 0 |
Yann Gautier | 055ebec | 2023-10-03 11:09:07 +0200 | [diff] [blame] | 14 | VERSION := ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH} |
Juan Castillo | aaa3e72 | 2014-06-30 11:41:46 +0100 | [diff] [blame] | 15 | |
Juan Castillo | 8815467 | 2015-10-22 11:34:44 +0100 | [diff] [blame] | 16 | # Default goal is build all images |
| 17 | .DEFAULT_GOAL := all |
| 18 | |
Douglas Raillard | 72fc70e | 2016-12-28 14:47:50 +0000 | [diff] [blame] | 19 | # Avoid any implicit propagation of command line variable definitions to |
| 20 | # sub-Makefiles, like CFLAGS that we reserved for the firmware images' |
| 21 | # usage. Other command line options like "-s" are still propagated as usual. |
| 22 | MAKEOVERRIDES = |
| 23 | |
Evan Lloyd | 231c147 | 2015-12-02 18:17:37 +0000 | [diff] [blame] | 24 | MAKE_HELPERS_DIRECTORY := make_helpers/ |
| 25 | include ${MAKE_HELPERS_DIRECTORY}build_macros.mk |
Chris Kay | f4dd18c | 2024-06-04 00:04:48 +0000 | [diff] [blame] | 26 | include ${MAKE_HELPERS_DIRECTORY}build-rules.mk |
Chris Kay | 7c4e1ee | 2024-05-02 17:52:37 +0000 | [diff] [blame] | 27 | include ${MAKE_HELPERS_DIRECTORY}common.mk |
Juan Castillo | 73c99d4 | 2015-08-18 14:23:04 +0100 | [diff] [blame] | 28 | |
| 29 | ################################################################################ |
Jeenu Viswambharan | 2fae4b1 | 2016-10-24 14:31:51 +0100 | [diff] [blame] | 30 | # Default values for build configurations, and their dependencies |
Juan Castillo | 73c99d4 | 2015-08-18 14:23:04 +0100 | [diff] [blame] | 31 | ################################################################################ |
Jeenu Viswambharan | e35c404 | 2014-05-15 14:40:58 +0100 | [diff] [blame] | 32 | |
Jeenu Viswambharan | 2fae4b1 | 2016-10-24 14:31:51 +0100 | [diff] [blame] | 33 | include ${MAKE_HELPERS_DIRECTORY}defaults.mk |
Yann Gautier | 422b181 | 2025-01-17 11:02:50 +0100 | [diff] [blame] | 34 | PLAT := ${DEFAULT_PLAT} |
Andrey Skvortsov | 1b2fb6a | 2024-02-18 11:43:12 +0300 | [diff] [blame] | 35 | include ${MAKE_HELPERS_DIRECTORY}plat_helpers.mk |
| 36 | |
| 37 | # To be able to set platform specific defaults |
| 38 | ifneq ($(PLAT_DEFAULTS_MAKEFILE_FULL),) |
| 39 | include ${PLAT_DEFAULTS_MAKEFILE_FULL} |
| 40 | endif |
dp-arm | 872be88 | 2016-09-19 11:18:44 +0100 | [diff] [blame] | 41 | |
Chris Kay | cc277de | 2023-10-20 09:17:33 +0000 | [diff] [blame] | 42 | ################################################################################ |
| 43 | # Configure the toolchains used to build TF-A and its tools |
| 44 | ################################################################################ |
| 45 | |
| 46 | include ${MAKE_HELPERS_DIRECTORY}toolchain.mk |
| 47 | |
Antonio Nino Diaz | cc8b563 | 2017-04-18 15:16:05 +0100 | [diff] [blame] | 48 | # Assertions enabled for DEBUG builds by default |
Antonio Nino Diaz | cc8b563 | 2017-04-18 15:16:05 +0100 | [diff] [blame] | 49 | ENABLE_ASSERTIONS := ${DEBUG} |
Jeenu Viswambharan | 2fae4b1 | 2016-10-24 14:31:51 +0100 | [diff] [blame] | 50 | ENABLE_PMF := ${ENABLE_RUNTIME_INSTRUMENTATION} |
Juan Castillo | 73c99d4 | 2015-08-18 14:23:04 +0100 | [diff] [blame] | 51 | |
| 52 | ################################################################################ |
| 53 | # Checkpatch script options |
| 54 | ################################################################################ |
| 55 | |
Sandrine Bailleux | f607739 | 2016-06-02 11:19:59 +0100 | [diff] [blame] | 56 | CHECKCODE_ARGS := --no-patch |
Dan Handley | f0b489c | 2016-06-02 17:15:13 +0100 | [diff] [blame] | 57 | # Do not check the coding style on imported library files or documentation files |
Gilad Ben-Yossef | 4501843 | 2019-05-15 09:24:04 +0300 | [diff] [blame] | 58 | INC_DRV_DIRS_TO_CHECK := $(sort $(filter-out \ |
| 59 | include/drivers/arm, \ |
| 60 | $(wildcard include/drivers/*))) |
Dan Handley | f0b489c | 2016-06-02 17:15:13 +0100 | [diff] [blame] | 61 | INC_LIB_DIRS_TO_CHECK := $(sort $(filter-out \ |
Dan Handley | 1a41e8c | 2016-06-02 18:21:02 +0100 | [diff] [blame] | 62 | include/lib/libfdt \ |
Roberto Vargas | 61f72a3 | 2018-05-08 10:27:10 +0100 | [diff] [blame] | 63 | include/lib/libc, \ |
Dan Handley | f0b489c | 2016-06-02 17:15:13 +0100 | [diff] [blame] | 64 | $(wildcard include/lib/*))) |
| 65 | INC_DIRS_TO_CHECK := $(sort $(filter-out \ |
Gilad Ben-Yossef | 4501843 | 2019-05-15 09:24:04 +0300 | [diff] [blame] | 66 | include/lib \ |
| 67 | include/drivers, \ |
Dan Handley | f0b489c | 2016-06-02 17:15:13 +0100 | [diff] [blame] | 68 | $(wildcard include/*))) |
| 69 | LIB_DIRS_TO_CHECK := $(sort $(filter-out \ |
dp-arm | d801fbb | 2017-05-04 12:15:35 +0100 | [diff] [blame] | 70 | lib/compiler-rt \ |
Antonio Nino Diaz | 55cdcf7 | 2017-01-16 17:20:45 +0000 | [diff] [blame] | 71 | lib/libfdt% \ |
Roberto Vargas | 61f72a3 | 2018-05-08 10:27:10 +0100 | [diff] [blame] | 72 | lib/libc, \ |
Daniel Boulby | a194255 | 2022-10-05 11:05:22 +0100 | [diff] [blame] | 73 | lib/zlib \ |
Dan Handley | f0b489c | 2016-06-02 17:15:13 +0100 | [diff] [blame] | 74 | $(wildcard lib/*))) |
| 75 | ROOT_DIRS_TO_CHECK := $(sort $(filter-out \ |
| 76 | lib \ |
| 77 | include \ |
| 78 | docs \ |
Paul Beesley | 1ef3551 | 2019-03-07 16:42:31 +0000 | [diff] [blame] | 79 | %.rst, \ |
Dan Handley | f0b489c | 2016-06-02 17:15:13 +0100 | [diff] [blame] | 80 | $(wildcard *))) |
| 81 | CHECK_PATHS := ${ROOT_DIRS_TO_CHECK} \ |
| 82 | ${INC_DIRS_TO_CHECK} \ |
| 83 | ${INC_LIB_DIRS_TO_CHECK} \ |
Gilad Ben-Yossef | 4501843 | 2019-05-15 09:24:04 +0300 | [diff] [blame] | 84 | ${LIB_DIRS_TO_CHECK} \ |
| 85 | ${INC_DRV_DIRS_TO_CHECK} \ |
| 86 | ${INC_ARM_DIRS_TO_CHECK} |
Ian Spray | 36eaaf3 | 2014-01-30 17:25:28 +0000 | [diff] [blame] | 87 | |
Juan Castillo | 73c99d4 | 2015-08-18 14:23:04 +0100 | [diff] [blame] | 88 | ################################################################################ |
| 89 | # Process build options |
| 90 | ################################################################################ |
| 91 | |
Chris Kay | 7c4e1ee | 2024-05-02 17:52:37 +0000 | [diff] [blame] | 92 | ifeq ($(verbose),) |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 93 | CHECKCODE_ARGS += --no-summary --terse |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 94 | endif |
Andre Przywara | ee1ba6d | 2018-09-27 10:56:05 +0100 | [diff] [blame] | 95 | |
Juan Castillo | 73c99d4 | 2015-08-18 14:23:04 +0100 | [diff] [blame] | 96 | ################################################################################ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 97 | # Auxiliary tools (fiptool, cert_create, etc) |
| 98 | ################################################################################ |
| 99 | |
| 100 | # Variables for use with Certificate Generation Tool |
| 101 | CRTTOOLPATH ?= tools/cert_create |
Boyan Karatotev | f4595e6 | 2025-05-06 17:11:29 +0100 | [diff] [blame] | 102 | CRTTOOL ?= ${BUILD_PLAT}/${CRTTOOLPATH}/cert_create$(.exe) |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 103 | |
| 104 | # Variables for use with Firmware Encryption Tool |
| 105 | ENCTOOLPATH ?= tools/encrypt_fw |
Boyan Karatotev | 96fbe88 | 2025-05-02 16:40:40 +0100 | [diff] [blame] | 106 | ENCTOOL ?= ${BUILD_PLAT}/${ENCTOOLPATH}/encrypt_fw$(.exe) |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 107 | |
| 108 | # Variables for use with Firmware Image Package |
| 109 | FIPTOOLPATH ?= tools/fiptool |
Boyan Karatotev | cbd6cec | 2025-05-02 15:08:24 +0100 | [diff] [blame] | 110 | FIPTOOL ?= ${BUILD_PLAT}/${FIPTOOLPATH}/fiptool$(.exe) |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 111 | |
| 112 | # Variables for use with sptool |
| 113 | SPTOOLPATH ?= tools/sptool |
| 114 | SPTOOL ?= ${SPTOOLPATH}/sptool.py |
| 115 | SP_MK_GEN ?= ${SPTOOLPATH}/sp_mk_generator.py |
Karl Meakin | 20629b3 | 2023-02-14 11:56:02 +0000 | [diff] [blame] | 116 | SP_DTS_LIST_FRAGMENT ?= ${BUILD_PLAT}/sp_list_fragment.dts |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 117 | |
J-Alves | 0fe374e | 2024-11-18 17:49:53 +0000 | [diff] [blame] | 118 | # Variables for use with sptool |
| 119 | TLCTOOL ?= poetry run tlc |
| 120 | |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 121 | # Variables for use with ROMLIB |
| 122 | ROMLIBPATH ?= lib/romlib |
| 123 | |
| 124 | # Variable for use with Python |
| 125 | PYTHON ?= python3 |
| 126 | |
| 127 | # Variables for use with documentation build using Sphinx tool |
| 128 | DOCS_PATH ?= docs |
| 129 | |
Ahmad Fatoum | 32b209b | 2020-02-25 11:25:08 +0100 | [diff] [blame] | 130 | # Process Debug flag |
Ahmad Fatoum | 32b209b | 2020-02-25 11:25:08 +0100 | [diff] [blame] | 131 | ifneq (${DEBUG}, 0) |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 132 | BUILD_TYPE := debug |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 133 | # Use LOG_LEVEL_INFO by default for debug builds |
| 134 | LOG_LEVEL := 40 |
Ahmad Fatoum | 32b209b | 2020-02-25 11:25:08 +0100 | [diff] [blame] | 135 | else |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 136 | BUILD_TYPE := release |
| 137 | # Use LOG_LEVEL_NOTICE by default for release builds |
| 138 | LOG_LEVEL := 20 |
| 139 | endif #(Debug) |
Ahmad Fatoum | 32b209b | 2020-02-25 11:25:08 +0100 | [diff] [blame] | 140 | |
Peiyuan Song | f1de4c8 | 2020-04-25 16:53:43 +0800 | [diff] [blame] | 141 | # Default build string (git branch and commit) |
| 142 | ifeq (${BUILD_STRING},) |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 143 | BUILD_STRING := $(shell git describe --always --dirty --tags 2> /dev/null) |
Peiyuan Song | f1de4c8 | 2020-04-25 16:53:43 +0800 | [diff] [blame] | 144 | endif |
laurenw-arm | dddf428 | 2022-07-12 10:12:05 -0500 | [diff] [blame] | 145 | VERSION_STRING := v${VERSION}(${BUILD_TYPE}):${BUILD_STRING} |
Peiyuan Song | f1de4c8 | 2020-04-25 16:53:43 +0800 | [diff] [blame] | 146 | |
Boyan Karatotev | d75a9ec | 2022-11-21 14:16:43 +0000 | [diff] [blame] | 147 | # Setting W is quite verbose and most warnings will be pre-existing issues |
| 148 | # outside of the contributor's control. Don't fail the build on them so warnings |
| 149 | # can be seen and hopefully addressed |
| 150 | ifdef W |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 151 | ifneq (${W},0) |
| 152 | E ?= 0 |
| 153 | endif |
Boyan Karatotev | d75a9ec | 2022-11-21 14:16:43 +0000 | [diff] [blame] | 154 | endif |
| 155 | |
Juan Castillo | 73c99d4 | 2015-08-18 14:23:04 +0100 | [diff] [blame] | 156 | ################################################################################ |
Govindraj Raja | f521142 | 2023-08-17 10:41:48 -0500 | [diff] [blame] | 157 | # Setup ARCH_MAJOR/MINOR before parsing arch_features. |
| 158 | ################################################################################ |
| 159 | ifeq (${ENABLE_RME},1) |
AlexeiFedorov | 7d5fc98 | 2024-03-13 11:53:44 +0000 | [diff] [blame] | 160 | ARM_ARCH_MAJOR := 9 |
| 161 | ARM_ARCH_MINOR := 2 |
Govindraj Raja | f521142 | 2023-08-17 10:41:48 -0500 | [diff] [blame] | 162 | endif |
| 163 | |
| 164 | ################################################################################ |
Juan Castillo | 73c99d4 | 2015-08-18 14:23:04 +0100 | [diff] [blame] | 165 | # Common sources and include directories |
| 166 | ################################################################################ |
dp-arm | d801fbb | 2017-05-04 12:15:35 +0100 | [diff] [blame] | 167 | include lib/compiler-rt/compiler-rt.mk |
Juan Castillo | 73c99d4 | 2015-08-18 14:23:04 +0100 | [diff] [blame] | 168 | |
Chris Kay | 758ccb8 | 2024-03-08 16:08:31 +0000 | [diff] [blame] | 169 | # Allow overriding the timestamp, for example for reproducible builds, or to |
| 170 | # synchronize timestamps across multiple projects. |
| 171 | # This must be set to a C string (including quotes where applicable). |
| 172 | BUILD_MESSAGE_TIMESTAMP ?= __TIME__", "__DATE__ |
| 173 | |
| 174 | DEFINES += -DBUILD_MESSAGE_TIMESTAMP='$(BUILD_MESSAGE_TIMESTAMP)' |
| 175 | DEFINES += -DBUILD_MESSAGE_VERSION_STRING='"$(VERSION_STRING)"' |
| 176 | DEFINES += -DBUILD_MESSAGE_VERSION='"$(VERSION)"' |
| 177 | |
Juan Castillo | 73c99d4 | 2015-08-18 14:23:04 +0100 | [diff] [blame] | 178 | BL_COMMON_SOURCES += common/bl_common.c \ |
Soby Mathew | 7f56e9a | 2017-09-04 11:49:29 +0100 | [diff] [blame] | 179 | common/tf_log.c \ |
Soby Mathew | 9d29c22 | 2016-05-05 14:33:33 +0100 | [diff] [blame] | 180 | common/${ARCH}/debug.S \ |
Julius Werner | 91b48c9 | 2018-11-27 22:10:56 -0800 | [diff] [blame] | 181 | drivers/console/multi_console.c \ |
Soby Mathew | 9d29c22 | 2016-05-05 14:33:33 +0100 | [diff] [blame] | 182 | lib/${ARCH}/cache_helpers.S \ |
| 183 | lib/${ARCH}/misc_helpers.S \ |
Boyan Karatotev | c73686a | 2023-02-15 13:21:50 +0000 | [diff] [blame] | 184 | lib/extensions/pmuv3/${ARCH}/pmuv3.c \ |
Soby Mathew | 566034f | 2018-02-08 17:45:12 +0000 | [diff] [blame] | 185 | plat/common/plat_bl_common.c \ |
Soby Mathew | 7f56e9a | 2017-09-04 11:49:29 +0100 | [diff] [blame] | 186 | plat/common/plat_log_common.c \ |
dp-arm | 7531120 | 2017-03-07 11:02:47 +0000 | [diff] [blame] | 187 | plat/common/${ARCH}/plat_common.c \ |
Soby Mathew | 9d29c22 | 2016-05-05 14:33:33 +0100 | [diff] [blame] | 188 | plat/common/${ARCH}/platform_helpers.S \ |
Roberto Vargas | 61f72a3 | 2018-05-08 10:27:10 +0100 | [diff] [blame] | 189 | ${COMPILER_RT_SRCS} |
Ryan Harkin | d7a6b0f | 2014-01-13 14:40:13 +0000 | [diff] [blame] | 190 | |
Chris Kay | 8620bd0 | 2023-12-04 09:55:50 +0000 | [diff] [blame] | 191 | ifeq ($($(ARCH)-cc-id),arm-clang) |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 192 | BL_COMMON_SOURCES += lib/${ARCH}/armclang_printf.S |
Antonio Nino Diaz | 8422a84 | 2018-08-16 15:42:44 +0100 | [diff] [blame] | 193 | endif |
| 194 | |
Justin Chadwell | 1f46197 | 2019-08-20 11:01:52 +0100 | [diff] [blame] | 195 | ifeq (${SANITIZE_UB},on) |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 196 | BL_COMMON_SOURCES += plat/common/ubsan.c |
Justin Chadwell | 1f46197 | 2019-08-20 11:01:52 +0100 | [diff] [blame] | 197 | endif |
| 198 | |
Yann Gautier | 01d237c | 2018-06-18 16:00:23 +0200 | [diff] [blame] | 199 | INCLUDES += -Iinclude \ |
Antonio Nino Diaz | f5478de | 2018-12-17 17:20:57 +0000 | [diff] [blame] | 200 | -Iinclude/arch/${ARCH} \ |
Antonio Nino Diaz | 09d40e0 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 201 | -Iinclude/lib/cpus/${ARCH} \ |
| 202 | -Iinclude/lib/el3_runtime/${ARCH} \ |
| 203 | ${PLAT_INCLUDES} \ |
| 204 | ${SPD_INCLUDES} |
| 205 | |
Antonio Nino Diaz | 9c6d1c5 | 2018-11-19 11:48:30 +0000 | [diff] [blame] | 206 | include common/backtrace/backtrace.mk |
| 207 | |
Juan Castillo | 73c99d4 | 2015-08-18 14:23:04 +0100 | [diff] [blame] | 208 | ################################################################################ |
Govindraj Raja | 3547270 | 2023-09-20 14:32:24 -0500 | [diff] [blame] | 209 | # Generic definitions |
| 210 | ################################################################################ |
Govindraj Raja | 3547270 | 2023-09-20 14:32:24 -0500 | [diff] [blame] | 211 | |
| 212 | ifeq (${BUILD_BASE},) |
| 213 | BUILD_BASE := ./build |
| 214 | endif |
| 215 | BUILD_PLAT := $(abspath ${BUILD_BASE})/${PLAT}/${BUILD_TYPE} |
| 216 | |
| 217 | SPDS := $(sort $(filter-out none, $(patsubst services/spd/%,%,$(wildcard services/spd/*)))) |
| 218 | |
| 219 | # Platforms providing their own TBB makefile may override this value |
| 220 | INCLUDE_TBBR_MK := 1 |
| 221 | |
| 222 | ################################################################################ |
| 223 | # Include SPD Makefile if one has been specified |
| 224 | ################################################################################ |
| 225 | |
| 226 | ifneq (${SPD},none) |
Govindraj Raja | 3547270 | 2023-09-20 14:32:24 -0500 | [diff] [blame] | 227 | ifeq (${SPD},spmd) |
| 228 | # SPMD is located in std_svc directory |
| 229 | SPD_DIR := std_svc |
| 230 | |
| 231 | ifeq ($(SPMD_SPM_AT_SEL2),1) |
| 232 | CTX_INCLUDE_EL2_REGS := 1 |
Govindraj Raja | 3547270 | 2023-09-20 14:32:24 -0500 | [diff] [blame] | 233 | endif |
| 234 | |
Govindraj Raja | 3547270 | 2023-09-20 14:32:24 -0500 | [diff] [blame] | 235 | ifneq ($(SP_LAYOUT_FILE),) |
| 236 | BL2_ENABLE_SP_LOAD := 1 |
| 237 | endif |
| 238 | else |
| 239 | # All other SPDs in spd directory |
| 240 | SPD_DIR := spd |
| 241 | endif #(SPD) |
| 242 | |
| 243 | # We expect to locate an spd.mk under the specified SPD directory |
| 244 | SPD_MAKE := $(wildcard services/${SPD_DIR}/${SPD}/${SPD}.mk) |
| 245 | |
| 246 | ifeq (${SPD_MAKE},) |
| 247 | $(error Error: No services/${SPD_DIR}/${SPD}/${SPD}.mk located) |
| 248 | endif |
| 249 | $(info Including ${SPD_MAKE}) |
| 250 | include ${SPD_MAKE} |
| 251 | |
| 252 | # If there's BL32 companion for the chosen SPD, we expect that the SPD's |
| 253 | # Makefile would set NEED_BL32 to "yes". In this case, the build system |
| 254 | # supports two mutually exclusive options: |
| 255 | # * BL32 is built from source: then BL32_SOURCES must contain the list |
| 256 | # of source files to build BL32 |
| 257 | # * BL32 is a prebuilt binary: then BL32 must point to the image file |
| 258 | # that will be included in the FIP |
| 259 | # If both BL32_SOURCES and BL32 are defined, the binary takes precedence |
| 260 | # over the sources. |
| 261 | endif #(SPD=none) |
| 262 | |
Govindraj Raja | 3547270 | 2023-09-20 14:32:24 -0500 | [diff] [blame] | 263 | ################################################################################ |
Olivier Deprez | 696ed16 | 2025-01-03 13:38:50 +0100 | [diff] [blame] | 264 | # Include the platform specific Makefile after the SPD Makefile (the platform |
| 265 | # makefile may use all previous definitions in this file) |
| 266 | ################################################################################ |
| 267 | include ${PLAT_MAKEFILE_FULL} |
| 268 | |
| 269 | ################################################################################ |
Boyan Karatotev | 8d9f5f2 | 2025-04-02 11:16:18 +0100 | [diff] [blame] | 270 | # Setup arch_features based on ARM_ARCH_MAJOR, ARM_ARCH_MINOR provided from |
| 271 | # platform. |
| 272 | ################################################################################ |
| 273 | |
| 274 | include ${MAKE_HELPERS_DIRECTORY}arch_features.mk |
| 275 | ################################################################################ |
Govindraj Raja | f521142 | 2023-08-17 10:41:48 -0500 | [diff] [blame] | 276 | # Process BRANCH_PROTECTION value and set |
| 277 | # Pointer Authentication and Branch Target Identification flags |
| 278 | ################################################################################ |
| 279 | ifeq (${BRANCH_PROTECTION},0) |
| 280 | # Default value turns off all types of branch protection |
| 281 | BP_OPTION := none |
| 282 | else ifneq (${ARCH},aarch64) |
| 283 | $(error BRANCH_PROTECTION requires AArch64) |
| 284 | else ifeq (${BRANCH_PROTECTION},1) |
| 285 | # Enables all types of branch protection features |
| 286 | BP_OPTION := standard |
| 287 | ENABLE_BTI := 1 |
| 288 | ENABLE_PAUTH := 1 |
| 289 | else ifeq (${BRANCH_PROTECTION},2) |
| 290 | # Return address signing to its standard level |
| 291 | BP_OPTION := pac-ret |
| 292 | ENABLE_PAUTH := 1 |
| 293 | else ifeq (${BRANCH_PROTECTION},3) |
| 294 | # Extend the signing to include leaf functions |
| 295 | BP_OPTION := pac-ret+leaf |
| 296 | ENABLE_PAUTH := 1 |
| 297 | else ifeq (${BRANCH_PROTECTION},4) |
| 298 | # Turn on branch target identification mechanism |
| 299 | BP_OPTION := bti |
| 300 | ENABLE_BTI := 1 |
Boyan Karatotev | 8d9f5f2 | 2025-04-02 11:16:18 +0100 | [diff] [blame] | 301 | else ifeq (${BRANCH_PROTECTION},5) |
| 302 | # Turn on branch target identification mechanism |
| 303 | BP_OPTION := standard |
| 304 | ENABLE_BTI := 2 |
| 305 | ENABLE_PAUTH := 2 |
Govindraj Raja | f521142 | 2023-08-17 10:41:48 -0500 | [diff] [blame] | 306 | else |
| 307 | $(error Unknown BRANCH_PROTECTION value ${BRANCH_PROTECTION}) |
| 308 | endif #(BRANCH_PROTECTION) |
| 309 | |
Boyan Karatotev | 8d9f5f2 | 2025-04-02 11:16:18 +0100 | [diff] [blame] | 310 | ifneq ($(ENABLE_PAUTH),0) |
| 311 | CTX_INCLUDE_PAUTH_REGS := ${ENABLE_PAUTH} |
Govindraj Raja | f521142 | 2023-08-17 10:41:48 -0500 | [diff] [blame] | 312 | endif |
Govindraj Raja | f521142 | 2023-08-17 10:41:48 -0500 | [diff] [blame] | 313 | |
| 314 | # Pointer Authentication sources |
Boyan Karatotev | 8d9f5f2 | 2025-04-02 11:16:18 +0100 | [diff] [blame] | 315 | ifneq (${ENABLE_PAUTH},0) |
Govindraj Raja | f521142 | 2023-08-17 10:41:48 -0500 | [diff] [blame] | 316 | # arm/common/aarch64/arm_pauth.c contains a sample platform hook to complete the |
| 317 | # Pauth support. As it's not secure, it must be reimplemented for real platforms |
Boyan Karatotev | 8d9f5f2 | 2025-04-02 11:16:18 +0100 | [diff] [blame] | 318 | BL_COMMON_SOURCES += lib/extensions/pauth/pauth.c |
Govindraj Raja | f521142 | 2023-08-17 10:41:48 -0500 | [diff] [blame] | 319 | endif |
Boyan Karatotev | b14987c | 2025-04-09 14:41:58 +0100 | [diff] [blame] | 320 | # |
| 321 | ifneq (${ENABLE_FEAT_PAUTH_LR},0) |
| 322 | # Currently, FEAT_PAUTH_LR is only supported by arm/clang compilers |
| 323 | # TODO implement for GCC when support is added |
| 324 | ifeq ($($(ARCH)-cc-id),arm-clang) |
| 325 | arch-features := $(arch-features)+pauth-lr |
| 326 | else |
| 327 | $(error Error: ENABLE_FEAT_PAUTH_LR not supported for GCC compiler) |
| 328 | endif |
| 329 | endif |
Govindraj Raja | f521142 | 2023-08-17 10:41:48 -0500 | [diff] [blame] | 330 | |
Govindraj Raja | f521142 | 2023-08-17 10:41:48 -0500 | [diff] [blame] | 331 | ################################################################################ |
| 332 | # RME dependent flags configuration, Enable optional features for RME. |
| 333 | ################################################################################ |
| 334 | # FEAT_RME |
| 335 | ifeq (${ENABLE_RME},1) |
Govindraj Raja | f521142 | 2023-08-17 10:41:48 -0500 | [diff] [blame] | 336 | # RME requires el2 context to be saved for now. |
| 337 | CTX_INCLUDE_EL2_REGS := 1 |
| 338 | CTX_INCLUDE_AARCH32_REGS := 0 |
| 339 | CTX_INCLUDE_PAUTH_REGS := 1 |
| 340 | |
Javier Almansa Sobrino | d048af0 | 2025-03-21 18:32:10 +0000 | [diff] [blame] | 341 | ifneq ($(ENABLE_FEAT_MPAM), 0) |
| 342 | CTX_INCLUDE_MPAM_REGS := 1 |
| 343 | endif |
| 344 | |
Govindraj Raja | f521142 | 2023-08-17 10:41:48 -0500 | [diff] [blame] | 345 | # RME enables CSV2_2 extension by default. |
| 346 | ENABLE_FEAT_CSV2_2 = 1 |
| 347 | endif #(FEAT_RME) |
| 348 | |
| 349 | ################################################################################ |
Zelalem Aweke | 5b18de0 | 2021-07-11 18:33:20 -0500 | [diff] [blame] | 350 | # Include rmmd Makefile if RME is enabled |
| 351 | ################################################################################ |
Zelalem Aweke | 5b18de0 | 2021-07-11 18:33:20 -0500 | [diff] [blame] | 352 | ifneq (${ENABLE_RME},0) |
Zelalem Aweke | 5b18de0 | 2021-07-11 18:33:20 -0500 | [diff] [blame] | 353 | include services/std_svc/rmmd/rmmd.mk |
| 354 | $(warning "RME is an experimental feature") |
| 355 | endif |
| 356 | |
Tushar Khandelwal | 7e84f3c | 2024-03-15 15:00:29 +0000 | [diff] [blame] | 357 | ################################################################################ |
Govindraj Raja | 3065513 | 2024-09-06 15:43:43 +0100 | [diff] [blame] | 358 | # Make 128-Bit sysreg read/writes availabe when FEAT_D128 is enabled. |
| 359 | ################################################################################ |
| 360 | ifneq (${ENABLE_FEAT_D128}, 0) |
| 361 | BL_COMMON_SOURCES += lib/extensions/sysreg128/sysreg128.S |
| 362 | endif |
| 363 | |
Arvind Ram Prakash | 42d4d3b | 2022-11-22 14:41:00 -0600 | [diff] [blame] | 364 | # This internal flag is common option which is set to 1 for scenarios |
| 365 | # when the BL2 is running in EL3 level. This occurs in two scenarios - |
| 366 | # 4 world system running BL2 at EL3 and two world system without BL1 running |
| 367 | # BL2 in EL3 |
| 368 | |
| 369 | ifeq (${RESET_TO_BL2},1) |
| 370 | BL2_RUNS_AT_EL3 := 1 |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 371 | ifeq (${ENABLE_RME},1) |
| 372 | $(error RESET_TO_BL2=1 and ENABLE_RME=1 configuration is not \ |
| 373 | supported at the moment.) |
| 374 | endif |
Arvind Ram Prakash | 42d4d3b | 2022-11-22 14:41:00 -0600 | [diff] [blame] | 375 | else ifeq (${ENABLE_RME},1) |
| 376 | BL2_RUNS_AT_EL3 := 1 |
| 377 | else |
| 378 | BL2_RUNS_AT_EL3 := 0 |
| 379 | endif |
| 380 | |
Manish Pandey | f87e54f | 2023-10-10 15:42:19 +0100 | [diff] [blame] | 381 | # This internal flag is set to 1 when Firmware First handling of External aborts |
| 382 | # is required by lowe ELs. Currently only NS requires this support. |
| 383 | ifeq ($(HANDLE_EA_EL3_FIRST_NS),1) |
| 384 | FFH_SUPPORT := 1 |
| 385 | else |
| 386 | FFH_SUPPORT := 0 |
| 387 | endif |
| 388 | |
Sandrine Bailleux | 54035fc | 2016-01-13 14:57:38 +0000 | [diff] [blame] | 389 | # Include the CPU specific operations makefile, which provides default |
| 390 | # values for all CPU errata workarounds and CPU specific optimisations. |
| 391 | # This can be overridden by the platform. |
Juan Castillo | 73c99d4 | 2015-08-18 14:23:04 +0100 | [diff] [blame] | 392 | include lib/cpus/cpu-ops.mk |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 393 | |
dp-arm | a440900 | 2017-02-15 11:07:55 +0000 | [diff] [blame] | 394 | ################################################################################ |
| 395 | # Build `AARCH32_SP` as BL32 image for AArch32 |
| 396 | ################################################################################ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 397 | ifeq (${ARCH},aarch32) |
| 398 | NEED_BL32 := yes |
dp-arm | a440900 | 2017-02-15 11:07:55 +0000 | [diff] [blame] | 399 | |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 400 | ifneq (${AARCH32_SP},none) |
| 401 | # We expect to locate an sp.mk under the specified AARCH32_SP directory |
| 402 | AARCH32_SP_MAKE := $(wildcard bl32/${AARCH32_SP}/${AARCH32_SP}.mk) |
dp-arm | a440900 | 2017-02-15 11:07:55 +0000 | [diff] [blame] | 403 | |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 404 | ifeq (${AARCH32_SP_MAKE},) |
| 405 | $(error Error: No bl32/${AARCH32_SP}/${AARCH32_SP}.mk located) |
| 406 | endif |
Juan Pablo Conde | 043f38f | 2023-08-09 13:19:21 -0500 | [diff] [blame] | 407 | $(info Including ${AARCH32_SP_MAKE}) |
| 408 | include ${AARCH32_SP_MAKE} |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 409 | endif |
| 410 | endif #(ARCH=aarch32) |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 411 | |
Juan Castillo | 73c99d4 | 2015-08-18 14:23:04 +0100 | [diff] [blame] | 412 | ################################################################################ |
Varun Wadekar | 77f1f7a | 2019-01-31 09:22:30 -0800 | [diff] [blame] | 413 | # Include libc if not overridden |
| 414 | ################################################################################ |
| 415 | ifeq (${OVERRIDE_LIBC},0) |
| 416 | include lib/libc/libc.mk |
| 417 | endif |
| 418 | |
Boyan Karatotev | 5d89341 | 2025-01-07 11:00:03 +0000 | [diff] [blame] | 419 | ifneq (${USE_GIC_DRIVER},0) |
| 420 | include drivers/arm/gic/gic.mk |
| 421 | endif |
| 422 | |
Varun Wadekar | 77f1f7a | 2019-01-31 09:22:30 -0800 | [diff] [blame] | 423 | ################################################################################ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 424 | # Check incompatible options and dependencies |
Antonio Nino Diaz | cf2c8a3 | 2016-02-15 14:53:10 +0000 | [diff] [blame] | 425 | ################################################################################ |
Boyan Karatotev | b14987c | 2025-04-09 14:41:58 +0100 | [diff] [blame] | 426 | include ${MAKE_HELPERS_DIRECTORY}constraints.mk |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 427 | |
| 428 | # The cert_create tool cannot generate certificates individually, so we use the |
| 429 | # target 'certificates' to create them all |
| 430 | ifneq (${GENERATE_COT},0) |
| 431 | FIP_DEPS += certificates |
| 432 | FWU_FIP_DEPS += fwu_certificates |
Antonio Nino Diaz | cf2c8a3 | 2016-02-15 14:53:10 +0000 | [diff] [blame] | 433 | endif |
| 434 | |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 435 | ifneq (${DECRYPTION_SUPPORT},none) |
| 436 | ENC_ARGS += -f ${FW_ENC_STATUS} |
| 437 | ENC_ARGS += -k ${ENC_KEY} |
| 438 | ENC_ARGS += -n ${ENC_NONCE} |
| 439 | FIP_DEPS += enctool |
| 440 | FWU_FIP_DEPS += enctool |
| 441 | endif #(DECRYPTION_SUPPORT) |
| 442 | |
Manish V Badarkhe | 2bf4f27 | 2022-06-20 15:32:38 +0100 | [diff] [blame] | 443 | ifeq ($(MEASURED_BOOT)-$(TRUSTED_BOARD_BOOT),1-1) |
| 444 | # Support authentication verification and hash calculation |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 445 | CRYPTO_SUPPORT := 3 |
Manish V Badarkhe | 2bf4f27 | 2022-06-20 15:32:38 +0100 | [diff] [blame] | 446 | else ifeq ($(DRTM_SUPPORT)-$(TRUSTED_BOARD_BOOT),1-1) |
| 447 | # Support authentication verification and hash calculation |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 448 | CRYPTO_SUPPORT := 3 |
Manish V Badarkhe | 2bf4f27 | 2022-06-20 15:32:38 +0100 | [diff] [blame] | 449 | else ifneq ($(filter 1,${MEASURED_BOOT} ${DRTM_SUPPORT}),) |
| 450 | # Support hash calculation only |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 451 | CRYPTO_SUPPORT := 2 |
Manish V Badarkhe | 2bf4f27 | 2022-06-20 15:32:38 +0100 | [diff] [blame] | 452 | else ifeq (${TRUSTED_BOARD_BOOT},1) |
| 453 | # Support authentication verification only |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 454 | CRYPTO_SUPPORT := 1 |
Manish V Badarkhe | c9c56f6 | 2022-01-08 22:56:06 +0000 | [diff] [blame] | 455 | else |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 456 | CRYPTO_SUPPORT := 0 |
| 457 | endif #($(MEASURED_BOOT)-$(TRUSTED_BOARD_BOOT)) |
Manish V Badarkhe | c9c56f6 | 2022-01-08 22:56:06 +0000 | [diff] [blame] | 458 | |
Manish V Badarkhe | e4a070e | 2024-12-03 21:46:51 +0000 | [diff] [blame] | 459 | ifneq ($(filter 1 2 3,$(CRYPTO_SUPPORT)),) |
| 460 | CRYPTO_LIB := $(BUILD_PLAT)/lib/libmbedtls.a |
| 461 | endif |
| 462 | |
Antonio Nino Diaz | cf2c8a3 | 2016-02-15 14:53:10 +0000 | [diff] [blame] | 463 | ################################################################################ |
Juan Castillo | 73c99d4 | 2015-08-18 14:23:04 +0100 | [diff] [blame] | 464 | # Process platform overrideable behaviour |
| 465 | ################################################################################ |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 466 | |
Manish Pandey | 5f24ce9 | 2021-10-06 10:59:52 +0100 | [diff] [blame] | 467 | ifdef BL1_SOURCES |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 468 | NEED_BL1 := yes |
| 469 | endif #(BL1_SOURCES) |
Manish Pandey | 5f24ce9 | 2021-10-06 10:59:52 +0100 | [diff] [blame] | 470 | |
Juan Castillo | 73c99d4 | 2015-08-18 14:23:04 +0100 | [diff] [blame] | 471 | ifdef BL2_SOURCES |
Manish Pandey | 5f24ce9 | 2021-10-06 10:59:52 +0100 | [diff] [blame] | 472 | NEED_BL2 := yes |
| 473 | |
| 474 | # Using BL2 implies that a BL33 image also needs to be supplied for the FIP and |
| 475 | # Certificate generation tools. This flag can be overridden by the platform. |
| 476 | ifdef EL3_PAYLOAD_BASE |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 477 | # If booting an EL3 payload there is no need for a BL33 image |
| 478 | # in the FIP file. |
| 479 | NEED_BL33 := no |
| 480 | else |
| 481 | ifdef PRELOADED_BL33_BASE |
| 482 | # If booting a BL33 preloaded image there is no need of |
| 483 | # another one in the FIP file. |
| 484 | NEED_BL33 := no |
| 485 | else |
| 486 | NEED_BL33 ?= yes |
| 487 | endif |
| 488 | endif |
| 489 | endif #(BL2_SOURCES) |
Juan Castillo | 73c99d4 | 2015-08-18 14:23:04 +0100 | [diff] [blame] | 490 | |
Manish Pandey | 5f24ce9 | 2021-10-06 10:59:52 +0100 | [diff] [blame] | 491 | ifdef BL2U_SOURCES |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 492 | NEED_BL2U := yes |
| 493 | endif #(BL2U_SOURCES) |
Manish Pandey | 5f24ce9 | 2021-10-06 10:59:52 +0100 | [diff] [blame] | 494 | |
Masahiro Yamada | 4d045d0 | 2017-04-05 19:11:41 +0900 | [diff] [blame] | 495 | # If SCP_BL2 is given, we always want FIP to include it. |
| 496 | ifdef SCP_BL2 |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 497 | NEED_SCP_BL2 := yes |
| 498 | endif #(SCP_BL2) |
Masahiro Yamada | 4d045d0 | 2017-04-05 19:11:41 +0900 | [diff] [blame] | 499 | |
Soby Mathew | 5744e87 | 2017-11-14 14:10:10 +0000 | [diff] [blame] | 500 | # For AArch32, BL31 is not currently supported. |
| 501 | ifneq (${ARCH},aarch32) |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 502 | ifdef BL31_SOURCES |
| 503 | # When booting an EL3 payload, there is no need to compile the BL31 |
| 504 | # image nor put it in the FIP. |
| 505 | ifndef EL3_PAYLOAD_BASE |
| 506 | NEED_BL31 := yes |
| 507 | endif |
| 508 | endif |
| 509 | endif #(ARCH=aarch64) |
Soby Mathew | 5744e87 | 2017-11-14 14:10:10 +0000 | [diff] [blame] | 510 | |
Juan Castillo | 73c99d4 | 2015-08-18 14:23:04 +0100 | [diff] [blame] | 511 | # Process TBB related flags |
| 512 | ifneq (${GENERATE_COT},0) |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 513 | # Common cert_create options |
| 514 | ifneq (${CREATE_KEYS},0) |
Juan Castillo | 73c99d4 | 2015-08-18 14:23:04 +0100 | [diff] [blame] | 515 | $(eval CRT_ARGS += -n) |
Yatharth Kochar | 0191262 | 2015-10-12 12:33:47 +0100 | [diff] [blame] | 516 | $(eval FWU_CRT_ARGS += -n) |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 517 | ifneq (${SAVE_KEYS},0) |
Juan Castillo | 73c99d4 | 2015-08-18 14:23:04 +0100 | [diff] [blame] | 518 | $(eval CRT_ARGS += -k) |
Yatharth Kochar | 0191262 | 2015-10-12 12:33:47 +0100 | [diff] [blame] | 519 | $(eval FWU_CRT_ARGS += -k) |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 520 | endif |
| 521 | endif |
| 522 | # Include TBBR makefile (unless the platform indicates otherwise) |
| 523 | ifeq (${INCLUDE_TBBR_MK},1) |
Juan Castillo | 73c99d4 | 2015-08-18 14:23:04 +0100 | [diff] [blame] | 524 | include make_helpers/tbbr/tbbr_tools.mk |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 525 | endif |
| 526 | endif #(GENERATE_COT) |
Juan Castillo | 73c99d4 | 2015-08-18 14:23:04 +0100 | [diff] [blame] | 527 | |
Masahiro Yamada | 1c75d5d | 2016-12-25 13:52:22 +0900 | [diff] [blame] | 528 | ifneq (${FIP_ALIGN},0) |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 529 | FIP_ARGS += --align ${FIP_ALIGN} |
| 530 | endif #(FIP_ALIGN) |
Masahiro Yamada | 1c75d5d | 2016-12-25 13:52:22 +0900 | [diff] [blame] | 531 | |
Manish Pandey | 5f24ce9 | 2021-10-06 10:59:52 +0100 | [diff] [blame] | 532 | ifdef FDT_SOURCES |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 533 | NEED_FDT := yes |
| 534 | endif #(FDT_SOURCES) |
Manish Pandey | 5f24ce9 | 2021-10-06 10:59:52 +0100 | [diff] [blame] | 535 | |
Juan Castillo | 73c99d4 | 2015-08-18 14:23:04 +0100 | [diff] [blame] | 536 | ################################################################################ |
Michalis Pappas | 46e5e03 | 2018-03-20 13:01:27 +0800 | [diff] [blame] | 537 | # Include libraries' Makefile that are used in all BL |
| 538 | ################################################################################ |
| 539 | |
| 540 | include lib/stack_protector/stack_protector.mk |
| 541 | |
| 542 | ################################################################################ |
Soby Mathew | 8a86052 | 2017-02-14 10:05:07 +0000 | [diff] [blame] | 543 | # Include BL specific makefiles |
| 544 | ################################################################################ |
Manish Pandey | 5f24ce9 | 2021-10-06 10:59:52 +0100 | [diff] [blame] | 545 | |
| 546 | ifeq (${NEED_BL1},yes) |
Soby Mathew | 8a86052 | 2017-02-14 10:05:07 +0000 | [diff] [blame] | 547 | include bl1/bl1.mk |
| 548 | endif |
| 549 | |
Manish Pandey | 5f24ce9 | 2021-10-06 10:59:52 +0100 | [diff] [blame] | 550 | ifeq (${NEED_BL2},yes) |
Soby Mathew | 8a86052 | 2017-02-14 10:05:07 +0000 | [diff] [blame] | 551 | include bl2/bl2.mk |
| 552 | endif |
| 553 | |
Manish Pandey | 5f24ce9 | 2021-10-06 10:59:52 +0100 | [diff] [blame] | 554 | ifeq (${NEED_BL2U},yes) |
Soby Mathew | 8a86052 | 2017-02-14 10:05:07 +0000 | [diff] [blame] | 555 | include bl2u/bl2u.mk |
| 556 | endif |
| 557 | |
Soby Mathew | 5744e87 | 2017-11-14 14:10:10 +0000 | [diff] [blame] | 558 | ifeq (${NEED_BL31},yes) |
Soby Mathew | 8a86052 | 2017-02-14 10:05:07 +0000 | [diff] [blame] | 559 | include bl31/bl31.mk |
| 560 | endif |
Nishanth Menon | 03b397a | 2016-10-14 01:13:57 +0000 | [diff] [blame] | 561 | |
Juan Castillo | 73c99d4 | 2015-08-18 14:23:04 +0100 | [diff] [blame] | 562 | ################################################################################ |
| 563 | # Build options checks |
| 564 | ################################################################################ |
Juan Castillo | b7124ea | 2014-11-04 17:36:40 +0000 | [diff] [blame] | 565 | |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 566 | # Boolean_Flags |
Leonardo Sandoval | 327131c | 2020-09-10 12:18:27 -0500 | [diff] [blame] | 567 | $(eval $(call assert_booleans,\ |
| 568 | $(sort \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 569 | ALLOW_RO_XLAT_TABLES \ |
| 570 | BL2_ENABLE_SP_LOAD \ |
| 571 | COLD_BOOT_SINGLE_CPU \ |
| 572 | CREATE_KEYS \ |
| 573 | CTX_INCLUDE_AARCH32_REGS \ |
| 574 | CTX_INCLUDE_FPREGS \ |
Madhukar Pappireddy | 4242262 | 2024-06-17 15:17:03 -0500 | [diff] [blame] | 575 | CTX_INCLUDE_SVE_REGS \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 576 | CTX_INCLUDE_EL2_REGS \ |
Arvind Ram Prakash | 9acff28 | 2023-10-06 14:35:21 -0500 | [diff] [blame] | 577 | CTX_INCLUDE_MPAM_REGS \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 578 | DEBUG \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 579 | DYN_DISABLE_AUTH \ |
| 580 | EL3_EXCEPTION_HANDLING \ |
| 581 | ENABLE_AMU_AUXILIARY_COUNTERS \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 582 | AMU_RESTRICT_COUNTERS \ |
| 583 | ENABLE_ASSERTIONS \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 584 | ENABLE_PIE \ |
| 585 | ENABLE_PMF \ |
| 586 | ENABLE_PSCI_STAT \ |
| 587 | ENABLE_RUNTIME_INSTRUMENTATION \ |
| 588 | ENABLE_SME_FOR_SWD \ |
| 589 | ENABLE_SVE_FOR_SWD \ |
Boyan Karatotev | 8cef63d | 2025-01-07 11:26:56 +0000 | [diff] [blame] | 590 | ENABLE_FEAT_GCIE \ |
Manish Pandey | 970a4a8 | 2023-10-10 13:53:25 +0100 | [diff] [blame] | 591 | ENABLE_FEAT_RAS \ |
Manish Pandey | f87e54f | 2023-10-10 15:42:19 +0100 | [diff] [blame] | 592 | FFH_SUPPORT \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 593 | ERROR_DEPRECATED \ |
| 594 | FAULT_INJECTION_SUPPORT \ |
| 595 | GENERATE_COT \ |
| 596 | GICV2_G0_FOR_EL3 \ |
| 597 | HANDLE_EA_EL3_FIRST_NS \ |
Bipin Ravi | 538516f | 2023-09-28 13:17:24 -0500 | [diff] [blame] | 598 | HARDEN_SLS \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 599 | HW_ASSISTED_COHERENCY \ |
| 600 | MEASURED_BOOT \ |
Abhi.Singh | 36e3d87 | 2024-08-28 14:17:52 -0500 | [diff] [blame] | 601 | DISCRETE_TPM \ |
Tamas Ban | e7f1181 | 2023-06-07 13:35:04 +0200 | [diff] [blame] | 602 | DICE_PROTECTION_ENVIRONMENT \ |
Raghu Krishnamurthy | 6a88ec8 | 2024-06-03 19:02:29 -0700 | [diff] [blame] | 603 | RMMD_ENABLE_EL3_TOKEN_SIGN \ |
Sona Mathew | 2132c70 | 2025-03-14 01:27:11 -0500 | [diff] [blame] | 604 | RMMD_ENABLE_IDE_KEY_PROG \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 605 | DRTM_SUPPORT \ |
| 606 | NS_TIMER_SWITCH \ |
| 607 | OVERRIDE_LIBC \ |
| 608 | PL011_GENERIC_UART \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 609 | PROGRAMMABLE_RESET_ADDRESS \ |
| 610 | PSCI_EXTENDED_STATE_ID \ |
| 611 | PSCI_OS_INIT_MODE \ |
Boyan Karatotev | 8db1705 | 2024-10-25 11:38:41 +0100 | [diff] [blame] | 612 | ARCH_FEATURE_AVAILABILITY \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 613 | RESET_TO_BL31 \ |
| 614 | SAVE_KEYS \ |
| 615 | SEPARATE_CODE_AND_RODATA \ |
| 616 | SEPARATE_BL2_NOLOAD_REGION \ |
| 617 | SEPARATE_NOBITS_REGION \ |
Ye Li | 86acbbe | 2022-08-26 13:48:31 +0800 | [diff] [blame] | 618 | SEPARATE_RWDATA_REGION \ |
Madhukar Pappireddy | 308ebfa | 2024-06-17 15:26:00 -0500 | [diff] [blame] | 619 | SEPARATE_SIMD_SECTION \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 620 | SPIN_ON_BL1_EXIT \ |
| 621 | SPM_MM \ |
| 622 | SPMC_AT_EL3 \ |
Nishant Sharma | 801cd3c | 2023-06-27 00:36:01 +0100 | [diff] [blame] | 623 | SPMC_AT_EL3_SEL0_SP \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 624 | SPMD_SPM_AT_SEL2 \ |
Raghu Krishnamurthy | 890b508 | 2023-02-25 13:26:10 -0800 | [diff] [blame] | 625 | ENABLE_SPMD_LP \ |
Raymond Mao | 3ba2c15 | 2023-07-25 07:53:35 -0700 | [diff] [blame] | 626 | TRANSFER_LIST \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 627 | TRUSTED_BOARD_BOOT \ |
| 628 | USE_COHERENT_MEM \ |
| 629 | USE_DEBUGFS \ |
| 630 | ARM_IO_IN_DTB \ |
| 631 | SDEI_IN_FCONF \ |
| 632 | SEC_INT_DESC_IN_FCONF \ |
| 633 | USE_ROMLIB \ |
| 634 | USE_TBBR_DEFS \ |
| 635 | WARMBOOT_ENABLE_DCACHE_EARLY \ |
| 636 | RESET_TO_BL2 \ |
| 637 | BL2_IN_XIP_MEM \ |
| 638 | BL2_INV_DCACHE \ |
| 639 | USE_SPINLOCK_CAS \ |
| 640 | ENCRYPT_BL31 \ |
| 641 | ENCRYPT_BL32 \ |
| 642 | ERRATA_SPECULATIVE_AT \ |
Boyan Karatotev | 45c7328 | 2024-09-20 13:37:51 +0100 | [diff] [blame] | 643 | ERRATA_SME_POWER_DOWN \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 644 | RAS_TRAP_NS_ERR_REC_ACCESS \ |
| 645 | COT_DESC_IN_DTB \ |
| 646 | USE_SP804_TIMER \ |
| 647 | PSA_FWU_SUPPORT \ |
Sughosh Ganu | 11d05a7 | 2024-02-01 12:51:20 +0530 | [diff] [blame] | 648 | PSA_FWU_METADATA_FW_STORE_DESC \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 649 | ENABLE_MPMM \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 650 | FEATURE_DETECTION \ |
Jayanth Dodderi Chidanand | 0b22e59 | 2022-10-11 17:16:07 +0100 | [diff] [blame] | 651 | TRNG_SUPPORT \ |
Boyan Karatotev | 593ae35 | 2023-03-22 15:55:36 +0000 | [diff] [blame] | 652 | ENABLE_ERRATA_ALL \ |
Sona Mathew | ffea384 | 2022-11-18 18:05:38 -0600 | [diff] [blame] | 653 | ERRATA_ABI_SUPPORT \ |
Sona Mathew | ef63f5b | 2023-03-14 14:02:03 -0500 | [diff] [blame] | 654 | ERRATA_NON_ARM_INTERCONNECT \ |
Okash Khawaja | 04c7303 | 2022-11-04 12:38:01 +0000 | [diff] [blame] | 655 | CONDITIONAL_CMO \ |
Manish V Badarkhe | 5782b89 | 2023-09-06 09:08:28 +0100 | [diff] [blame] | 656 | PSA_CRYPTO \ |
Sandrine Bailleux | 85bebe1 | 2023-10-11 08:38:00 +0200 | [diff] [blame] | 657 | ENABLE_CONSOLE_GETC \ |
Arvind Ram Prakash | 183329a | 2023-08-15 16:28:06 -0500 | [diff] [blame] | 658 | INIT_UNUSED_NS_EL2 \ |
Juan Pablo Conde | bfef8b9 | 2023-11-08 16:14:28 -0600 | [diff] [blame] | 659 | PLATFORM_REPORT_CTX_MEM_USE \ |
Yann Gautier | ae770fe | 2024-01-16 19:39:31 +0100 | [diff] [blame] | 660 | EARLY_CONSOLE \ |
Arvind Ram Prakash | f99a69c | 2023-12-21 00:25:52 -0600 | [diff] [blame] | 661 | PRESERVE_DSU_PMU_REGS \ |
Levi Yun | 8953568 | 2024-05-13 10:24:31 +0100 | [diff] [blame] | 662 | HOB_LIST \ |
Manish V Badarkhe | cf48f49 | 2025-04-15 20:16:32 +0100 | [diff] [blame] | 663 | LFA_SUPPORT \ |
Leonardo Sandoval | 327131c | 2020-09-10 12:18:27 -0500 | [diff] [blame] | 664 | ))) |
Juan Castillo | 73c99d4 | 2015-08-18 14:23:04 +0100 | [diff] [blame] | 665 | |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 666 | # Numeric_Flags |
Leonardo Sandoval | 327131c | 2020-09-10 12:18:27 -0500 | [diff] [blame] | 667 | $(eval $(call assert_numerics,\ |
| 668 | $(sort \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 669 | ARM_ARCH_MAJOR \ |
| 670 | ARM_ARCH_MINOR \ |
| 671 | BRANCH_PROTECTION \ |
| 672 | CTX_INCLUDE_PAUTH_REGS \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 673 | CTX_INCLUDE_NEVE_REGS \ |
| 674 | CRYPTO_SUPPORT \ |
Boyan Karatotev | 83a4dae | 2023-02-16 09:45:29 +0000 | [diff] [blame] | 675 | DISABLE_MTPMU \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 676 | ENABLE_BRBE_FOR_NS \ |
| 677 | ENABLE_TRBE_FOR_NS \ |
| 678 | ENABLE_BTI \ |
| 679 | ENABLE_PAUTH \ |
John Powell | 025b1b8 | 2025-03-10 20:09:03 -0500 | [diff] [blame] | 680 | ENABLE_FEAT_PAUTH_LR \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 681 | ENABLE_FEAT_AMU \ |
| 682 | ENABLE_FEAT_AMUv1p1 \ |
| 683 | ENABLE_FEAT_CSV2_2 \ |
Sona Mathew | 30019d8 | 2023-10-25 16:48:19 -0500 | [diff] [blame] | 684 | ENABLE_FEAT_CSV2_3 \ |
Arvind Ram Prakash | 83271d5 | 2024-05-22 15:24:00 -0500 | [diff] [blame] | 685 | ENABLE_FEAT_DEBUGV8P9 \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 686 | ENABLE_FEAT_DIT \ |
| 687 | ENABLE_FEAT_ECV \ |
| 688 | ENABLE_FEAT_FGT \ |
Arvind Ram Prakash | 33e6aaa | 2024-06-06 11:33:37 -0500 | [diff] [blame] | 689 | ENABLE_FEAT_FGT2 \ |
Arvind Ram Prakash | 4274b52 | 2025-06-23 15:21:44 -0500 | [diff] [blame] | 690 | ENABLE_FEAT_FGWTE3 \ |
Arvind Ram Prakash | a57e18e | 2024-11-11 14:32:37 -0600 | [diff] [blame] | 691 | ENABLE_FEAT_FPMR \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 692 | ENABLE_FEAT_HCX \ |
Andre Przywara | 19d52a8 | 2024-08-09 17:04:22 +0100 | [diff] [blame] | 693 | ENABLE_FEAT_LS64_ACCDATA \ |
Tushar Khandelwal | 7e84f3c | 2024-03-15 15:00:29 +0000 | [diff] [blame] | 694 | ENABLE_FEAT_MEC \ |
Arvind Ram Prakash | 6b8df7b | 2025-01-09 17:18:30 -0600 | [diff] [blame] | 695 | ENABLE_FEAT_MOPS \ |
Govindraj Raja | 8e39788 | 2024-01-26 10:08:37 -0600 | [diff] [blame] | 696 | ENABLE_FEAT_MTE2 \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 697 | ENABLE_FEAT_PAN \ |
| 698 | ENABLE_FEAT_RNG \ |
| 699 | ENABLE_FEAT_RNG_TRAP \ |
| 700 | ENABLE_FEAT_SEL2 \ |
| 701 | ENABLE_FEAT_TCR2 \ |
Jayanth Dodderi Chidanand | 6d0433f | 2024-09-05 22:24:04 +0100 | [diff] [blame] | 702 | ENABLE_FEAT_THE \ |
Govindraj Raja | 0e4daed | 2024-01-23 16:03:53 -0600 | [diff] [blame] | 703 | ENABLE_FEAT_SB \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 704 | ENABLE_FEAT_S2PIE \ |
| 705 | ENABLE_FEAT_S1PIE \ |
| 706 | ENABLE_FEAT_S2POE \ |
| 707 | ENABLE_FEAT_S1POE \ |
Jayanth Dodderi Chidanand | 4ec4e54 | 2024-09-06 13:49:31 +0100 | [diff] [blame] | 708 | ENABLE_FEAT_SCTLR2 \ |
Govindraj Raja | 3065513 | 2024-09-06 15:43:43 +0100 | [diff] [blame] | 709 | ENABLE_FEAT_D128 \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 710 | ENABLE_FEAT_GCS \ |
| 711 | ENABLE_FEAT_VHE \ |
Arvind Ram Prakash | edebefb | 2023-10-11 12:10:56 -0500 | [diff] [blame] | 712 | ENABLE_FEAT_MPAM \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 713 | ENABLE_RME \ |
| 714 | ENABLE_SPE_FOR_NS \ |
| 715 | ENABLE_SYS_REG_TRACE_FOR_NS \ |
| 716 | ENABLE_SME_FOR_NS \ |
| 717 | ENABLE_SME2_FOR_NS \ |
| 718 | ENABLE_SVE_FOR_NS \ |
| 719 | ENABLE_TRF_FOR_NS \ |
| 720 | FW_ENC_STATUS \ |
| 721 | NR_OF_FW_BANKS \ |
| 722 | NR_OF_IMAGES_IN_FW_BANK \ |
| 723 | TWED_DELAY \ |
| 724 | ENABLE_FEAT_TWED \ |
| 725 | SVE_VECTOR_LEN \ |
Varun Wadekar | 0ed3be6 | 2023-04-13 21:06:18 +0100 | [diff] [blame] | 726 | IMPDEF_SYSREG_TRAP \ |
Boyan Karatotev | ee580c2 | 2025-04-11 14:27:55 +0100 | [diff] [blame] | 727 | W \ |
Leonardo Sandoval | 327131c | 2020-09-10 12:18:27 -0500 | [diff] [blame] | 728 | ))) |
Jeenu Viswambharan | c877b41 | 2017-01-16 16:52:35 +0000 | [diff] [blame] | 729 | |
Justin Chadwell | aacff74 | 2019-07-29 17:13:10 +0100 | [diff] [blame] | 730 | ifdef KEY_SIZE |
| 731 | $(eval $(call assert_numeric,KEY_SIZE)) |
| 732 | endif |
| 733 | |
Justin Chadwell | 1f46197 | 2019-08-20 11:01:52 +0100 | [diff] [blame] | 734 | ifeq ($(filter $(SANITIZE_UB), on off trap),) |
| 735 | $(error "Invalid value for SANITIZE_UB: can be one of on, off, trap") |
| 736 | endif |
| 737 | |
Juan Castillo | 73c99d4 | 2015-08-18 14:23:04 +0100 | [diff] [blame] | 738 | ################################################################################ |
| 739 | # Add definitions to the cpp preprocessor based on the current build options. |
| 740 | # This is done after including the platform specific makefile to allow the |
| 741 | # platform to overwrite the default options |
| 742 | ################################################################################ |
| 743 | |
Leonardo Sandoval | 327131c | 2020-09-10 12:18:27 -0500 | [diff] [blame] | 744 | $(eval $(call add_defines,\ |
| 745 | $(sort \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 746 | ALLOW_RO_XLAT_TABLES \ |
| 747 | ARM_ARCH_MAJOR \ |
| 748 | ARM_ARCH_MINOR \ |
| 749 | BL2_ENABLE_SP_LOAD \ |
| 750 | COLD_BOOT_SINGLE_CPU \ |
| 751 | CTX_INCLUDE_AARCH32_REGS \ |
| 752 | CTX_INCLUDE_FPREGS \ |
Madhukar Pappireddy | 4242262 | 2024-06-17 15:17:03 -0500 | [diff] [blame] | 753 | CTX_INCLUDE_SVE_REGS \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 754 | CTX_INCLUDE_PAUTH_REGS \ |
Arvind Ram Prakash | 9acff28 | 2023-10-06 14:35:21 -0500 | [diff] [blame] | 755 | CTX_INCLUDE_MPAM_REGS \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 756 | EL3_EXCEPTION_HANDLING \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 757 | CTX_INCLUDE_EL2_REGS \ |
| 758 | CTX_INCLUDE_NEVE_REGS \ |
Boyan Karatotev | ee580c2 | 2025-04-11 14:27:55 +0100 | [diff] [blame] | 759 | DEBUG \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 760 | DECRYPTION_SUPPORT_${DECRYPTION_SUPPORT} \ |
| 761 | DISABLE_MTPMU \ |
| 762 | ENABLE_FEAT_AMU \ |
| 763 | ENABLE_AMU_AUXILIARY_COUNTERS \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 764 | AMU_RESTRICT_COUNTERS \ |
| 765 | ENABLE_ASSERTIONS \ |
| 766 | ENABLE_BTI \ |
Arvind Ram Prakash | 83271d5 | 2024-05-22 15:24:00 -0500 | [diff] [blame] | 767 | ENABLE_FEAT_DEBUGV8P9 \ |
Arvind Ram Prakash | edebefb | 2023-10-11 12:10:56 -0500 | [diff] [blame] | 768 | ENABLE_FEAT_MPAM \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 769 | ENABLE_PAUTH \ |
John Powell | 025b1b8 | 2025-03-10 20:09:03 -0500 | [diff] [blame] | 770 | ENABLE_FEAT_PAUTH_LR \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 771 | ENABLE_PIE \ |
| 772 | ENABLE_PMF \ |
| 773 | ENABLE_PSCI_STAT \ |
| 774 | ENABLE_RME \ |
Raghu Krishnamurthy | 6a88ec8 | 2024-06-03 19:02:29 -0700 | [diff] [blame] | 775 | RMMD_ENABLE_EL3_TOKEN_SIGN \ |
Sona Mathew | 2132c70 | 2025-03-14 01:27:11 -0500 | [diff] [blame] | 776 | RMMD_ENABLE_IDE_KEY_PROG \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 777 | ENABLE_RUNTIME_INSTRUMENTATION \ |
| 778 | ENABLE_SME_FOR_NS \ |
| 779 | ENABLE_SME2_FOR_NS \ |
| 780 | ENABLE_SME_FOR_SWD \ |
| 781 | ENABLE_SPE_FOR_NS \ |
| 782 | ENABLE_SVE_FOR_NS \ |
| 783 | ENABLE_SVE_FOR_SWD \ |
Manish Pandey | 970a4a8 | 2023-10-10 13:53:25 +0100 | [diff] [blame] | 784 | ENABLE_FEAT_RAS \ |
Manish Pandey | f87e54f | 2023-10-10 15:42:19 +0100 | [diff] [blame] | 785 | FFH_SUPPORT \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 786 | ENCRYPT_BL31 \ |
| 787 | ENCRYPT_BL32 \ |
| 788 | ERROR_DEPRECATED \ |
| 789 | FAULT_INJECTION_SUPPORT \ |
| 790 | GICV2_G0_FOR_EL3 \ |
| 791 | HANDLE_EA_EL3_FIRST_NS \ |
| 792 | HW_ASSISTED_COHERENCY \ |
| 793 | LOG_LEVEL \ |
| 794 | MEASURED_BOOT \ |
Abhi.Singh | 36e3d87 | 2024-08-28 14:17:52 -0500 | [diff] [blame] | 795 | DISCRETE_TPM \ |
Tamas Ban | e7f1181 | 2023-06-07 13:35:04 +0200 | [diff] [blame] | 796 | DICE_PROTECTION_ENVIRONMENT \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 797 | DRTM_SUPPORT \ |
| 798 | NS_TIMER_SWITCH \ |
| 799 | PL011_GENERIC_UART \ |
| 800 | PLAT_${PLAT} \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 801 | PROGRAMMABLE_RESET_ADDRESS \ |
| 802 | PSCI_EXTENDED_STATE_ID \ |
| 803 | PSCI_OS_INIT_MODE \ |
Boyan Karatotev | 8db1705 | 2024-10-25 11:38:41 +0100 | [diff] [blame] | 804 | ARCH_FEATURE_AVAILABILITY \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 805 | RESET_TO_BL31 \ |
AlexeiFedorov | d766084 | 2024-05-13 15:35:54 +0100 | [diff] [blame] | 806 | RME_GPT_BITLOCK_BLOCK \ |
AlexeiFedorov | ec0088b | 2024-03-13 17:07:03 +0000 | [diff] [blame] | 807 | RME_GPT_MAX_BLOCK \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 808 | SEPARATE_CODE_AND_RODATA \ |
| 809 | SEPARATE_BL2_NOLOAD_REGION \ |
| 810 | SEPARATE_NOBITS_REGION \ |
Ye Li | 86acbbe | 2022-08-26 13:48:31 +0800 | [diff] [blame] | 811 | SEPARATE_RWDATA_REGION \ |
Madhukar Pappireddy | 308ebfa | 2024-06-17 15:26:00 -0500 | [diff] [blame] | 812 | SEPARATE_SIMD_SECTION \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 813 | RECLAIM_INIT_CODE \ |
| 814 | SPD_${SPD} \ |
| 815 | SPIN_ON_BL1_EXIT \ |
| 816 | SPM_MM \ |
| 817 | SPMC_AT_EL3 \ |
Nishant Sharma | 801cd3c | 2023-06-27 00:36:01 +0100 | [diff] [blame] | 818 | SPMC_AT_EL3_SEL0_SP \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 819 | SPMD_SPM_AT_SEL2 \ |
Raymond Mao | 3ba2c15 | 2023-07-25 07:53:35 -0700 | [diff] [blame] | 820 | TRANSFER_LIST \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 821 | TRUSTED_BOARD_BOOT \ |
| 822 | CRYPTO_SUPPORT \ |
| 823 | TRNG_SUPPORT \ |
| 824 | ERRATA_ABI_SUPPORT \ |
Sona Mathew | ef63f5b | 2023-03-14 14:02:03 -0500 | [diff] [blame] | 825 | ERRATA_NON_ARM_INTERCONNECT \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 826 | USE_COHERENT_MEM \ |
| 827 | USE_DEBUGFS \ |
| 828 | ARM_IO_IN_DTB \ |
| 829 | SDEI_IN_FCONF \ |
| 830 | SEC_INT_DESC_IN_FCONF \ |
| 831 | USE_ROMLIB \ |
| 832 | USE_TBBR_DEFS \ |
| 833 | WARMBOOT_ENABLE_DCACHE_EARLY \ |
| 834 | RESET_TO_BL2 \ |
| 835 | BL2_RUNS_AT_EL3 \ |
| 836 | BL2_IN_XIP_MEM \ |
| 837 | BL2_INV_DCACHE \ |
| 838 | USE_SPINLOCK_CAS \ |
| 839 | ERRATA_SPECULATIVE_AT \ |
Boyan Karatotev | 45c7328 | 2024-09-20 13:37:51 +0100 | [diff] [blame] | 840 | ERRATA_SME_POWER_DOWN \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 841 | RAS_TRAP_NS_ERR_REC_ACCESS \ |
| 842 | COT_DESC_IN_DTB \ |
| 843 | USE_SP804_TIMER \ |
| 844 | ENABLE_FEAT_RNG \ |
| 845 | ENABLE_FEAT_RNG_TRAP \ |
| 846 | ENABLE_FEAT_SB \ |
| 847 | ENABLE_FEAT_DIT \ |
| 848 | NR_OF_FW_BANKS \ |
| 849 | NR_OF_IMAGES_IN_FW_BANK \ |
| 850 | PSA_FWU_SUPPORT \ |
Sughosh Ganu | 11d05a7 | 2024-02-01 12:51:20 +0530 | [diff] [blame] | 851 | PSA_FWU_METADATA_FW_STORE_DESC \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 852 | ENABLE_BRBE_FOR_NS \ |
| 853 | ENABLE_TRBE_FOR_NS \ |
| 854 | ENABLE_SYS_REG_TRACE_FOR_NS \ |
| 855 | ENABLE_TRF_FOR_NS \ |
| 856 | ENABLE_FEAT_HCX \ |
| 857 | ENABLE_MPMM \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 858 | ENABLE_FEAT_FGT \ |
Arvind Ram Prakash | 33e6aaa | 2024-06-06 11:33:37 -0500 | [diff] [blame] | 859 | ENABLE_FEAT_FGT2 \ |
Arvind Ram Prakash | 4274b52 | 2025-06-23 15:21:44 -0500 | [diff] [blame] | 860 | ENABLE_FEAT_FGWTE3 \ |
Arvind Ram Prakash | a57e18e | 2024-11-11 14:32:37 -0600 | [diff] [blame] | 861 | ENABLE_FEAT_FPMR \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 862 | ENABLE_FEAT_ECV \ |
| 863 | ENABLE_FEAT_AMUv1p1 \ |
| 864 | ENABLE_FEAT_SEL2 \ |
| 865 | ENABLE_FEAT_VHE \ |
| 866 | ENABLE_FEAT_CSV2_2 \ |
Sona Mathew | 30019d8 | 2023-10-25 16:48:19 -0500 | [diff] [blame] | 867 | ENABLE_FEAT_CSV2_3 \ |
Andre Przywara | 19d52a8 | 2024-08-09 17:04:22 +0100 | [diff] [blame] | 868 | ENABLE_FEAT_LS64_ACCDATA \ |
Tushar Khandelwal | 7e84f3c | 2024-03-15 15:00:29 +0000 | [diff] [blame] | 869 | ENABLE_FEAT_MEC \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 870 | ENABLE_FEAT_PAN \ |
| 871 | ENABLE_FEAT_TCR2 \ |
Jayanth Dodderi Chidanand | 6d0433f | 2024-09-05 22:24:04 +0100 | [diff] [blame] | 872 | ENABLE_FEAT_THE \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 873 | ENABLE_FEAT_S2PIE \ |
| 874 | ENABLE_FEAT_S1PIE \ |
| 875 | ENABLE_FEAT_S2POE \ |
| 876 | ENABLE_FEAT_S1POE \ |
Jayanth Dodderi Chidanand | 4ec4e54 | 2024-09-06 13:49:31 +0100 | [diff] [blame] | 877 | ENABLE_FEAT_SCTLR2 \ |
Govindraj Raja | 3065513 | 2024-09-06 15:43:43 +0100 | [diff] [blame] | 878 | ENABLE_FEAT_D128 \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 879 | ENABLE_FEAT_GCS \ |
Arvind Ram Prakash | 6b8df7b | 2025-01-09 17:18:30 -0600 | [diff] [blame] | 880 | ENABLE_FEAT_MOPS \ |
Boyan Karatotev | 8cef63d | 2025-01-07 11:26:56 +0000 | [diff] [blame] | 881 | ENABLE_FEAT_GCIE \ |
Govindraj Raja | 8e39788 | 2024-01-26 10:08:37 -0600 | [diff] [blame] | 882 | ENABLE_FEAT_MTE2 \ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 883 | FEATURE_DETECTION \ |
| 884 | TWED_DELAY \ |
| 885 | ENABLE_FEAT_TWED \ |
Okash Khawaja | 04c7303 | 2022-11-04 12:38:01 +0000 | [diff] [blame] | 886 | CONDITIONAL_CMO \ |
Varun Wadekar | 0ed3be6 | 2023-04-13 21:06:18 +0100 | [diff] [blame] | 887 | IMPDEF_SYSREG_TRAP \ |
Jayanth Dodderi Chidanand | a8cf6fa | 2023-04-26 15:57:30 +0100 | [diff] [blame] | 888 | SVE_VECTOR_LEN \ |
Raghu Krishnamurthy | 890b508 | 2023-02-25 13:26:10 -0800 | [diff] [blame] | 889 | ENABLE_SPMD_LP \ |
Manish V Badarkhe | 5782b89 | 2023-09-06 09:08:28 +0100 | [diff] [blame] | 890 | PSA_CRYPTO \ |
Sandrine Bailleux | 85bebe1 | 2023-10-11 08:38:00 +0200 | [diff] [blame] | 891 | ENABLE_CONSOLE_GETC \ |
Arvind Ram Prakash | 183329a | 2023-08-15 16:28:06 -0500 | [diff] [blame] | 892 | INIT_UNUSED_NS_EL2 \ |
Juan Pablo Conde | bfef8b9 | 2023-11-08 16:14:28 -0600 | [diff] [blame] | 893 | PLATFORM_REPORT_CTX_MEM_USE \ |
Yann Gautier | ae770fe | 2024-01-16 19:39:31 +0100 | [diff] [blame] | 894 | EARLY_CONSOLE \ |
Arvind Ram Prakash | f99a69c | 2023-12-21 00:25:52 -0600 | [diff] [blame] | 895 | PRESERVE_DSU_PMU_REGS \ |
Levi Yun | 8953568 | 2024-05-13 10:24:31 +0100 | [diff] [blame] | 896 | HOB_LIST \ |
Manish V Badarkhe | cf48f49 | 2025-04-15 20:16:32 +0100 | [diff] [blame] | 897 | LFA_SUPPORT \ |
Leonardo Sandoval | 327131c | 2020-09-10 12:18:27 -0500 | [diff] [blame] | 898 | ))) |
Jeenu Viswambharan | 2fae4b1 | 2016-10-24 14:31:51 +0100 | [diff] [blame] | 899 | |
Juan Pablo Conde | bfef8b9 | 2023-11-08 16:14:28 -0600 | [diff] [blame] | 900 | ifeq (${PLATFORM_REPORT_CTX_MEM_USE}, 1) |
| 901 | ifeq (${DEBUG}, 0) |
| 902 | $(warning "PLATFORM_REPORT_CTX_MEM_USE can be applied when DEBUG=1 only") |
| 903 | override PLATFORM_REPORT_CTX_MEM_USE := 0 |
| 904 | endif |
| 905 | endif |
| 906 | |
Justin Chadwell | 1f46197 | 2019-08-20 11:01:52 +0100 | [diff] [blame] | 907 | ifeq (${SANITIZE_UB},trap) |
| 908 | $(eval $(call add_define,MONITOR_TRAPS)) |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 909 | endif #(SANITIZE_UB) |
Justin Chadwell | 1f46197 | 2019-08-20 11:01:52 +0100 | [diff] [blame] | 910 | |
Sandrine Bailleux | 4c117f6 | 2015-11-26 16:31:34 +0000 | [diff] [blame] | 911 | # Define the EL3_PAYLOAD_BASE flag only if it is provided. |
| 912 | ifdef EL3_PAYLOAD_BASE |
Antonio Nino Diaz | cf2c8a3 | 2016-02-15 14:53:10 +0000 | [diff] [blame] | 913 | $(eval $(call add_define,EL3_PAYLOAD_BASE)) |
| 914 | else |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 915 | # Define the PRELOADED_BL33_BASE flag only if it is provided and |
| 916 | # EL3_PAYLOAD_BASE is not defined, as it has priority. |
| 917 | ifdef PRELOADED_BL33_BASE |
Antonio Nino Diaz | 68450a6 | 2016-04-06 17:31:57 +0100 | [diff] [blame] | 918 | $(eval $(call add_define,PRELOADED_BL33_BASE)) |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 919 | endif |
| 920 | endif #(EL3_PAYLOAD_BASE) |
Juan Castillo | 73c99d4 | 2015-08-18 14:23:04 +0100 | [diff] [blame] | 921 | |
Soby Mathew | 209a60c | 2018-03-26 12:43:37 +0100 | [diff] [blame] | 922 | # Define the DYN_DISABLE_AUTH flag only if set. |
| 923 | ifeq (${DYN_DISABLE_AUTH},1) |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 924 | $(eval $(call add_define,DYN_DISABLE_AUTH)) |
Soby Mathew | 209a60c | 2018-03-26 12:43:37 +0100 | [diff] [blame] | 925 | endif |
| 926 | |
Chris Kay | 8620bd0 | 2023-12-04 09:55:50 +0000 | [diff] [blame] | 927 | ifeq ($($(ARCH)-ld-id),arm-link) |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 928 | $(eval $(call add_define,USE_ARM_LINK)) |
Varun Wadekar | c2ad38c | 2019-01-11 14:47:48 -0800 | [diff] [blame] | 929 | endif |
| 930 | |
Manish Pandey | ce2b1ec | 2020-01-14 11:52:05 +0000 | [diff] [blame] | 931 | # Generate and include sp_gen.mk if SPD is spmd and SP_LAYOUT_FILE is defined |
Manish Pandey | ce2b1ec | 2020-01-14 11:52:05 +0000 | [diff] [blame] | 932 | ifeq (${SPD},spmd) |
Olivier Deprez | c33ff19 | 2020-03-19 09:27:11 +0100 | [diff] [blame] | 933 | ifdef SP_LAYOUT_FILE |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 934 | -include $(BUILD_PLAT)/sp_gen.mk |
| 935 | FIP_DEPS += sp |
| 936 | CRT_DEPS += sp |
| 937 | NEED_SP_PKG := yes |
Manish Pandey | ce2b1ec | 2020-01-14 11:52:05 +0000 | [diff] [blame] | 938 | else |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 939 | ifeq (${SPMD_SPM_AT_SEL2},1) |
| 940 | $(error "SPMD with SPM at S-EL2 require SP_LAYOUT_FILE") |
| 941 | endif |
| 942 | endif #(SP_LAYOUT_FILE) |
| 943 | endif #(SPD) |
Manish Pandey | ce2b1ec | 2020-01-14 11:52:05 +0000 | [diff] [blame] | 944 | |
Juan Castillo | 73c99d4 | 2015-08-18 14:23:04 +0100 | [diff] [blame] | 945 | ################################################################################ |
Boyan Karatotev | 3df79ae | 2025-04-09 14:26:17 +0100 | [diff] [blame] | 946 | # Configure the flags for the specified compiler and linker |
| 947 | ################################################################################ |
| 948 | include ${MAKE_HELPERS_DIRECTORY}cflags.mk |
| 949 | |
| 950 | ################################################################################ |
Juan Castillo | 73c99d4 | 2015-08-18 14:23:04 +0100 | [diff] [blame] | 951 | # Build targets |
| 952 | ################################################################################ |
| 953 | |
Harrison Mutai | 2329e22 | 2024-08-28 13:27:19 +0000 | [diff] [blame] | 954 | .PHONY: all msg_start clean realclean distclean cscope locate-checkpatch checkcodebase checkpatch fiptool sptool fip sp tl fwu_fip certtool dtbs memmap doc enctool |
Juan Castillo | 73c99d4 | 2015-08-18 14:23:04 +0100 | [diff] [blame] | 955 | |
| 956 | all: msg_start |
| 957 | |
| 958 | msg_start: |
Chris Kay | 7c4e1ee | 2024-05-02 17:52:37 +0000 | [diff] [blame] | 959 | $(s)echo "Building ${PLAT}" |
Juan Castillo | 73c99d4 | 2015-08-18 14:23:04 +0100 | [diff] [blame] | 960 | |
Roberto Vargas | 61f72a3 | 2018-05-08 10:27:10 +0100 | [diff] [blame] | 961 | $(eval $(call MAKE_LIB,c)) |
Roberto Vargas | 5fee028 | 2018-05-08 10:27:10 +0100 | [diff] [blame] | 962 | |
Juan Castillo | 73c99d4 | 2015-08-18 14:23:04 +0100 | [diff] [blame] | 963 | # Expand build macros for the different images |
| 964 | ifeq (${NEED_BL1},yes) |
Chris Kay | b34635a | 2021-09-28 15:44:19 +0100 | [diff] [blame] | 965 | BL1_SOURCES := $(sort ${BL1_SOURCES}) |
Zelalem Aweke | 434d049 | 2021-07-11 17:25:48 -0500 | [diff] [blame] | 966 | $(eval $(call MAKE_BL,bl1)) |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 967 | endif #(NEED_BL1) |
Juan Castillo | 73c99d4 | 2015-08-18 14:23:04 +0100 | [diff] [blame] | 968 | |
| 969 | ifeq (${NEED_BL2},yes) |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 970 | |
Arvind Ram Prakash | 42d4d3b | 2022-11-22 14:41:00 -0600 | [diff] [blame] | 971 | ifeq (${RESET_TO_BL2}, 0) |
Roberto Vargas | c9b31ae | 2018-01-02 11:23:41 +0000 | [diff] [blame] | 972 | FIP_BL2_ARGS := tb-fw |
| 973 | endif |
| 974 | |
Chris Kay | eb1acfb | 2021-09-28 15:44:37 +0100 | [diff] [blame] | 975 | BL2_SOURCES := $(sort ${BL2_SOURCES}) |
| 976 | |
Masahiro Yamada | 33950dd | 2018-01-26 11:42:01 +0900 | [diff] [blame] | 977 | $(if ${BL2}, $(eval $(call TOOL_ADD_IMG,bl2,--${FIP_BL2_ARGS})),\ |
Zelalem Aweke | 434d049 | 2021-07-11 17:25:48 -0500 | [diff] [blame] | 978 | $(eval $(call MAKE_BL,bl2,${FIP_BL2_ARGS}))) |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 979 | |
| 980 | endif #(NEED_BL2) |
Juan Castillo | 73c99d4 | 2015-08-18 14:23:04 +0100 | [diff] [blame] | 981 | |
Masahiro Yamada | 4d045d0 | 2017-04-05 19:11:41 +0900 | [diff] [blame] | 982 | ifeq (${NEED_SCP_BL2},yes) |
Masahiro Yamada | 33950dd | 2018-01-26 11:42:01 +0900 | [diff] [blame] | 983 | $(eval $(call TOOL_ADD_IMG,scp_bl2,--scp-fw)) |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 984 | endif #(NEED_SCP_BL2) |
Masahiro Yamada | 4d045d0 | 2017-04-05 19:11:41 +0900 | [diff] [blame] | 985 | |
Juan Castillo | 73c99d4 | 2015-08-18 14:23:04 +0100 | [diff] [blame] | 986 | ifeq (${NEED_BL31},yes) |
| 987 | BL31_SOURCES += ${SPD_SOURCES} |
Madhukar Pappireddy | 26d1e0c | 2020-01-27 13:37:51 -0600 | [diff] [blame] | 988 | # Sort BL31 source files to remove duplicates |
| 989 | BL31_SOURCES := $(sort ${BL31_SOURCES}) |
Sumit Garg | c6ba9b4 | 2019-11-14 16:33:45 +0530 | [diff] [blame] | 990 | ifneq (${DECRYPTION_SUPPORT},none) |
| 991 | $(if ${BL31}, $(eval $(call TOOL_ADD_IMG,bl31,--soc-fw,,$(ENCRYPT_BL31))),\ |
Zelalem Aweke | 434d049 | 2021-07-11 17:25:48 -0500 | [diff] [blame] | 992 | $(eval $(call MAKE_BL,bl31,soc-fw,,$(ENCRYPT_BL31)))) |
Sumit Garg | c6ba9b4 | 2019-11-14 16:33:45 +0530 | [diff] [blame] | 993 | else |
Masahiro Yamada | 33950dd | 2018-01-26 11:42:01 +0900 | [diff] [blame] | 994 | $(if ${BL31}, $(eval $(call TOOL_ADD_IMG,bl31,--soc-fw)),\ |
Zelalem Aweke | 434d049 | 2021-07-11 17:25:48 -0500 | [diff] [blame] | 995 | $(eval $(call MAKE_BL,bl31,soc-fw))) |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 996 | endif #(DECRYPTION_SUPPORT) |
| 997 | endif #(NEED_BL31) |
Juan Castillo | 73c99d4 | 2015-08-18 14:23:04 +0100 | [diff] [blame] | 998 | |
Juan Castillo | 70d1fc5 | 2015-11-12 10:59:26 +0000 | [diff] [blame] | 999 | # If a BL32 image is needed but neither BL32 nor BL32_SOURCES is defined, the |
Masahiro Yamada | c939d13 | 2018-01-26 11:42:01 +0900 | [diff] [blame] | 1000 | # build system will call TOOL_ADD_IMG to print a warning message and abort the |
Juan Castillo | 70d1fc5 | 2015-11-12 10:59:26 +0000 | [diff] [blame] | 1001 | # process. Note that the dependency on BL32 applies to the FIP only. |
Juan Castillo | 73c99d4 | 2015-08-18 14:23:04 +0100 | [diff] [blame] | 1002 | ifeq (${NEED_BL32},yes) |
Madhukar Pappireddy | 26d1e0c | 2020-01-27 13:37:51 -0600 | [diff] [blame] | 1003 | # Sort BL32 source files to remove duplicates |
| 1004 | BL32_SOURCES := $(sort ${BL32_SOURCES}) |
Masahiro Yamada | 9cd1523 | 2018-01-26 11:42:01 +0900 | [diff] [blame] | 1005 | BUILD_BL32 := $(if $(BL32),,$(if $(BL32_SOURCES),1)) |
| 1006 | |
Sumit Garg | c6ba9b4 | 2019-11-14 16:33:45 +0530 | [diff] [blame] | 1007 | ifneq (${DECRYPTION_SUPPORT},none) |
Zelalem Aweke | 434d049 | 2021-07-11 17:25:48 -0500 | [diff] [blame] | 1008 | $(if ${BUILD_BL32}, $(eval $(call MAKE_BL,bl32,tos-fw,,$(ENCRYPT_BL32))),\ |
Sumit Garg | c6ba9b4 | 2019-11-14 16:33:45 +0530 | [diff] [blame] | 1009 | $(eval $(call TOOL_ADD_IMG,bl32,--tos-fw,,$(ENCRYPT_BL32)))) |
| 1010 | else |
Zelalem Aweke | 434d049 | 2021-07-11 17:25:48 -0500 | [diff] [blame] | 1011 | $(if ${BUILD_BL32}, $(eval $(call MAKE_BL,bl32,tos-fw)),\ |
Masahiro Yamada | 33950dd | 2018-01-26 11:42:01 +0900 | [diff] [blame] | 1012 | $(eval $(call TOOL_ADD_IMG,bl32,--tos-fw))) |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 1013 | endif #(DECRYPTION_SUPPORT) |
| 1014 | endif #(NEED_BL32) |
Juan Castillo | 73c99d4 | 2015-08-18 14:23:04 +0100 | [diff] [blame] | 1015 | |
Zelalem Aweke | 5b18de0 | 2021-07-11 18:33:20 -0500 | [diff] [blame] | 1016 | # If RMM image is needed but RMM is not defined, Test Realm Payload (TRP) |
| 1017 | # needs to be built from RMM_SOURCES. |
| 1018 | ifeq (${NEED_RMM},yes) |
| 1019 | # Sort RMM source files to remove duplicates |
| 1020 | RMM_SOURCES := $(sort ${RMM_SOURCES}) |
| 1021 | BUILD_RMM := $(if $(RMM),,$(if $(RMM_SOURCES),1)) |
| 1022 | |
| 1023 | $(if ${BUILD_RMM}, $(eval $(call MAKE_BL,rmm,rmm-fw)),\ |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 1024 | $(eval $(call TOOL_ADD_IMG,rmm,--rmm-fw))) |
| 1025 | endif #(NEED_RMM) |
Zelalem Aweke | 5b18de0 | 2021-07-11 18:33:20 -0500 | [diff] [blame] | 1026 | |
Juan Castillo | 73c99d4 | 2015-08-18 14:23:04 +0100 | [diff] [blame] | 1027 | # Add the BL33 image if required by the platform |
| 1028 | ifeq (${NEED_BL33},yes) |
Masahiro Yamada | 33950dd | 2018-01-26 11:42:01 +0900 | [diff] [blame] | 1029 | $(eval $(call TOOL_ADD_IMG,bl33,--nt-fw)) |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 1030 | endif #(NEED_BL33) |
Juan Castillo | db6071c | 2015-01-13 12:21:04 +0000 | [diff] [blame] | 1031 | |
Yatharth Kochar | 9003fa0 | 2015-10-14 15:27:24 +0100 | [diff] [blame] | 1032 | ifeq (${NEED_BL2U},yes) |
Masahiro Yamada | 33950dd | 2018-01-26 11:42:01 +0900 | [diff] [blame] | 1033 | $(if ${BL2U}, $(eval $(call TOOL_ADD_IMG,bl2u,--ap-fwu-cfg,FWU_)),\ |
Zelalem Aweke | 434d049 | 2021-07-11 17:25:48 -0500 | [diff] [blame] | 1034 | $(eval $(call MAKE_BL,bl2u,ap-fwu-cfg,FWU_))) |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 1035 | endif #(NEED_BL2U) |
Yatharth Kochar | 9003fa0 | 2015-10-14 15:27:24 +0100 | [diff] [blame] | 1036 | |
Nishanth Menon | 03b397a | 2016-10-14 01:13:57 +0000 | [diff] [blame] | 1037 | # Expand build macros for the different images |
| 1038 | ifeq (${NEED_FDT},yes) |
Soby Mathew | 38c14d8 | 2017-12-14 17:44:56 +0000 | [diff] [blame] | 1039 | $(eval $(call MAKE_DTBS,$(BUILD_PLAT)/fdts,$(FDT_SOURCES))) |
Salman Nabi | 1c08ff3 | 2024-12-12 17:38:54 +0000 | [diff] [blame] | 1040 | |
| 1041 | ifneq (${INITRD_SIZE}${INITRD_PATH},) |
| 1042 | ifndef INITRD_BASE |
| 1043 | $(error INITRD_BASE must be set when inserting initrd properties to the DTB.) |
| 1044 | endif |
| 1045 | |
| 1046 | INITRD_SIZE ?= $(shell printf "0x%x\n" $$(stat -Lc %s $(INITRD_PATH))) |
| 1047 | initrd_end = $(shell printf "0x%x\n" $$(expr $$(($(INITRD_BASE) + $(INITRD_SIZE))))) |
| 1048 | |
| 1049 | define $(HW_CONFIG)-after += |
| 1050 | $(s)echo " INITRD $(HW_CONFIG)" |
| 1051 | $(q)fdtput -t x $@ /chosen linux,initrd-start $(INITRD_BASE) |
| 1052 | $(q)fdtput -t x $@ /chosen linux,initrd-end $(initrd_end) |
| 1053 | endef |
| 1054 | endif |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 1055 | endif #(NEED_FDT) |
Nishanth Menon | 03b397a | 2016-10-14 01:13:57 +0000 | [diff] [blame] | 1056 | |
Manish Pandey | ce2b1ec | 2020-01-14 11:52:05 +0000 | [diff] [blame] | 1057 | # Add Secure Partition packages |
| 1058 | ifeq (${NEED_SP_PKG},yes) |
Chris Kay | fd74ca0 | 2024-07-30 13:33:56 +0000 | [diff] [blame] | 1059 | $(BUILD_PLAT)/sp_gen.mk: ${SP_MK_GEN} ${SP_LAYOUT_FILE} | $$(@D)/ |
Chris Kay | 679e27c | 2025-03-19 15:04:47 +0000 | [diff] [blame] | 1060 | $(if $(host-poetry),$(q)poetry -q install --no-root) |
Kathleen Capella | dd81623 | 2025-02-13 17:34:21 -0600 | [diff] [blame] | 1061 | $(q)$(if $(host-poetry),poetry run )${PYTHON} "$<" "$@" $(filter-out $<,$^) $(BUILD_PLAT) ${COT} ${SP_DTS_LIST_FRAGMENT} |
J-Alves | 822c727 | 2022-03-22 16:28:51 +0000 | [diff] [blame] | 1062 | sp: $(DTBS) $(BUILD_PLAT)/sp_gen.mk $(SP_PKGS) |
Chris Kay | 7c4e1ee | 2024-05-02 17:52:37 +0000 | [diff] [blame] | 1063 | $(s)echo |
| 1064 | $(s)echo "Built SP Images successfully" |
| 1065 | $(s)echo |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 1066 | endif #(NEED_SP_PKG) |
Manish Pandey | ce2b1ec | 2020-01-14 11:52:05 +0000 | [diff] [blame] | 1067 | |
Ian Spray | 36eaaf3 | 2014-01-30 17:25:28 +0000 | [diff] [blame] | 1068 | locate-checkpatch: |
| 1069 | ifndef CHECKPATCH |
Etienne Carriere | 66079b0 | 2017-08-23 15:44:01 +0200 | [diff] [blame] | 1070 | $(error "Please set CHECKPATCH to point to the Linux checkpatch.pl file, eg: CHECKPATCH=../linux/scripts/checkpatch.pl") |
Ian Spray | 36eaaf3 | 2014-01-30 17:25:28 +0000 | [diff] [blame] | 1071 | else |
| 1072 | ifeq (,$(wildcard ${CHECKPATCH})) |
Etienne Carriere | 66079b0 | 2017-08-23 15:44:01 +0200 | [diff] [blame] | 1073 | $(error "The file CHECKPATCH points to cannot be found, use eg: CHECKPATCH=../linux/scripts/checkpatch.pl") |
Ian Spray | 36eaaf3 | 2014-01-30 17:25:28 +0000 | [diff] [blame] | 1074 | endif |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 1075 | endif #(CHECKPATCH) |
Ian Spray | 36eaaf3 | 2014-01-30 17:25:28 +0000 | [diff] [blame] | 1076 | |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 1077 | clean: |
Chris Kay | 7c4e1ee | 2024-05-02 17:52:37 +0000 | [diff] [blame] | 1078 | $(s)echo " CLEAN" |
Chris Kay | c327370 | 2025-01-13 15:57:32 +0000 | [diff] [blame] | 1079 | $(q)rm -rf $(BUILD_PLAT) |
Boyan Karatotev | cbd6cec | 2025-05-02 15:08:24 +0100 | [diff] [blame] | 1080 | $(q)${MAKE} PLAT=${PLAT} BUILD_PLAT=${BUILD_PLAT} --no-print-directory -C ${FIPTOOLPATH} clean |
| 1081 | $(q)rm -rf ${FIPTOOLPATH}/fiptool |
Boyan Karatotev | f4595e6 | 2025-05-06 17:11:29 +0100 | [diff] [blame] | 1082 | $(q)${MAKE} PLAT=${PLAT} BUILD_PLAT=${BUILD_PLAT} --no-print-directory -C ${CRTTOOLPATH} clean |
| 1083 | $(q)rm -rf ${CRTTOOLPATH}/cert_create |
Boyan Karatotev | 96fbe88 | 2025-05-02 16:40:40 +0100 | [diff] [blame] | 1084 | $(q)${MAKE} PLAT=${PLAT} BUILD_PLAT=${BUILD_PLAT} --no-print-directory -C ${ENCTOOLPATH} clean |
Chris Kay | 7c4e1ee | 2024-05-02 17:52:37 +0000 | [diff] [blame] | 1085 | $(q)${MAKE} --no-print-directory -C ${ROMLIBPATH} clean |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 1086 | |
James Morrissey | eaaeece | 2013-11-01 13:56:59 +0000 | [diff] [blame] | 1087 | realclean distclean: |
Chris Kay | 7c4e1ee | 2024-05-02 17:52:37 +0000 | [diff] [blame] | 1088 | $(s)echo " REALCLEAN" |
Chris Kay | c327370 | 2025-01-13 15:57:32 +0000 | [diff] [blame] | 1089 | $(q)rm -rf $(BUILD_BASE) |
| 1090 | $(q)rm -rf $(CURDIR)/cscope.* |
Boyan Karatotev | cbd6cec | 2025-05-02 15:08:24 +0100 | [diff] [blame] | 1091 | $(q)${MAKE} PLAT=${PLAT} BUILD_PLAT=${BUILD_PLAT} --no-print-directory -C ${FIPTOOLPATH} clean |
| 1092 | $(q)rm -rf ${FIPTOOLPATH}/fiptool |
Boyan Karatotev | f4595e6 | 2025-05-06 17:11:29 +0100 | [diff] [blame] | 1093 | $(q)${MAKE} PLAT=${PLAT} BUILD_PLAT=${BUILD_PLAT} --no-print-directory -C ${CRTTOOLPATH} clean |
| 1094 | $(q)rm -rf ${CRTTOOLPATH}/cert_create |
Boyan Karatotev | 96fbe88 | 2025-05-02 16:40:40 +0100 | [diff] [blame] | 1095 | $(q)${MAKE} PLAT=${PLAT} BUILD_PLAT=${BUILD_PLAT} --no-print-directory -C ${ENCTOOLPATH} clean |
Chris Kay | 7c4e1ee | 2024-05-02 17:52:37 +0000 | [diff] [blame] | 1096 | $(q)${MAKE} --no-print-directory -C ${ROMLIBPATH} clean |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 1097 | |
Ian Spray | 36eaaf3 | 2014-01-30 17:25:28 +0000 | [diff] [blame] | 1098 | checkcodebase: locate-checkpatch |
Chris Kay | 7c4e1ee | 2024-05-02 17:52:37 +0000 | [diff] [blame] | 1099 | $(s)echo " CHECKING STYLE" |
| 1100 | $(q)if test -d .git ; then \ |
Paul Beesley | 1ef3551 | 2019-03-07 16:42:31 +0000 | [diff] [blame] | 1101 | git ls-files | grep -E -v 'libfdt|libc|docs|\.rst' | \ |
Dan Handley | 1a41e8c | 2016-06-02 18:21:02 +0100 | [diff] [blame] | 1102 | while read GIT_FILE ; \ |
| 1103 | do ${CHECKPATCH} ${CHECKCODE_ARGS} -f $$GIT_FILE ; \ |
| 1104 | done ; \ |
| 1105 | else \ |
| 1106 | find . -type f -not -iwholename "*.git*" \ |
| 1107 | -not -iwholename "*build*" \ |
| 1108 | -not -iwholename "*libfdt*" \ |
Roberto Vargas | 61f72a3 | 2018-05-08 10:27:10 +0100 | [diff] [blame] | 1109 | -not -iwholename "*libc*" \ |
Dan Handley | 1a41e8c | 2016-06-02 18:21:02 +0100 | [diff] [blame] | 1110 | -not -iwholename "*docs*" \ |
Paul Beesley | 1ef3551 | 2019-03-07 16:42:31 +0000 | [diff] [blame] | 1111 | -not -iwholename "*.rst" \ |
Dan Handley | 1a41e8c | 2016-06-02 18:21:02 +0100 | [diff] [blame] | 1112 | -exec ${CHECKPATCH} ${CHECKCODE_ARGS} -f {} \; ; \ |
| 1113 | fi |
Ian Spray | 36eaaf3 | 2014-01-30 17:25:28 +0000 | [diff] [blame] | 1114 | |
| 1115 | checkpatch: locate-checkpatch |
Chris Kay | 7c4e1ee | 2024-05-02 17:52:37 +0000 | [diff] [blame] | 1116 | $(s)echo " CHECKING STYLE" |
| 1117 | $(q)if test -n "${CHECKPATCH_OPTS}"; then \ |
Yann Gautier | 02a76d5 | 2019-03-08 15:44:00 +0100 | [diff] [blame] | 1118 | echo " with ${CHECKPATCH_OPTS} option(s)"; \ |
| 1119 | fi |
Chris Kay | 7c4e1ee | 2024-05-02 17:52:37 +0000 | [diff] [blame] | 1120 | $(q)COMMON_COMMIT=$$(git merge-base HEAD ${BASE_COMMIT}); \ |
Yann Gautier | 77a0a7f | 2021-11-02 18:03:31 +0100 | [diff] [blame] | 1121 | for commit in `git rev-list --no-merges $$COMMON_COMMIT..HEAD`; \ |
| 1122 | do \ |
Antonio Nino Diaz | 51d2893 | 2018-01-29 12:00:31 +0000 | [diff] [blame] | 1123 | printf "\n[*] Checking style of '$$commit'\n\n"; \ |
Yann Gautier | 1a72174 | 2024-08-09 11:52:03 +0200 | [diff] [blame] | 1124 | ( git log --format=email "$$commit~..$$commit" \ |
| 1125 | -- ${CHECK_PATHS} ; \ |
| 1126 | git diff --format=email "$$commit~..$$commit" \ |
| 1127 | -- ${CHECK_PATHS}; ) | \ |
Yann Gautier | 02a76d5 | 2019-03-08 15:44:00 +0100 | [diff] [blame] | 1128 | ${CHECKPATCH} ${CHECKPATCH_OPTS} - || true; \ |
Antonio Nino Diaz | 51d2893 | 2018-01-29 12:00:31 +0000 | [diff] [blame] | 1129 | done |
Juan Castillo | 73c99d4 | 2015-08-18 14:23:04 +0100 | [diff] [blame] | 1130 | |
| 1131 | certtool: ${CRTTOOL} |
Ian Spray | 36eaaf3 | 2014-01-30 17:25:28 +0000 | [diff] [blame] | 1132 | |
Pali Rohár | a981220 | 2020-11-24 15:38:08 +0100 | [diff] [blame] | 1133 | ${CRTTOOL}: FORCE |
Boyan Karatotev | f4595e6 | 2025-05-06 17:11:29 +0100 | [diff] [blame] | 1134 | $(q)${MAKE} PLAT=${PLAT} BUILD_PLAT=$(abspath ${BUILD_PLAT}) USE_TBBR_DEFS=${USE_TBBR_DEFS} COT=${COT} OPENSSL_DIR=${OPENSSL_DIR} DEBUG=${DEBUG} --no-print-directory -C ${CRTTOOLPATH} all |
| 1135 | $(q)ln -sf ${CRTTOOL} ${CRTTOOLPATH}/cert_create |
Chris Kay | 7c4e1ee | 2024-05-02 17:52:37 +0000 | [diff] [blame] | 1136 | $(s)echo |
| 1137 | $(s)echo "Built $@ successfully" |
| 1138 | $(s)echo |
Juan Castillo | 73c99d4 | 2015-08-18 14:23:04 +0100 | [diff] [blame] | 1139 | |
| 1140 | ifneq (${GENERATE_COT},0) |
Fabien Lehoussel | f02135a | 2025-06-27 14:36:55 +0200 | [diff] [blame] | 1141 | certificates: ${CRT_DEPS} ${CRTTOOL} ${DTBS} |
Chris Kay | 7c4e1ee | 2024-05-02 17:52:37 +0000 | [diff] [blame] | 1142 | $(q)${CRTTOOL} ${CRT_ARGS} |
| 1143 | $(s)echo |
| 1144 | $(s)echo "Built $@ successfully" |
| 1145 | $(s)echo "Certificates can be found in ${BUILD_PLAT}" |
| 1146 | $(s)echo |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 1147 | endif #(GENERATE_COT) |
Juan Castillo | 73c99d4 | 2015-08-18 14:23:04 +0100 | [diff] [blame] | 1148 | |
| 1149 | ${BUILD_PLAT}/${FIP_NAME}: ${FIP_DEPS} ${FIPTOOL} |
Pali Rohár | 4727fd1 | 2020-11-24 16:53:04 +0100 | [diff] [blame] | 1150 | $(eval ${CHECK_FIP_CMD}) |
Chris Kay | 7c4e1ee | 2024-05-02 17:52:37 +0000 | [diff] [blame] | 1151 | $(q)${FIPTOOL} create ${FIP_ARGS} $@ |
| 1152 | $(q)${FIPTOOL} info $@ |
| 1153 | $(s)echo |
| 1154 | $(s)echo "Built $@ successfully" |
| 1155 | $(s)echo |
Juan Castillo | 73c99d4 | 2015-08-18 14:23:04 +0100 | [diff] [blame] | 1156 | |
Yatharth Kochar | 0191262 | 2015-10-12 12:33:47 +0100 | [diff] [blame] | 1157 | ifneq (${GENERATE_COT},0) |
| 1158 | fwu_certificates: ${FWU_CRT_DEPS} ${CRTTOOL} |
Chris Kay | 7c4e1ee | 2024-05-02 17:52:37 +0000 | [diff] [blame] | 1159 | $(q)${CRTTOOL} ${FWU_CRT_ARGS} |
| 1160 | $(s)echo |
| 1161 | $(s)echo "Built $@ successfully" |
| 1162 | $(s)echo "FWU certificates can be found in ${BUILD_PLAT}" |
| 1163 | $(s)echo |
Jayanth Dodderi Chidanand | c5e1da8 | 2023-04-24 15:57:05 +0100 | [diff] [blame] | 1164 | endif #(GENERATE_COT) |
Yatharth Kochar | 0191262 | 2015-10-12 12:33:47 +0100 | [diff] [blame] | 1165 | |
| 1166 | ${BUILD_PLAT}/${FWU_FIP_NAME}: ${FWU_FIP_DEPS} ${FIPTOOL} |
Pali Rohár | 4727fd1 | 2020-11-24 16:53:04 +0100 | [diff] [blame] | 1167 | $(eval ${CHECK_FWU_FIP_CMD}) |
Chris Kay | 7c4e1ee | 2024-05-02 17:52:37 +0000 | [diff] [blame] | 1168 | $(q)${FIPTOOL} create ${FWU_FIP_ARGS} $@ |
| 1169 | $(q)${FIPTOOL} info $@ |
| 1170 | $(s)echo |
| 1171 | $(s)echo "Built $@ successfully" |
| 1172 | $(s)echo |
Yatharth Kochar | 0191262 | 2015-10-12 12:33:47 +0100 | [diff] [blame] | 1173 | |
Juan Castillo | 73c99d4 | 2015-08-18 14:23:04 +0100 | [diff] [blame] | 1174 | fiptool: ${FIPTOOL} |
| 1175 | fip: ${BUILD_PLAT}/${FIP_NAME} |
Yatharth Kochar | 0191262 | 2015-10-12 12:33:47 +0100 | [diff] [blame] | 1176 | fwu_fip: ${BUILD_PLAT}/${FWU_FIP_NAME} |
Juan Castillo | 6f97162 | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 1177 | |
Boyan Karatotev | cbd6cec | 2025-05-02 15:08:24 +0100 | [diff] [blame] | 1178 | # symlink for compatibility before tools were in the build directory |
Pali Rohár | a981220 | 2020-11-24 15:38:08 +0100 | [diff] [blame] | 1179 | ${FIPTOOL}: FORCE |
Boyan Karatotev | cbd6cec | 2025-05-02 15:08:24 +0100 | [diff] [blame] | 1180 | $(q)${MAKE} PLAT=${PLAT} BUILD_PLAT=$(abspath ${BUILD_PLAT}) CPPFLAGS="-DVERSION='\"${VERSION_STRING}\"'" OPENSSL_DIR=${OPENSSL_DIR} DEBUG=${DEBUG} --no-print-directory -C ${FIPTOOLPATH} all |
| 1181 | $(q)ln -sf ${FIPTOOL} ${FIPTOOLPATH}/fiptool |
Harry Liebel | f58ad36 | 2014-01-10 18:00:33 +0000 | [diff] [blame] | 1182 | |
Manish V Badarkhe | e4a070e | 2024-12-03 21:46:51 +0000 | [diff] [blame] | 1183 | $(BUILD_PLAT)/romlib/romlib.bin $(BUILD_PLAT)/lib/libwrappers.a $&: $(BUILD_PLAT)/lib/libfdt.a $(BUILD_PLAT)/lib/libc.a $(CRYPTO_LIB) |
| 1184 | $(q)${MAKE} PLAT_DIR=${PLAT_DIR} BUILD_PLAT=${BUILD_PLAT} ENABLE_BTI=${ENABLE_BTI} CRYPTO_SUPPORT=${CRYPTO_SUPPORT} ARM_ARCH_MINOR=${ARM_ARCH_MINOR} INCLUDES=$(call escape-shell,$(INCLUDES)) DEFINES=$(call escape-shell,$(DEFINES)) --no-print-directory -C ${ROMLIBPATH} all |
Roberto Vargas | 5accce5 | 2018-05-22 16:05:42 +0100 | [diff] [blame] | 1185 | |
Louis Mayencourt | cfe8391 | 2019-10-16 14:30:51 +0100 | [diff] [blame] | 1186 | memmap: all |
Chris Kay | c25405d | 2025-03-10 09:24:34 +0000 | [diff] [blame] | 1187 | $(if $(host-poetry),$(q)poetry -q install --no-root) |
Chris Kay | 4aa3f18 | 2025-07-01 15:17:00 +0100 | [diff] [blame] | 1188 | $(q)$(if $(host-poetry),poetry run )memory --root ${BUILD_PLAT} symbols |
Louis Mayencourt | cfe8391 | 2019-10-16 14:30:51 +0100 | [diff] [blame] | 1189 | |
Harrison Mutai | 2329e22 | 2024-08-28 13:27:19 +0000 | [diff] [blame] | 1190 | tl: ${BUILD_PLAT}/tl.bin |
| 1191 | ${BUILD_PLAT}/tl.bin: ${HW_CONFIG} |
Chris Kay | c25405d | 2025-03-10 09:24:34 +0000 | [diff] [blame] | 1192 | $(if $(host-poetry),$(q)poetry -q install --no-root) |
Chris Kay | d286739 | 2024-09-26 14:18:04 +0000 | [diff] [blame] | 1193 | $(q)$(if $(host-poetry),poetry run )tlc create --fdt $< -s ${FW_HANDOFF_SIZE} $@ |
Harrison Mutai | 2329e22 | 2024-08-28 13:27:19 +0000 | [diff] [blame] | 1194 | |
Madhukar Pappireddy | 6de3237 | 2020-01-28 12:41:20 -0600 | [diff] [blame] | 1195 | doc: |
Chris Kay | 7c4e1ee | 2024-05-02 17:52:37 +0000 | [diff] [blame] | 1196 | $(s)echo " BUILD DOCUMENTATION" |
Harrison Mutai | c61c9a3 | 2025-05-15 08:47:34 +0000 | [diff] [blame] | 1197 | $(if $(host-poetry),$(q)poetry -q install --with docs --no-root) |
| 1198 | $(q)$(if $(host-poetry),poetry run )${MAKE} --no-print-directory -C ${DOCS_PATH} html |
Madhukar Pappireddy | 6de3237 | 2020-01-28 12:41:20 -0600 | [diff] [blame] | 1199 | |
Sumit Garg | 90aa901 | 2019-11-11 18:46:36 +0530 | [diff] [blame] | 1200 | enctool: ${ENCTOOL} |
| 1201 | |
Pali Rohár | a981220 | 2020-11-24 15:38:08 +0100 | [diff] [blame] | 1202 | ${ENCTOOL}: FORCE |
Boyan Karatotev | 96fbe88 | 2025-05-02 16:40:40 +0100 | [diff] [blame] | 1203 | $(q)${MAKE} PLAT=${PLAT} BUILD_PLAT=$(abspath ${BUILD_PLAT}) BUILD_INFO=0 OPENSSL_DIR=${OPENSSL_DIR} DEBUG=${DEBUG} --no-print-directory -C ${ENCTOOLPATH} all |
Chris Kay | 7c4e1ee | 2024-05-02 17:52:37 +0000 | [diff] [blame] | 1204 | $(s)echo |
| 1205 | $(s)echo "Built $@ successfully" |
| 1206 | $(s)echo |
Sumit Garg | 90aa901 | 2019-11-11 18:46:36 +0530 | [diff] [blame] | 1207 | |
Joakim Bech | 35fab8c | 2014-01-23 14:51:49 +0100 | [diff] [blame] | 1208 | cscope: |
Chris Kay | 7c4e1ee | 2024-05-02 17:52:37 +0000 | [diff] [blame] | 1209 | $(s)echo " CSCOPE" |
| 1210 | $(q)find ${CURDIR} -name "*.[chsS]" > cscope.files |
| 1211 | $(q)cscope -b -q -k |
Joakim Bech | 35fab8c | 2014-01-23 14:51:49 +0100 | [diff] [blame] | 1212 | |
Ryan Harkin | 72ee331 | 2014-01-15 16:55:07 +0000 | [diff] [blame] | 1213 | help: |
Chris Kay | 7c4e1ee | 2024-05-02 17:52:37 +0000 | [diff] [blame] | 1214 | $(s)echo "usage: ${MAKE} [PLAT=<platform>] [OPTIONS] [TARGET]" |
| 1215 | $(s)echo "" |
| 1216 | $(s)echo "PLAT is used to specify which platform you wish to build." |
| 1217 | $(s)echo "If no platform is specified, PLAT defaults to: ${DEFAULT_PLAT}" |
| 1218 | $(s)echo "" |
| 1219 | $(s)echo "platform = ${PLATFORM_LIST}" |
| 1220 | $(s)echo "" |
| 1221 | $(s)echo "Please refer to the User Guide for a list of all supported options." |
| 1222 | $(s)echo "Note that the build system doesn't track dependencies for build " |
| 1223 | $(s)echo "options. Therefore, if any of the build options are changed " |
| 1224 | $(s)echo "from a previous build, a clean build must be performed." |
| 1225 | $(s)echo "" |
| 1226 | $(s)echo "Supported Targets:" |
| 1227 | $(s)echo " all Build all individual bootloader binaries" |
| 1228 | $(s)echo " bl1 Build the BL1 binary" |
| 1229 | $(s)echo " bl2 Build the BL2 binary" |
| 1230 | $(s)echo " bl2u Build the BL2U binary" |
| 1231 | $(s)echo " bl31 Build the BL31 binary" |
| 1232 | $(s)echo " bl32 Build the BL32 binary. If ARCH=aarch32, then " |
| 1233 | $(s)echo " this builds secure payload specified by AARCH32_SP" |
| 1234 | $(s)echo " certificates Build the certificates (requires 'GENERATE_COT=1')" |
| 1235 | $(s)echo " fip Build the Firmware Image Package (FIP)" |
| 1236 | $(s)echo " fwu_fip Build the FWU Firmware Image Package (FIP)" |
| 1237 | $(s)echo " checkcodebase Check the coding style of the entire source tree" |
| 1238 | $(s)echo " checkpatch Check the coding style on changes in the current" |
| 1239 | $(s)echo " branch against BASE_COMMIT (default origin/master)" |
| 1240 | $(s)echo " clean Clean the build for the selected platform" |
| 1241 | $(s)echo " cscope Generate cscope index" |
| 1242 | $(s)echo " distclean Remove all build artifacts for all platforms" |
| 1243 | $(s)echo " certtool Build the Certificate generation tool" |
| 1244 | $(s)echo " enctool Build the Firmware encryption tool" |
| 1245 | $(s)echo " fiptool Build the Firmware Image Package (FIP) creation tool" |
| 1246 | $(s)echo " sp Build the Secure Partition Packages" |
| 1247 | $(s)echo " sptool Build the Secure Partition Package creation tool" |
| 1248 | $(s)echo " dtbs Build the Device Tree Blobs (if required for the platform)" |
| 1249 | $(s)echo " memmap Print the memory map of the built binaries" |
| 1250 | $(s)echo " doc Build html based documentation using Sphinx tool" |
| 1251 | $(s)echo "" |
| 1252 | $(s)echo "Note: most build targets require PLAT to be set to a specific platform." |
| 1253 | $(s)echo "" |
| 1254 | $(s)echo "example: build all targets for the FVP platform:" |
| 1255 | $(s)echo " CROSS_COMPILE=aarch64-none-elf- make PLAT=fvp all" |
Pali Rohár | a981220 | 2020-11-24 15:38:08 +0100 | [diff] [blame] | 1256 | |
| 1257 | .PHONY: FORCE |
| 1258 | FORCE:; |