blob: 213e8fbc08e7a744ca2c1b16ef0a97aacad362f4 [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
Gyorgy Szing08d69742023-04-05 07:30:08 +00008TS_FW_UPDATE ?= n
Gabor Totha95b5812023-11-09 19:10:36 +01009TS_UEFI_AUTH_VAR ?= y
Balint Dobszaya59865b2022-09-13 16:47:27 +020010# Supported values: embedded, fip
11SP_PACKAGING_METHOD ?= embedded
Imre Kiscef118b2023-01-11 18:01:46 +010012SPMC_TESTS ?= n
Balint Dobszay1bf41f52022-05-30 12:56:38 +020013
Gabor Totha95b5812023-11-09 19:10:36 +010014ifneq ($(TS_UEFI_AUTH_VAR)-$(TS_SMM_GATEWAY),y-y)
15SP_SMM_GATEWAY_EXTRA_FLAGS += -DUEFI_AUTH_VAR=OFF
16TS_APP_UEFI_TEST_EXTRA_FLAGS += -DUEFI_AUTH_VAR=OFF
17endif
18
Balint Dobszay6c7dfb22023-03-16 14:48:33 +010019# Enable the "HArdware Volatile Entropy Gathering and Expansion" daemon to
20# overcome low-entropy conditions in the FVP
21BR2_PACKAGE_HAVEGED ?= y
Balint Dobszay2e792b32023-06-05 18:07:32 +020022
23# Disable packages not used by this configuration
24BR2_PACKAGE_HOST_E2FSPROGS ?= n
25BR2_PACKAGE_KEYUTILS ?= n
26BR2_PACKAGE_MMC_UTILS ?= n
27BR2_PACKAGE_OPENSC ?= n
28BR2_PACKAGE_OPTEE_EXAMPLES_EXT ?= n
29BR2_PACKAGE_STRACE ?= n
30
31# Building xtest is not necessary if we don't want to run the SPMC tests
32ifneq ($(SPMC_TESTS),y)
33BR2_PACKAGE_OPTEE_TEST_EXT ?= n
34BR2_PACKAGE_LIBOPENSSL ?= n
35BR2_PACKAGE_OPENSSL ?= n
36endif
37
Imre Kis874a2dd2023-01-09 17:01:22 +010038# TS SP configurations
39DEFAULT_SP_CONFIG ?= default-opteesp
40SP_BLOCK_STORAGE_CONFIG ?= $(DEFAULT_SP_CONFIG)
41SP_PSA_ITS_CONFIG ?= $(DEFAULT_SP_CONFIG)
42SP_PSA_PS_CONFIG ?= $(DEFAULT_SP_CONFIG)
43SP_PSA_CRYPTO_CONFIG ?= $(DEFAULT_SP_CONFIG)
44SP_PSA_ATTESTATION_CONFIG ?= $(DEFAULT_SP_CONFIG)
45SP_SMM_GATEWAY_CONFIG ?= $(DEFAULT_SP_CONFIG)
Gyorgy Szing08d69742023-04-05 07:30:08 +000046SP_FWU_CONFIG ?= $(DEFAULT_SP_CONFIG)
Imre Kis874a2dd2023-01-09 17:01:22 +010047
Balint Dobszay1bf41f52022-05-30 12:56:38 +020048TF_A_FLAGS ?= \
49 BL32=$(OPTEE_OS_PAGER_V2_BIN) \
50 BL33=$(EDK2_BIN) \
51 PLAT=fvp \
52 SPD=spmd \
53 SPMD_SPM_AT_SEL2=0 \
Balint Dobszaydb9b8f02022-09-01 11:20:23 +020054 ARM_SPMC_MANIFEST_DTS=$(ROOT)/build/fvp/spmc_manifest.dts \
55 $(TF_A_FIP_SP_FLAGS)
Balint Dobszay1bf41f52022-05-30 12:56:38 +020056
Balint Dobszay3730e012023-06-02 11:40:41 +020057LINUX_DEFCONFIG_COMMON_FILES ?= $(CURDIR)/kconfigs/fvp_trusted-services.conf
58
Balint Dobszay1bf41f52022-05-30 12:56:38 +020059include fvp.mk
60include trusted-services.mk
61
Imre Kisefd2ece2023-04-05 13:35:28 +020062# The macros used in bl2_sp_list.dts and spmc_manifest.dts has to be passed to
63# TF-A because it handles the preprocessing of these files.
64define add-dtc-define
65DTC_CPPFLAGS+=-D$1=$(subst y,1,$(subst n,0,$($1)))
66endef
67
68ifeq ($(SP_PACKAGING_METHOD),fip)
69$(eval $(call add-dtc-define,SPMC_TESTS))
70$(eval $(call add-dtc-define,TS_SMM_GATEWAY))
Gyorgy Szing08d69742023-04-05 07:30:08 +000071$(eval $(call add-dtc-define,TS_FW_UPDATE))
Imre Kisefd2ece2023-04-05 13:35:28 +020072
73TF_A_EXPORTS += DTC_CPPFLAGS="$(DTC_CPPFLAGS)"
74endif
75
Balint Dobszay1bf41f52022-05-30 12:56:38 +020076OPTEE_OS_COMMON_EXTRA_FLAGS += \
77 CFG_SECURE_PARTITION=y \
78 CFG_CORE_SEL1_SPMC=y \
79 CFG_CORE_HEAP_SIZE=131072 \
80 CFG_DT=y \
81 CFG_MAP_EXT_DT_SECURE=y
82
Jelle Sels3a937c52023-02-01 09:25:52 +010083
Balint Dobszay1bf41f52022-05-30 12:56:38 +020084# The boot order of the SPs is determined by the order of calls here. This is
85# due to the SPMC not (yet) supporting the boot order field of the SP manifest.
Imre Kis0dbd3df2023-04-05 13:31:22 +020086ifeq ($(SPMC_TESTS),n)
87# PSA SPs
Imre Kis874a2dd2023-01-09 17:01:22 +010088$(eval $(call build-sp,block-storage,config/$(SP_BLOCK_STORAGE_CONFIG),63646e80-eb52-462f-ac4f-8cdf3987519c,$(SP_BLOCK_STORAGE_EXTRA_FLAGS)))
89$(eval $(call build-sp,internal-trusted-storage,config/$(SP_PSA_ITS_CONFIG),dc1eef48-b17a-4ccf-ac8b-dfcff7711b14,$(SP_PSA_ITS_EXTRA_FLAGS)))
90$(eval $(call build-sp,protected-storage,config/$(SP_PSA_PS_CONFIG),751bf801-3dde-4768-a514-0f10aeed1790,$(SP_PSA_PS_EXTRA_FLAGS)))
91$(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 +020092ifeq ($(MEASURED_BOOT),y)
Imre Kis874a2dd2023-01-09 17:01:22 +010093$(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 +020094endif
95ifeq ($(TS_SMM_GATEWAY),y)
Imre Kis874a2dd2023-01-09 17:01:22 +010096$(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 +020097endif
Gyorgy Szing08d69742023-04-05 07:30:08 +000098ifeq ($(TS_FW_UPDATE),y)
99$(eval $(call build-sp,fwu,config/$(SP_FWU_CONFIG),6823a838-1b06-470e-9774-0cce8bfb53fd,$(SP_FWU_EXTRA_FLAGS)))
100endif
Imre Kis0dbd3df2023-04-05 13:31:22 +0200101else
102# SPMC test SPs
103OPTEE_OS_COMMON_EXTRA_FLAGS += CFG_SPMC_TESTS=y
104$(eval $(call build-sp,spm-test1,opteesp,5c9edbc3-7b3a-4367-9f83-7c191ae86a37,$(SP_SPMC_TEST_EXTRA_FLAGS)))
105$(eval $(call build-sp,spm-test2,opteesp,7817164c-c40c-4d1a-867a-9bb2278cf41a,$(SP_SPMC_TEST_EXTRA_FLAGS)))
106$(eval $(call build-sp,spm-test3,opteesp,23eb0100-e32a-4497-9052-2f11e584afa6,$(SP_SPMC_TEST_EXTRA_FLAGS)))
107$(eval $(call build-sp,spm-test4,opteesp,423762ed-7772-406f-99d8-0c27da0abbf8,$(SP_SPMC_TEST_EXTRA_FLAGS)))
108endif
Balint Dobszayc0b8fdf2022-06-02 14:41:54 +0200109
Imre Kis0dbd3df2023-04-05 13:31:22 +0200110# Linux user space applications
111ifeq ($(SPMC_TESTS),n)
Gabor Toth22d70632023-11-09 19:05:17 +0100112$(eval $(call build-ts-app,libts,$(TS_APP_LIBTS_EXTRA_FLAGS)))
113$(eval $(call build-ts-app,ts-service-test,$(TS_APP_TS_SERVICE_TEST_EXTRA_FLAGS)))
114$(eval $(call build-ts-app,psa-api-test/internal_trusted_storage,$(TS_APP_PSA_ITS_EXTRA_FLAGS)))
115$(eval $(call build-ts-app,psa-api-test/protected_storage,$(TS_APP_PSA_PS_EXTRA_FLAGS)))
116$(eval $(call build-ts-app,psa-api-test/crypto,$(TS_APP_PSA_CRYPTO_EXTRA_FLAGS)))
Balint Dobszayc0b8fdf2022-06-02 14:41:54 +0200117ifeq ($(MEASURED_BOOT),y)
Gabor Toth22d70632023-11-09 19:05:17 +0100118$(eval $(call build-ts-app,psa-api-test/initial_attestation,$(TS_APP_PSA_IAT_EXTRA_FLAGS)))
Balint Dobszayc0b8fdf2022-06-02 14:41:54 +0200119endif
120ifeq ($(TS_UEFI_TESTS),y)
Gabor Toth22d70632023-11-09 19:05:17 +0100121$(eval $(call build-ts-app,uefi-test,$(TS_APP_UEFI_TEST_EXTRA_FLAGS)))
Imre Kiscad793f2023-09-08 15:53:31 +0200122
123# uefi-test uses MM Communicate via the arm-ffa-user driver and the message
124# payload is forwarded in a carveout memory area. Adding reserved-memory node to
125# the device tree to prevent Linux from using the carveout area for other
126# purposes.
127
128ORIGINAL_DTB := $(FVP_LINUX_DTB)
129CARVEOUT_ENTRY = $(ROOT)/build/fvp/mm_communicate_carveout.dtsi
130FVP_LINUX_DTB = $(ROOT)/out/fvp_with_mm_carveout.dtb
131
132$(FVP_LINUX_DTB): $(CARVEOUT_ENTRY) | linux
133 { dtc -Idtb -Odts $(ORIGINAL_DTB); cat $(CARVEOUT_ENTRY); } | dtc -Idts -Odtb -o $(FVP_LINUX_DTB)
134
135boot-img: $(FVP_LINUX_DTB)
136
137.PHONY: carveout-dtb-clean
138carveout-dtb-clean:
139 rm -f $(FVP_LINUX_DTB)
140
141boot-img-clean: carveout-dtb-clean
Balint Dobszayc0b8fdf2022-06-02 14:41:54 +0200142endif
Gyorgy Szing08d69742023-04-05 07:30:08 +0000143
144ifeq ($(TS_FW_UPDATE),y)
145
146# TODO: the fwu-tool is currently not needed.
Gabor Toth22d70632023-11-09 19:05:17 +0100147$(eval $(call build-ts-host-app,fwu-tool,$(TS_HOST_UEFI_TEST_EXTRA_FLAGS)))
Gyorgy Szing08d69742023-04-05 07:30:08 +0000148
149ffa-fwu-sp: ts-host-fwu-tool
150
151# Copy the disk image used by FWU to the build directory to allow the FVP binary to find it.
152$(BINARIES_PATH)/secure-flash.img:
153 mkdir -p $(BINARIES_PATH)
154 cp $(ROOT)/trusted-services/components/media/disk/disk_images/multi_location_fw.img $(BINARIES_PATH)/secure-flash.img
155
156# Add a shortcut to help manually doing the copy.
157ffa-fwu-fash-img: $(BINARIES_PATH)/secure-flash.img
158
159ffa-fwu-sp: $(BINARIES_PATH)/secure-flash.img
160
161endif
162
163ffa-fwu-fash-img-clean:
164 rm -f $(BINARIES_PATH)/secure-flash.img
165
166clean: ffa-fwu-fash-img-clean
167
Gyorgy Szing9715e9d2023-04-05 11:04:12 +0000168clean: ts-host-all-clean ffa-test-all-clean ffa-sp-all-clean linux-arm-ffa-tee-clean linux-arm-ffa-user-clean
169
Jelle Selsbb5a5362022-07-18 17:07:05 +0200170endif