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