blob: 4e81b2c3195501e192f030e11453b3d2c5a3cda8 [file] [log] [blame]
David Vincze58131252023-12-22 14:34:22 +01001# Copyright (c) 2022-2024, Arm Limited. All rights reserved.
Mate Toth-Pal14ba4af2022-10-21 14:24:49 +02002#
3# SPDX-License-Identifier: BSD-3-Clause
4#
5
laurenw-arm15aac382023-07-17 12:32:46 -05006$(eval $(call add_define,PLATFORM_TESTS))
7
8ifeq (${PLATFORM_TEST},rss-nv-counters)
9 include drivers/arm/rss/rss_comms.mk
10
11 # Test code.
12 BL31_SOURCES += plat/arm/board/tc/nv_counter_test.c
13
14 # Code under testing.
15 BL31_SOURCES += lib/psa/rss_platform.c \
laurenw-arm15aac382023-07-17 12:32:46 -050016 ${RSS_COMMS_SOURCES}
17
18 PLAT_INCLUDES += -Iinclude/lib/psa
19
20 $(eval $(call add_define,PLATFORM_TEST_NV_COUNTERS))
21else ifeq (${PLATFORM_TEST},rss-rotpk)
22 include drivers/arm/rss/rss_comms.mk
23
24 # Test code.
25 BL31_SOURCES += plat/arm/board/tc/rotpk_test.c
26
27 # Code under testing.
28 BL31_SOURCES += lib/psa/rss_platform.c \
laurenw-arm15aac382023-07-17 12:32:46 -050029 ${RSS_COMMS_SOURCES}
30
31 PLAT_INCLUDES += -Iinclude/lib/psa
32
33 $(eval $(call add_define,PLATFORM_TEST_ROTPK))
34else ifeq (${PLATFORM_TEST},tfm-testsuite)
David Vincze58131252023-12-22 14:34:22 +010035 include drivers/arm/rss/rss_comms.mk
Mate Toth-Pal14ba4af2022-10-21 14:24:49 +020036
37 # The variables need to be set to compile the platform test:
38 ifeq (${TF_M_TESTS_PATH},)
39 # Example: ../rss/tf-m-tests
40 $(error Error: TF_M_TESTS_PATH not set)
41 endif
42 ifeq (${TF_M_EXTRAS_PATH},)
43 # Example: ../rss/tf-m-extras
44 $(error Error: TF_M_EXTRAS_PATH not set)
45 endif
46 ifeq (${MEASUREMENT_VALUE_SIZE},)
47 MEASUREMENT_VALUE_SIZE := 32
48 endif
49 ifeq (${MEASURED_BOOT_HASH_ALG},)
50 MEASURED_BOOT_HASH_ALG := "PSA_ALG_SHA_256"
51 endif
52
53 DELEGATED_ATTEST_TESTS_PATH = $(TF_M_EXTRAS_PATH)/partitions/delegated_attestation/test
54 MEASURED_BOOT_TESTS_PATH = $(TF_M_EXTRAS_PATH)/partitions/measured_boot/test
55
56 MBEDTLS_CONFIG_FILE = "<plat_tc_mbedtls_config.h>"
57
David Vincze58131252023-12-22 14:34:22 +010058 LIBMBEDTLS_SRCS += $(addprefix ${MBEDTLS_DIR}/library/, \
Mate Toth-Pal14ba4af2022-10-21 14:24:49 +020059 entropy.c \
60 entropy_poll.c \
61 hmac_drbg.c \
62 psa_crypto.c \
63 psa_crypto_client.c \
64 psa_crypto_driver_wrappers.c \
65 psa_crypto_hash.c \
66 psa_crypto_rsa.c \
67 psa_crypto_ecp.c \
68 psa_crypto_slot_management.c \
69 )
70
David Vincze58131252023-12-22 14:34:22 +010071 BL31_SOURCES += ${RSS_COMMS_SOURCES} \
72 plat/arm/common/arm_dyn_cfg.c \
73 ${TC_BASE}/rss_ap_tests.c \
74 ${TC_BASE}/rss_ap_testsuites.c \
Mate Toth-Pal14ba4af2022-10-21 14:24:49 +020075 ${TC_BASE}/rss_ap_test_stubs.c \
David Vincze58131252023-12-22 14:34:22 +010076 $(TF_M_TESTS_PATH)/tests_reg/test/framework/test_framework.c \
Mate Toth-Pal14ba4af2022-10-21 14:24:49 +020077 $(MEASURED_BOOT_TESTS_PATH)/measured_boot_common.c \
78 $(MEASURED_BOOT_TESTS_PATH)/measured_boot_tests_common.c \
79 $(DELEGATED_ATTEST_TESTS_PATH)/delegated_attest_test.c \
David Vincze58131252023-12-22 14:34:22 +010080 drivers/auth/mbedtls/mbedtls_common.c \
81 lib/psa/measured_boot.c \
Mate Toth-Pal14ba4af2022-10-21 14:24:49 +020082 lib/psa/delegated_attestation.c
83
84 PLAT_INCLUDES += -I$(TF_M_EXTRAS_PATH)/partitions/measured_boot/interface/include \
85 -I$(TF_M_EXTRAS_PATH)/partitions/delegated_attestation/interface/include \
David Vincze58131252023-12-22 14:34:22 +010086 -I$(TF_M_TESTS_PATH)/tests_reg/test/framework \
87 -I$(TF_M_TESTS_PATH)/tests_reg/test/secure_fw/suites/extra \
88 -I$(TF_M_TESTS_PATH)/lib/log \
89 -I$(MEASURED_BOOT_TESTS_PATH)/non_secure \
90 -I$(DELEGATED_ATTEST_TESTS_PATH) \
91 -I$(DELEGATED_ATTEST_TESTS_PATH)/non_secure \
92 -Iplat/arm/board/tc \
93 -Iinclude/drivers/auth/mbedtls \
94 -Iinclude/drivers/arm \
95 -Iinclude/lib/psa
Mate Toth-Pal14ba4af2022-10-21 14:24:49 +020096
97 # Some of the PSA functions are declared in multiple header files, that
98 # triggers this warning.
99 TF_CFLAGS += -Wno-error=redundant-decls
100
101 # TODO: Created patch for warning in tf-m-tests
102 TF_CFLAGS += -Wno-error=return-type
103
104 # Define macros that are used by the code coming from the tf-m-extras repo.
105 $(eval $(call add_define,MEASUREMENT_VALUE_SIZE))
106 $(eval $(call add_define,MEASURED_BOOT_HASH_ALG))
107 $(eval $(call add_define,DELEG_ATTEST_DUMP_TOKEN_AND_KEY))
108
Tamas Ban15b79da2023-04-21 09:31:48 +0200109 $(eval $(call add_define,PLATFORM_TEST_TFM_TESTSUITE))
laurenw-arm15aac382023-07-17 12:32:46 -0500110else
111 $(error "Unsupported PLATFORM_TEST value")
Mate Toth-Pal14ba4af2022-10-21 14:24:49 +0200112endif