blob: 848ad530c102eb34413c166c6329e630fb664a47 [file] [log] [blame]
Balint Dobszay1bf41f52022-05-30 12:56:38 +02001FVP_USE_BASE_PLAT ?= y
2FVP_VIRTFS_ENABLE ?= y
3FVP_VIRTFS_AUTOMOUNT ?= y
4MEASURED_BOOT ?= y
5MEASURED_BOOT_FTPM ?= n
6TS_SMM_GATEWAY ?= y
Imre Kiscef118b2023-01-11 18:01:46 +01007TS_UEFI_TESTS ?= n
Balint Dobszaya59865b2022-09-13 16:47:27 +02008# Supported values: embedded, fip
9SP_PACKAGING_METHOD ?= embedded
Imre Kiscef118b2023-01-11 18:01:46 +010010SPMC_TESTS ?= n
Balint Dobszay1bf41f52022-05-30 12:56:38 +020011
Balint Dobszay6c7dfb22023-03-16 14:48:33 +010012# Enable the "HArdware Volatile Entropy Gathering and Expansion" daemon to
13# overcome low-entropy conditions in the FVP
14BR2_PACKAGE_HAVEGED ?= y
Balint Dobszay2e792b32023-06-05 18:07:32 +020015
16# Disable packages not used by this configuration
17BR2_PACKAGE_HOST_E2FSPROGS ?= n
18BR2_PACKAGE_KEYUTILS ?= n
19BR2_PACKAGE_MMC_UTILS ?= n
20BR2_PACKAGE_OPENSC ?= n
21BR2_PACKAGE_OPTEE_EXAMPLES_EXT ?= n
22BR2_PACKAGE_STRACE ?= n
23
24# Building xtest is not necessary if we don't want to run the SPMC tests
25ifneq ($(SPMC_TESTS),y)
26BR2_PACKAGE_OPTEE_TEST_EXT ?= n
27BR2_PACKAGE_LIBOPENSSL ?= n
28BR2_PACKAGE_OPENSSL ?= n
29endif
30
Imre Kis874a2dd2023-01-09 17:01:22 +010031# TS SP configurations
32DEFAULT_SP_CONFIG ?= default-opteesp
33SP_BLOCK_STORAGE_CONFIG ?= $(DEFAULT_SP_CONFIG)
34SP_PSA_ITS_CONFIG ?= $(DEFAULT_SP_CONFIG)
35SP_PSA_PS_CONFIG ?= $(DEFAULT_SP_CONFIG)
36SP_PSA_CRYPTO_CONFIG ?= $(DEFAULT_SP_CONFIG)
37SP_PSA_ATTESTATION_CONFIG ?= $(DEFAULT_SP_CONFIG)
38SP_SMM_GATEWAY_CONFIG ?= $(DEFAULT_SP_CONFIG)
39
Balint Dobszay1bf41f52022-05-30 12:56:38 +020040TF_A_FLAGS ?= \
41 BL32=$(OPTEE_OS_PAGER_V2_BIN) \
42 BL33=$(EDK2_BIN) \
43 PLAT=fvp \
44 SPD=spmd \
45 SPMD_SPM_AT_SEL2=0 \
Balint Dobszaydb9b8f02022-09-01 11:20:23 +020046 ARM_SPMC_MANIFEST_DTS=$(ROOT)/build/fvp/spmc_manifest.dts \
47 $(TF_A_FIP_SP_FLAGS)
Balint Dobszay1bf41f52022-05-30 12:56:38 +020048
Balint Dobszay3730e012023-06-02 11:40:41 +020049LINUX_DEFCONFIG_COMMON_FILES ?= $(CURDIR)/kconfigs/fvp_trusted-services.conf
50
Balint Dobszay1bf41f52022-05-30 12:56:38 +020051include fvp.mk
52include trusted-services.mk
53
Imre Kisefd2ece2023-04-05 13:35:28 +020054# The macros used in bl2_sp_list.dts and spmc_manifest.dts has to be passed to
55# TF-A because it handles the preprocessing of these files.
56define add-dtc-define
57DTC_CPPFLAGS+=-D$1=$(subst y,1,$(subst n,0,$($1)))
58endef
59
60ifeq ($(SP_PACKAGING_METHOD),fip)
61$(eval $(call add-dtc-define,SPMC_TESTS))
62$(eval $(call add-dtc-define,TS_SMM_GATEWAY))
63
64TF_A_EXPORTS += DTC_CPPFLAGS="$(DTC_CPPFLAGS)"
65endif
66
Balint Dobszay1bf41f52022-05-30 12:56:38 +020067OPTEE_OS_COMMON_EXTRA_FLAGS += \
68 CFG_SECURE_PARTITION=y \
69 CFG_CORE_SEL1_SPMC=y \
70 CFG_CORE_HEAP_SIZE=131072 \
71 CFG_DT=y \
72 CFG_MAP_EXT_DT_SECURE=y
73
Jelle Sels3a937c52023-02-01 09:25:52 +010074
Balint Dobszay1bf41f52022-05-30 12:56:38 +020075# The boot order of the SPs is determined by the order of calls here. This is
76# due to the SPMC not (yet) supporting the boot order field of the SP manifest.
Imre Kis0dbd3df2023-04-05 13:31:22 +020077ifeq ($(SPMC_TESTS),n)
78# PSA SPs
Imre Kis874a2dd2023-01-09 17:01:22 +010079$(eval $(call build-sp,block-storage,config/$(SP_BLOCK_STORAGE_CONFIG),63646e80-eb52-462f-ac4f-8cdf3987519c,$(SP_BLOCK_STORAGE_EXTRA_FLAGS)))
80$(eval $(call build-sp,internal-trusted-storage,config/$(SP_PSA_ITS_CONFIG),dc1eef48-b17a-4ccf-ac8b-dfcff7711b14,$(SP_PSA_ITS_EXTRA_FLAGS)))
81$(eval $(call build-sp,protected-storage,config/$(SP_PSA_PS_CONFIG),751bf801-3dde-4768-a514-0f10aeed1790,$(SP_PSA_PS_EXTRA_FLAGS)))
82$(eval $(call build-sp,crypto,config/$(SP_PSA_CRYPTO_CONFIG),d9df52d5-16a2-4bb2-9aa4-d26d3b84e8c0,$(SP_PSA_CRYPTO_EXTRA_FLAGS)))
Balint Dobszay1bf41f52022-05-30 12:56:38 +020083ifeq ($(MEASURED_BOOT),y)
Imre Kis874a2dd2023-01-09 17:01:22 +010084$(eval $(call build-sp,attestation,config/$(SP_PSA_ATTESTATION_CONFIG),a1baf155-8876-4695-8f7c-54955e8db974,$(SP_PSA_ATTESTATION_EXTRA_FLAGS)))
Balint Dobszay1bf41f52022-05-30 12:56:38 +020085endif
86ifeq ($(TS_SMM_GATEWAY),y)
Imre Kis874a2dd2023-01-09 17:01:22 +010087$(eval $(call build-sp,smm-gateway,config/$(SP_SMM_GATEWAY_CONFIG),ed32d533-99e6-4209-9cc0-2d72cdd998a7,$(SP_SMM_GATEWAY_EXTRA_FLAGS)))
Balint Dobszay1bf41f52022-05-30 12:56:38 +020088endif
Imre Kis0dbd3df2023-04-05 13:31:22 +020089else
90# SPMC test SPs
91OPTEE_OS_COMMON_EXTRA_FLAGS += CFG_SPMC_TESTS=y
92$(eval $(call build-sp,spm-test1,opteesp,5c9edbc3-7b3a-4367-9f83-7c191ae86a37,$(SP_SPMC_TEST_EXTRA_FLAGS)))
93$(eval $(call build-sp,spm-test2,opteesp,7817164c-c40c-4d1a-867a-9bb2278cf41a,$(SP_SPMC_TEST_EXTRA_FLAGS)))
94$(eval $(call build-sp,spm-test3,opteesp,23eb0100-e32a-4497-9052-2f11e584afa6,$(SP_SPMC_TEST_EXTRA_FLAGS)))
95$(eval $(call build-sp,spm-test4,opteesp,423762ed-7772-406f-99d8-0c27da0abbf8,$(SP_SPMC_TEST_EXTRA_FLAGS)))
96endif
Balint Dobszayc0b8fdf2022-06-02 14:41:54 +020097
Imre Kis0dbd3df2023-04-05 13:31:22 +020098# Linux user space applications
99ifeq ($(SPMC_TESTS),n)
Balint Dobszayc0b8fdf2022-06-02 14:41:54 +0200100$(eval $(call build-ts-app,libts))
101$(eval $(call build-ts-app,ts-service-test))
102$(eval $(call build-ts-app,psa-api-test/internal_trusted_storage))
103$(eval $(call build-ts-app,psa-api-test/protected_storage))
104$(eval $(call build-ts-app,psa-api-test/crypto))
105ifeq ($(MEASURED_BOOT),y)
106$(eval $(call build-ts-app,psa-api-test/initial_attestation))
107endif
108ifeq ($(TS_UEFI_TESTS),y)
109$(eval $(call build-ts-app,uefi-test))
Imre Kiscad793f2023-09-08 15:53:31 +0200110
111# uefi-test uses MM Communicate via the arm-ffa-user driver and the message
112# payload is forwarded in a carveout memory area. Adding reserved-memory node to
113# the device tree to prevent Linux from using the carveout area for other
114# purposes.
115
116ORIGINAL_DTB := $(FVP_LINUX_DTB)
117CARVEOUT_ENTRY = $(ROOT)/build/fvp/mm_communicate_carveout.dtsi
118FVP_LINUX_DTB = $(ROOT)/out/fvp_with_mm_carveout.dtb
119
120$(FVP_LINUX_DTB): $(CARVEOUT_ENTRY) | linux
121 { dtc -Idtb -Odts $(ORIGINAL_DTB); cat $(CARVEOUT_ENTRY); } | dtc -Idts -Odtb -o $(FVP_LINUX_DTB)
122
123boot-img: $(FVP_LINUX_DTB)
124
125.PHONY: carveout-dtb-clean
126carveout-dtb-clean:
127 rm -f $(FVP_LINUX_DTB)
128
129boot-img-clean: carveout-dtb-clean
Balint Dobszayc0b8fdf2022-06-02 14:41:54 +0200130endif
Jelle Selsbb5a5362022-07-18 17:07:05 +0200131endif