blob: e6577c3cafe13a8436b3cfc4cffe995284427143 [file] [log] [blame]
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +02001#
Olivier Deprezafcdb7c2019-11-29 14:21:48 +01002# Copyright (c) 2018-2020, Arm Limited. All rights reserved.
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +02003#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6
Alexei Fedorov7fac1622020-06-19 14:25:43 +01007include branch_protection.mk
Olivier Deprezafcdb7c2019-11-29 14:21:48 +01008include lib/xlat_tables_v2/xlat_tables.mk
Antonio Nino Diaz43ef3932018-07-03 14:39:47 +01009
Antonio Nino Diaz1451f612018-11-30 10:51:26 +000010CACTUS_DTB := $(BUILD_PLAT)/cactus.dtb
11
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020012CACTUS_INCLUDES := \
Olivier Deprezafcdb7c2019-11-29 14:21:48 +010013 -Itftf/framework/include \
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020014 -Iinclude \
15 -Iinclude/common \
16 -Iinclude/common/${ARCH} \
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020017 -Iinclude/lib \
18 -Iinclude/lib/${ARCH} \
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020019 -Iinclude/lib/utils \
20 -Iinclude/lib/xlat_tables \
Olivier Deprez458d5532020-06-09 17:56:20 +020021 -Iinclude/plat/common \
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020022 -Iinclude/runtime_services \
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020023 -Ispm/cactus \
Olivier Deprez458d5532020-06-09 17:56:20 +020024 -Ispm/common
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020025
26CACTUS_SOURCES := \
27 $(addprefix spm/cactus/, \
28 aarch64/cactus_entrypoint.S \
Manish Pandey29495372020-04-09 15:19:26 +010029 cactus_debug.c \
J-Alves9f6f0142020-06-17 15:37:59 +010030 cactus_ffa_tests.c \
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020031 cactus_main.c \
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020032 ) \
33 $(addprefix spm/common/, \
34 aarch64/sp_arch_helpers.S \
35 sp_helpers.c \
36 ) \
37
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020038# TODO: Remove dependency on TFTF files.
39CACTUS_SOURCES += \
40 tftf/framework/debug.c \
J-Alves5aecd982020-06-11 10:25:33 +010041 tftf/framework/${ARCH}/asm_debug.S \
Olivier Deprez458d5532020-06-09 17:56:20 +020042 tftf/tests/runtime_services/secure_service/ffa_helpers.c \
43 tftf/framework/${ARCH}/exceptions.S \
44 tftf/framework/${ARCH}/exception_report.c
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020045
46CACTUS_SOURCES += drivers/arm/pl011/${ARCH}/pl011_console.S \
47 lib/${ARCH}/cache_helpers.S \
48 lib/${ARCH}/misc_helpers.S \
Olivier Deprezafcdb7c2019-11-29 14:21:48 +010049 lib/smc/${ARCH}/asm_smc.S \
50 lib/smc/${ARCH}/smc.c \
51 lib/smc/${ARCH}/hvc.c \
Sandrine Bailleux750b7cc2018-11-08 14:10:18 +010052 lib/locks/${ARCH}/spinlock.S \
53 lib/utils/mp_printf.c \
Olivier Deprezafcdb7c2019-11-29 14:21:48 +010054 ${XLAT_TABLES_LIB_SRCS}
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020055
56CACTUS_LINKERFILE := spm/cactus/cactus.ld.S
57
58CACTUS_DEFINES :=
59
Alexei Fedorov7fac1622020-06-19 14:25:43 +010060$(eval $(call add_define,CACTUS_DEFINES,ARM_ARCH_MAJOR))
61$(eval $(call add_define,CACTUS_DEFINES,ARM_ARCH_MINOR))
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020062$(eval $(call add_define,CACTUS_DEFINES,DEBUG))
Alexei Fedorov7fac1622020-06-19 14:25:43 +010063$(eval $(call add_define,CACTUS_DEFINES,ENABLE_ASSERTIONS))
64$(eval $(call add_define,CACTUS_DEFINES,ENABLE_BTI))
65$(eval $(call add_define,CACTUS_DEFINES,ENABLE_PAUTH))
Alexei Fedorov7cc25872020-06-02 16:35:36 +010066$(eval $(call add_define,CACTUS_DEFINES,FVP_CLUSTER_COUNT))
67$(eval $(call add_define,CACTUS_DEFINES,FVP_MAX_CPUS_PER_CLUSTER))
Alexei Fedorov0f305472019-10-29 14:06:54 +000068$(eval $(call add_define,CACTUS_DEFINES,FVP_MAX_PE_PER_CPU))
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020069$(eval $(call add_define,CACTUS_DEFINES,LOG_LEVEL))
70$(eval $(call add_define,CACTUS_DEFINES,PLAT_${PLAT}))
Deepika Bhavnanic249d5e2020-02-06 16:29:45 -060071
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020072
Antonio Nino Diaz1451f612018-11-30 10:51:26 +000073$(CACTUS_DTB) : $(BUILD_PLAT)/cactus $(BUILD_PLAT)/cactus/cactus.elf
74$(CACTUS_DTB) : spm/cactus/cactus.dts
75 @echo " DTBGEN spm/cactus/cactus.dts"
76 ${Q}tools/generate_dtb/generate_dtb.sh \
77 cactus spm/cactus/cactus.dts $(BUILD_PLAT)
Manish Pandey270ee152020-03-16 22:25:40 +000078 ${Q}tools/generate_json/generate_json.sh \
79 cactus $(PLAT) $(BUILD_TYPE)
Antonio Nino Diaz1451f612018-11-30 10:51:26 +000080 @echo
81 @echo "Built $@ successfully"
82 @echo
83
Bence Szépkúti537b3582019-11-29 18:23:56 +010084cactus: $(CACTUS_DTB)