blob: 3bff5ed83a061495ce108f1f5add1140cce0989d [file] [log] [blame]
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +02001#
AlexeiFedorov9f2de632024-09-10 11:48:22 +01002# Copyright (c) 2018-2024, Arm Limited. All rights reserved.
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +02003#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6
7AUTOGEN_DIR := $(BUILD_PLAT)/autogen
8
9include lib/xlat_tables_v2/xlat_tables.mk
10include lib/compiler-rt/compiler-rt.mk
Mark Dykese7810b52020-06-03 15:46:55 -050011include lib/libfdt/libfdt.mk
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020012
13TFTF_INCLUDES := \
14 -I${AUTOGEN_DIR} \
15 -Itftf/framework/include \
Antonio Nino Diaz09a00ef2019-01-11 13:12:58 +000016 -Iinclude \
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020017 -Iinclude/common \
18 -Iinclude/common/${ARCH} \
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020019 -Iinclude/lib \
20 -Iinclude/lib/${ARCH} \
21 -Iinclude/lib/extensions \
AlexeiFedorov9f2de632024-09-10 11:48:22 +010022 -Iinclude/lib/pcie \
23 -Iinclude/lib/spdm \
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020024 -Iinclude/lib/utils \
25 -Iinclude/lib/xlat_tables \
26 -Iinclude/plat/common \
27 -Iinclude/runtime_services \
28 -Iinclude/runtime_services/secure_el0_payloads \
Antonio Nino Diaz652d20a2018-12-10 17:17:33 +000029 -Iinclude/runtime_services/secure_el1_payloads \
nabkah01cd668462022-11-06 15:29:44 +000030 -Iinclude/runtime_services/host_realm_managment \
Antonio Nino Diaza1497e32018-11-08 11:45:13 +000031 -Ispm/cactus \
Antonio Nino Diaz26b38642019-03-28 13:16:04 +000032 -Ispm/ivy \
nabkah01002e5692022-10-10 12:36:46 +010033 -Irealm \
Mark Dykese7810b52020-06-03 15:46:55 -050034 -Ismc_fuzz/include
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020035
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020036FRAMEWORK_SOURCES := ${AUTOGEN_DIR}/tests_list.c
37
38FRAMEWORK_SOURCES += $(addprefix tftf/, \
39 framework/${ARCH}/arch.c \
40 framework/${ARCH}/asm_debug.S \
41 framework/${ARCH}/entrypoint.S \
42 framework/${ARCH}/exceptions.S \
Sandrine Bailleuxa43b0032019-01-14 14:04:32 +010043 framework/${ARCH}/exception_report.c \
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020044 framework/debug.c \
45 framework/main.c \
46 framework/nvm_results_helpers.c \
47 framework/report.c \
48 framework/timer/timer_framework.c \
49 tests/common/test_helpers.c \
50)
51
52FRAMEWORK_SOURCES += \
53 lib/${ARCH}/cache_helpers.S \
54 lib/${ARCH}/misc_helpers.S \
55 lib/delay/delay.c \
56 lib/events/events.c \
57 lib/extensions/amu/${ARCH}/amu.c \
58 lib/extensions/amu/${ARCH}/amu_helpers.S \
Olivier Deprezc8f6a672022-01-13 13:44:53 +000059 lib/exceptions/irq.c \
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020060 lib/locks/${ARCH}/spinlock.S \
61 lib/power_management/hotplug/hotplug.c \
62 lib/power_management/suspend/${ARCH}/asm_tftf_suspend.S \
63 lib/power_management/suspend/tftf_suspend.c \
64 lib/psci/psci.c \
65 lib/sdei/sdei.c \
66 lib/smc/${ARCH}/asm_smc.S \
67 lib/smc/${ARCH}/smc.c \
Jimmy Brissonc4f3eee2020-06-23 15:25:05 -050068 lib/trng/trng.c \
Sona Mathew07384212022-11-28 13:19:11 -060069 lib/errata_abi/errata_abi.c \
Harrison Mutai6e011642023-09-22 17:17:35 +010070 lib/transfer_list/transfer_list.c \
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020071 lib/trusted_os/trusted_os.c \
72 lib/utils/mp_printf.c \
73 lib/utils/uuid.c \
74 ${XLAT_TABLES_LIB_SRCS} \
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020075 plat/common/${ARCH}/platform_mp_stack.S \
76 plat/common/plat_common.c \
77 plat/common/plat_state_id.c \
78 plat/common/plat_topology.c \
79 plat/common/tftf_nvm_accessors.c
80
81
82FRAMEWORK_SOURCES += ${COMPILER_RT_SRCS}
83
Alexei Fedorovfb003382019-10-04 16:13:47 +010084ifeq (${ARCH},aarch64)
85# ARMv8.3 Pointer Authentication support files
86FRAMEWORK_SOURCES += \
Olivier Deprezc8f6a672022-01-13 13:44:53 +000087 lib/exceptions/aarch64/sync.c \
Manish Pandeyd6480772023-02-27 13:23:06 +000088 lib/exceptions/aarch64/serror.c \
Alexei Fedorovfb003382019-10-04 16:13:47 +010089 lib/extensions/pauth/aarch64/pauth.c \
johpow0150ccb552020-11-10 19:22:13 -060090 lib/extensions/pauth/aarch64/pauth_helpers.S \
91 lib/extensions/sme/aarch64/sme.c \
Jayanth Dodderi Chidanand95d5d272023-01-16 17:58:47 +000092 lib/extensions/sme/aarch64/sme_helpers.S \
Arunachalam Ganapathy0bbdc2d2023-04-05 15:30:18 +010093 lib/extensions/sme/aarch64/sme2_helpers.S \
Arunachalam Ganapathyd179ddc2023-04-12 10:41:42 +010094 lib/extensions/sve/aarch64/sve.c \
95 lib/extensions/sve/aarch64/sve_helpers.S
Alexei Fedorovfb003382019-10-04 16:13:47 +010096endif
97
Jayanth Dodderi Chidanand86e5e5d2024-08-05 19:52:29 +010098ifeq (${ARCH},aarch64)
99# Context Management Library support files
100FRAMEWORK_SOURCES += \
101 lib/context_mgmt/aarch64/context_el1.c
102endif
103
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +0200104TFTF_LINKERFILE := tftf/framework/tftf.ld.S
105
106
107TFTF_DEFINES :=
108
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +0200109# Enable dynamic translation tables
110PLAT_XLAT_TABLES_DYNAMIC := 1
111$(eval $(call add_define,TFTF_DEFINES,PLAT_XLAT_TABLES_DYNAMIC))