blob: 696cdb2caccce35723e107d2d67771b4396b345b [file] [log] [blame]
Achin Gupta7c88f3f2014-02-18 18:09:12 +00001#
Chris Kay523e8642023-12-04 12:03:51 +00002# Copyright (c) 2013-2024, Arm Limited and Contributors. All rights reserved.
Achin Gupta7c88f3f2014-02-18 18:09:12 +00003#
dp-armfa3cf0b2017-05-03 09:38:09 +01004# SPDX-License-Identifier: BSD-3-Clause
Achin Gupta7c88f3f2014-02-18 18:09:12 +00005#
6
Dan Handley4fd2f5c2014-08-04 11:41:20 +01007INCLUDES += -Iinclude/bl32/tsp
8
Achin Gupta6b4ec242021-10-04 20:13:36 +01009ifeq (${SPMC_AT_EL3},1)
Jayanth Dodderi Chidanand6a45fa72024-09-11 13:29:07 +010010 BL32_SOURCES += bl32/tsp/tsp_ffa_main.c \
Marc Bonnici073deb12021-12-23 20:14:02 +000011 bl32/tsp/ffa_helpers.c
Achin Gupta6b4ec242021-10-04 20:13:36 +010012else
13 BL32_SOURCES += bl32/tsp/tsp_main.c
14endif
15
16BL32_SOURCES += bl32/tsp/aarch64/tsp_entrypoint.S \
Achin Guptaa4f50c22014-05-09 12:17:56 +010017 bl32/tsp/aarch64/tsp_exceptions.S \
Dan Handley176e7b42014-04-15 18:20:09 +010018 bl32/tsp/aarch64/tsp_request.S \
Achin Gupta76717892014-05-09 11:42:56 +010019 bl32/tsp/tsp_interrupt.c \
20 bl32/tsp/tsp_timer.c \
Achin Gupta6b4ec242021-10-04 20:13:36 +010021 bl32/tsp/tsp_common.c \
Jayanth Dodderi Chidanand6a45fa72024-09-11 13:29:07 +010022 bl32/tsp/tsp_context.c \
Dan Handley176e7b42014-04-15 18:20:09 +010023 common/aarch64/early_exceptions.S \
Soby Mathew7b5c9b32016-08-08 12:42:53 +010024 lib/locks/exclusive/aarch64/spinlock.S
Achin Gupta7c88f3f2014-02-18 18:09:12 +000025
Chris Kay68d28362023-01-16 16:53:45 +000026BL32_DEFAULT_LINKER_SCRIPT_SOURCE := bl32/tsp/tsp.ld.S
Achin Gupta7c88f3f2014-02-18 18:09:12 +000027
Chris Kaycfba6452023-12-04 09:55:50 +000028ifeq ($($(ARCH)-ld-id),gnu-gcc)
Chris Kay07db6cb2023-01-26 18:31:52 +000029 BL32_LDFLAGS += -Wl,--sort-section=alignment
Chris Kaycfba6452023-12-04 09:55:50 +000030else ifneq ($(filter llvm-lld gnu-ld,$($(ARCH)-ld-id)),)
Chris Kay07db6cb2023-01-26 18:31:52 +000031 BL32_LDFLAGS += --sort-section=alignment
32endif
33
Juan Castillo7d199412015-12-14 09:35:25 +000034# This flag determines if the TSPD initializes BL32 in tspd_init() (synchronous
35# method) or configures BL31 to pass control to BL32 instead of BL33
Vikram Kanigiri4e813412014-07-15 16:49:22 +010036# (asynchronous method).
37TSP_INIT_ASYNC := 0
38
39$(eval $(call assert_boolean,TSP_INIT_ASYNC))
40$(eval $(call add_define,TSP_INIT_ASYNC))
41
Sandrine Bailleuxa3a936e2014-03-13 14:48:31 +000042# Include the platform-specific TSP Makefile
43# If no platform-specific TSP Makefile exists, it means TSP is not supported
44# on this platform.
Evan Lloydf2697142015-12-02 18:17:37 +000045TSP_PLAT_MAKEFILE := $(wildcard ${PLAT_DIR}/tsp/tsp-${PLAT}.mk)
46ifeq (,${TSP_PLAT_MAKEFILE})
Sandrine Bailleuxa3a936e2014-03-13 14:48:31 +000047 $(error TSP is not supported on platform ${PLAT})
48else
49 include ${TSP_PLAT_MAKEFILE}
50endif