blob: e974855ad0684da2cca1b20fa88afe989a6e4694 [file] [log] [blame]
laurenw-arm2ce1e352023-02-07 13:40:05 -06001# Copyright (c) 2022-2023, Arm Limited. All rights reserved.
Mate Toth-Pal14ba4af2022-10-21 14:24:49 +02002#
3# SPDX-License-Identifier: BSD-3-Clause
4#
5
laurenw-arm2ce1e352023-02-07 13:40:05 -06006ifeq (${PLATFORM_TEST},tfm-testsuite)
Mate Toth-Pal14ba4af2022-10-21 14:24:49 +02007
8 # The variables need to be set to compile the platform test:
9 ifeq (${TF_M_TESTS_PATH},)
10 # Example: ../rss/tf-m-tests
11 $(error Error: TF_M_TESTS_PATH not set)
12 endif
13 ifeq (${TF_M_EXTRAS_PATH},)
14 # Example: ../rss/tf-m-extras
15 $(error Error: TF_M_EXTRAS_PATH not set)
16 endif
17 ifeq (${MEASUREMENT_VALUE_SIZE},)
18 MEASUREMENT_VALUE_SIZE := 32
19 endif
20 ifeq (${MEASURED_BOOT_HASH_ALG},)
21 MEASURED_BOOT_HASH_ALG := "PSA_ALG_SHA_256"
22 endif
23
24 DELEGATED_ATTEST_TESTS_PATH = $(TF_M_EXTRAS_PATH)/partitions/delegated_attestation/test
25 MEASURED_BOOT_TESTS_PATH = $(TF_M_EXTRAS_PATH)/partitions/measured_boot/test
26
27 MBEDTLS_CONFIG_FILE = "<plat_tc_mbedtls_config.h>"
28
29 LIBMBEDTLS_SRCS += $(addprefix ${MBEDTLS_DIR}/library/, \
30 entropy.c \
31 entropy_poll.c \
32 hmac_drbg.c \
33 psa_crypto.c \
34 psa_crypto_client.c \
35 psa_crypto_driver_wrappers.c \
36 psa_crypto_hash.c \
37 psa_crypto_rsa.c \
38 psa_crypto_ecp.c \
39 psa_crypto_slot_management.c \
40 )
41
42 BL31_SOURCES += ${RSS_COMMS_SOURCES} \
43 plat/arm/common/arm_dyn_cfg.c \
44 ${TC_BASE}/rss_ap_tests.c \
45 ${TC_BASE}/rss_ap_testsuites.c \
46 ${TC_BASE}/rss_ap_test_stubs.c \
47 $(TF_M_TESTS_PATH)/test/framework/test_framework.c \
48 $(MEASURED_BOOT_TESTS_PATH)/measured_boot_common.c \
49 $(MEASURED_BOOT_TESTS_PATH)/measured_boot_tests_common.c \
50 $(DELEGATED_ATTEST_TESTS_PATH)/delegated_attest_test.c \
51 drivers/auth/mbedtls/mbedtls_common.c \
52 lib/psa/measured_boot.c \
53 lib/psa/delegated_attestation.c
54
55 PLAT_INCLUDES += -I$(TF_M_EXTRAS_PATH)/partitions/measured_boot/interface/include \
56 -I$(TF_M_EXTRAS_PATH)/partitions/delegated_attestation/interface/include \
57 -I$(TF_M_TESTS_PATH)/test/framework \
58 -I$(TF_M_TESTS_PATH)/log \
59 -I$(TF_M_TESTS_PATH)/test/secure_fw/suites/extra \
60 -I$(MEASURED_BOOT_TESTS_PATH)/non_secure \
61 -I$(DELEGATED_ATTEST_TESTS_PATH) \
62 -I$(DELEGATED_ATTEST_TESTS_PATH)/non_secure \
63 -Iplat/arm/board/tc \
64 -Iinclude/drivers/auth/mbedtls \
65 -Iinclude/drivers/arm
66
67 # Some of the PSA functions are declared in multiple header files, that
68 # triggers this warning.
69 TF_CFLAGS += -Wno-error=redundant-decls
70
71 # TODO: Created patch for warning in tf-m-tests
72 TF_CFLAGS += -Wno-error=return-type
73
74 # Define macros that are used by the code coming from the tf-m-extras repo.
75 $(eval $(call add_define,MEASUREMENT_VALUE_SIZE))
76 $(eval $(call add_define,MEASURED_BOOT_HASH_ALG))
77 $(eval $(call add_define,DELEG_ATTEST_DUMP_TOKEN_AND_KEY))
78
Tamas Ban15b79da2023-04-21 09:31:48 +020079 $(eval $(call add_define,PLATFORM_TEST_TFM_TESTSUITE))
Mate Toth-Pal14ba4af2022-10-21 14:24:49 +020080endif