David Vincze | 5813125 | 2023-12-22 14:34:22 +0100 | [diff] [blame] | 1 | # Copyright (c) 2022-2024, Arm Limited. All rights reserved. |
Mate Toth-Pal | 14ba4af | 2022-10-21 14:24:49 +0200 | [diff] [blame] | 2 | # |
| 3 | # SPDX-License-Identifier: BSD-3-Clause |
| 4 | # |
| 5 | |
laurenw-arm | 15aac38 | 2023-07-17 12:32:46 -0500 | [diff] [blame] | 6 | $(eval $(call add_define,PLATFORM_TESTS)) |
| 7 | |
| 8 | ifeq (${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-arm | 15aac38 | 2023-07-17 12:32:46 -0500 | [diff] [blame] | 16 | ${RSS_COMMS_SOURCES} |
| 17 | |
| 18 | PLAT_INCLUDES += -Iinclude/lib/psa |
| 19 | |
| 20 | $(eval $(call add_define,PLATFORM_TEST_NV_COUNTERS)) |
| 21 | else 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-arm | 15aac38 | 2023-07-17 12:32:46 -0500 | [diff] [blame] | 29 | ${RSS_COMMS_SOURCES} |
| 30 | |
| 31 | PLAT_INCLUDES += -Iinclude/lib/psa |
| 32 | |
| 33 | $(eval $(call add_define,PLATFORM_TEST_ROTPK)) |
| 34 | else ifeq (${PLATFORM_TEST},tfm-testsuite) |
David Vincze | 5813125 | 2023-12-22 14:34:22 +0100 | [diff] [blame] | 35 | include drivers/arm/rss/rss_comms.mk |
Mate Toth-Pal | 14ba4af | 2022-10-21 14:24:49 +0200 | [diff] [blame] | 36 | |
| 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 Vincze | 5813125 | 2023-12-22 14:34:22 +0100 | [diff] [blame] | 58 | LIBMBEDTLS_SRCS += $(addprefix ${MBEDTLS_DIR}/library/, \ |
Mate Toth-Pal | 14ba4af | 2022-10-21 14:24:49 +0200 | [diff] [blame] | 59 | 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 Vincze | 5813125 | 2023-12-22 14:34:22 +0100 | [diff] [blame] | 71 | 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-Pal | 14ba4af | 2022-10-21 14:24:49 +0200 | [diff] [blame] | 75 | ${TC_BASE}/rss_ap_test_stubs.c \ |
David Vincze | 5813125 | 2023-12-22 14:34:22 +0100 | [diff] [blame] | 76 | $(TF_M_TESTS_PATH)/tests_reg/test/framework/test_framework.c \ |
Mate Toth-Pal | 14ba4af | 2022-10-21 14:24:49 +0200 | [diff] [blame] | 77 | $(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 Vincze | 5813125 | 2023-12-22 14:34:22 +0100 | [diff] [blame] | 80 | drivers/auth/mbedtls/mbedtls_common.c \ |
| 81 | lib/psa/measured_boot.c \ |
Mate Toth-Pal | 14ba4af | 2022-10-21 14:24:49 +0200 | [diff] [blame] | 82 | 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 Vincze | 5813125 | 2023-12-22 14:34:22 +0100 | [diff] [blame] | 86 | -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-Pal | 14ba4af | 2022-10-21 14:24:49 +0200 | [diff] [blame] | 96 | |
| 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 Ban | 15b79da | 2023-04-21 09:31:48 +0200 | [diff] [blame] | 109 | $(eval $(call add_define,PLATFORM_TEST_TFM_TESTSUITE)) |
laurenw-arm | 15aac38 | 2023-07-17 12:32:46 -0500 | [diff] [blame] | 110 | else |
| 111 | $(error "Unsupported PLATFORM_TEST value") |
Mate Toth-Pal | 14ba4af | 2022-10-21 14:24:49 +0200 | [diff] [blame] | 112 | endif |