Balint Dobszay | 1bf41f5 | 2022-05-30 12:56:38 +0200 | [diff] [blame] | 1 | FVP_USE_BASE_PLAT ?= y |
| 2 | FVP_VIRTFS_ENABLE ?= y |
| 3 | FVP_VIRTFS_AUTOMOUNT ?= y |
| 4 | MEASURED_BOOT ?= y |
| 5 | MEASURED_BOOT_FTPM ?= n |
| 6 | TS_SMM_GATEWAY ?= y |
Imre Kis | cef118b | 2023-01-11 18:01:46 +0100 | [diff] [blame] | 7 | TS_UEFI_TESTS ?= n |
Gyorgy Szing | 08d6974 | 2023-04-05 07:30:08 +0000 | [diff] [blame] | 8 | TS_FW_UPDATE ?= n |
Balint Dobszay | a59865b | 2022-09-13 16:47:27 +0200 | [diff] [blame] | 9 | # Supported values: embedded, fip |
| 10 | SP_PACKAGING_METHOD ?= embedded |
Imre Kis | cef118b | 2023-01-11 18:01:46 +0100 | [diff] [blame] | 11 | SPMC_TESTS ?= n |
Balint Dobszay | 1bf41f5 | 2022-05-30 12:56:38 +0200 | [diff] [blame] | 12 | |
Balint Dobszay | 6c7dfb2 | 2023-03-16 14:48:33 +0100 | [diff] [blame] | 13 | # Enable the "HArdware Volatile Entropy Gathering and Expansion" daemon to |
| 14 | # overcome low-entropy conditions in the FVP |
| 15 | BR2_PACKAGE_HAVEGED ?= y |
Balint Dobszay | 2e792b3 | 2023-06-05 18:07:32 +0200 | [diff] [blame] | 16 | |
| 17 | # Disable packages not used by this configuration |
| 18 | BR2_PACKAGE_HOST_E2FSPROGS ?= n |
| 19 | BR2_PACKAGE_KEYUTILS ?= n |
| 20 | BR2_PACKAGE_MMC_UTILS ?= n |
| 21 | BR2_PACKAGE_OPENSC ?= n |
| 22 | BR2_PACKAGE_OPTEE_EXAMPLES_EXT ?= n |
| 23 | BR2_PACKAGE_STRACE ?= n |
| 24 | |
| 25 | # Building xtest is not necessary if we don't want to run the SPMC tests |
| 26 | ifneq ($(SPMC_TESTS),y) |
| 27 | BR2_PACKAGE_OPTEE_TEST_EXT ?= n |
| 28 | BR2_PACKAGE_LIBOPENSSL ?= n |
| 29 | BR2_PACKAGE_OPENSSL ?= n |
| 30 | endif |
| 31 | |
Imre Kis | 874a2dd | 2023-01-09 17:01:22 +0100 | [diff] [blame] | 32 | # TS SP configurations |
| 33 | DEFAULT_SP_CONFIG ?= default-opteesp |
| 34 | SP_BLOCK_STORAGE_CONFIG ?= $(DEFAULT_SP_CONFIG) |
| 35 | SP_PSA_ITS_CONFIG ?= $(DEFAULT_SP_CONFIG) |
| 36 | SP_PSA_PS_CONFIG ?= $(DEFAULT_SP_CONFIG) |
| 37 | SP_PSA_CRYPTO_CONFIG ?= $(DEFAULT_SP_CONFIG) |
| 38 | SP_PSA_ATTESTATION_CONFIG ?= $(DEFAULT_SP_CONFIG) |
| 39 | SP_SMM_GATEWAY_CONFIG ?= $(DEFAULT_SP_CONFIG) |
Gyorgy Szing | 08d6974 | 2023-04-05 07:30:08 +0000 | [diff] [blame] | 40 | SP_FWU_CONFIG ?= $(DEFAULT_SP_CONFIG) |
Imre Kis | 874a2dd | 2023-01-09 17:01:22 +0100 | [diff] [blame] | 41 | |
Balint Dobszay | 1bf41f5 | 2022-05-30 12:56:38 +0200 | [diff] [blame] | 42 | TF_A_FLAGS ?= \ |
| 43 | BL32=$(OPTEE_OS_PAGER_V2_BIN) \ |
| 44 | BL33=$(EDK2_BIN) \ |
| 45 | PLAT=fvp \ |
| 46 | SPD=spmd \ |
| 47 | SPMD_SPM_AT_SEL2=0 \ |
Balint Dobszay | db9b8f0 | 2022-09-01 11:20:23 +0200 | [diff] [blame] | 48 | ARM_SPMC_MANIFEST_DTS=$(ROOT)/build/fvp/spmc_manifest.dts \ |
| 49 | $(TF_A_FIP_SP_FLAGS) |
Balint Dobszay | 1bf41f5 | 2022-05-30 12:56:38 +0200 | [diff] [blame] | 50 | |
Balint Dobszay | 3730e01 | 2023-06-02 11:40:41 +0200 | [diff] [blame] | 51 | LINUX_DEFCONFIG_COMMON_FILES ?= $(CURDIR)/kconfigs/fvp_trusted-services.conf |
| 52 | |
Balint Dobszay | 1bf41f5 | 2022-05-30 12:56:38 +0200 | [diff] [blame] | 53 | include fvp.mk |
| 54 | include trusted-services.mk |
| 55 | |
Imre Kis | efd2ece | 2023-04-05 13:35:28 +0200 | [diff] [blame] | 56 | # The macros used in bl2_sp_list.dts and spmc_manifest.dts has to be passed to |
| 57 | # TF-A because it handles the preprocessing of these files. |
| 58 | define add-dtc-define |
| 59 | DTC_CPPFLAGS+=-D$1=$(subst y,1,$(subst n,0,$($1))) |
| 60 | endef |
| 61 | |
| 62 | ifeq ($(SP_PACKAGING_METHOD),fip) |
| 63 | $(eval $(call add-dtc-define,SPMC_TESTS)) |
| 64 | $(eval $(call add-dtc-define,TS_SMM_GATEWAY)) |
Gyorgy Szing | 08d6974 | 2023-04-05 07:30:08 +0000 | [diff] [blame] | 65 | $(eval $(call add-dtc-define,TS_FW_UPDATE)) |
Imre Kis | efd2ece | 2023-04-05 13:35:28 +0200 | [diff] [blame] | 66 | |
| 67 | TF_A_EXPORTS += DTC_CPPFLAGS="$(DTC_CPPFLAGS)" |
| 68 | endif |
| 69 | |
Balint Dobszay | 1bf41f5 | 2022-05-30 12:56:38 +0200 | [diff] [blame] | 70 | OPTEE_OS_COMMON_EXTRA_FLAGS += \ |
| 71 | CFG_SECURE_PARTITION=y \ |
| 72 | CFG_CORE_SEL1_SPMC=y \ |
| 73 | CFG_CORE_HEAP_SIZE=131072 \ |
| 74 | CFG_DT=y \ |
| 75 | CFG_MAP_EXT_DT_SECURE=y |
| 76 | |
Jelle Sels | 3a937c5 | 2023-02-01 09:25:52 +0100 | [diff] [blame] | 77 | |
Balint Dobszay | 1bf41f5 | 2022-05-30 12:56:38 +0200 | [diff] [blame] | 78 | # The boot order of the SPs is determined by the order of calls here. This is |
| 79 | # due to the SPMC not (yet) supporting the boot order field of the SP manifest. |
Imre Kis | 0dbd3df | 2023-04-05 13:31:22 +0200 | [diff] [blame] | 80 | ifeq ($(SPMC_TESTS),n) |
| 81 | # PSA SPs |
Imre Kis | 874a2dd | 2023-01-09 17:01:22 +0100 | [diff] [blame] | 82 | $(eval $(call build-sp,block-storage,config/$(SP_BLOCK_STORAGE_CONFIG),63646e80-eb52-462f-ac4f-8cdf3987519c,$(SP_BLOCK_STORAGE_EXTRA_FLAGS))) |
| 83 | $(eval $(call build-sp,internal-trusted-storage,config/$(SP_PSA_ITS_CONFIG),dc1eef48-b17a-4ccf-ac8b-dfcff7711b14,$(SP_PSA_ITS_EXTRA_FLAGS))) |
| 84 | $(eval $(call build-sp,protected-storage,config/$(SP_PSA_PS_CONFIG),751bf801-3dde-4768-a514-0f10aeed1790,$(SP_PSA_PS_EXTRA_FLAGS))) |
| 85 | $(eval $(call build-sp,crypto,config/$(SP_PSA_CRYPTO_CONFIG),d9df52d5-16a2-4bb2-9aa4-d26d3b84e8c0,$(SP_PSA_CRYPTO_EXTRA_FLAGS))) |
Balint Dobszay | 1bf41f5 | 2022-05-30 12:56:38 +0200 | [diff] [blame] | 86 | ifeq ($(MEASURED_BOOT),y) |
Imre Kis | 874a2dd | 2023-01-09 17:01:22 +0100 | [diff] [blame] | 87 | $(eval $(call build-sp,attestation,config/$(SP_PSA_ATTESTATION_CONFIG),a1baf155-8876-4695-8f7c-54955e8db974,$(SP_PSA_ATTESTATION_EXTRA_FLAGS))) |
Balint Dobszay | 1bf41f5 | 2022-05-30 12:56:38 +0200 | [diff] [blame] | 88 | endif |
| 89 | ifeq ($(TS_SMM_GATEWAY),y) |
Imre Kis | 874a2dd | 2023-01-09 17:01:22 +0100 | [diff] [blame] | 90 | $(eval $(call build-sp,smm-gateway,config/$(SP_SMM_GATEWAY_CONFIG),ed32d533-99e6-4209-9cc0-2d72cdd998a7,$(SP_SMM_GATEWAY_EXTRA_FLAGS))) |
Balint Dobszay | 1bf41f5 | 2022-05-30 12:56:38 +0200 | [diff] [blame] | 91 | endif |
Gyorgy Szing | 08d6974 | 2023-04-05 07:30:08 +0000 | [diff] [blame] | 92 | ifeq ($(TS_FW_UPDATE),y) |
| 93 | $(eval $(call build-sp,fwu,config/$(SP_FWU_CONFIG),6823a838-1b06-470e-9774-0cce8bfb53fd,$(SP_FWU_EXTRA_FLAGS))) |
| 94 | endif |
Imre Kis | 0dbd3df | 2023-04-05 13:31:22 +0200 | [diff] [blame] | 95 | else |
| 96 | # SPMC test SPs |
| 97 | OPTEE_OS_COMMON_EXTRA_FLAGS += CFG_SPMC_TESTS=y |
| 98 | $(eval $(call build-sp,spm-test1,opteesp,5c9edbc3-7b3a-4367-9f83-7c191ae86a37,$(SP_SPMC_TEST_EXTRA_FLAGS))) |
| 99 | $(eval $(call build-sp,spm-test2,opteesp,7817164c-c40c-4d1a-867a-9bb2278cf41a,$(SP_SPMC_TEST_EXTRA_FLAGS))) |
| 100 | $(eval $(call build-sp,spm-test3,opteesp,23eb0100-e32a-4497-9052-2f11e584afa6,$(SP_SPMC_TEST_EXTRA_FLAGS))) |
| 101 | $(eval $(call build-sp,spm-test4,opteesp,423762ed-7772-406f-99d8-0c27da0abbf8,$(SP_SPMC_TEST_EXTRA_FLAGS))) |
| 102 | endif |
Balint Dobszay | c0b8fdf | 2022-06-02 14:41:54 +0200 | [diff] [blame] | 103 | |
Imre Kis | 0dbd3df | 2023-04-05 13:31:22 +0200 | [diff] [blame] | 104 | # Linux user space applications |
| 105 | ifeq ($(SPMC_TESTS),n) |
Gabor Toth | 22d7063 | 2023-11-09 19:05:17 +0100 | [diff] [blame^] | 106 | $(eval $(call build-ts-app,libts,$(TS_APP_LIBTS_EXTRA_FLAGS))) |
| 107 | $(eval $(call build-ts-app,ts-service-test,$(TS_APP_TS_SERVICE_TEST_EXTRA_FLAGS))) |
| 108 | $(eval $(call build-ts-app,psa-api-test/internal_trusted_storage,$(TS_APP_PSA_ITS_EXTRA_FLAGS))) |
| 109 | $(eval $(call build-ts-app,psa-api-test/protected_storage,$(TS_APP_PSA_PS_EXTRA_FLAGS))) |
| 110 | $(eval $(call build-ts-app,psa-api-test/crypto,$(TS_APP_PSA_CRYPTO_EXTRA_FLAGS))) |
Balint Dobszay | c0b8fdf | 2022-06-02 14:41:54 +0200 | [diff] [blame] | 111 | ifeq ($(MEASURED_BOOT),y) |
Gabor Toth | 22d7063 | 2023-11-09 19:05:17 +0100 | [diff] [blame^] | 112 | $(eval $(call build-ts-app,psa-api-test/initial_attestation,$(TS_APP_PSA_IAT_EXTRA_FLAGS))) |
Balint Dobszay | c0b8fdf | 2022-06-02 14:41:54 +0200 | [diff] [blame] | 113 | endif |
| 114 | ifeq ($(TS_UEFI_TESTS),y) |
Gabor Toth | 22d7063 | 2023-11-09 19:05:17 +0100 | [diff] [blame^] | 115 | $(eval $(call build-ts-app,uefi-test,$(TS_APP_UEFI_TEST_EXTRA_FLAGS))) |
Imre Kis | cad793f | 2023-09-08 15:53:31 +0200 | [diff] [blame] | 116 | |
| 117 | # uefi-test uses MM Communicate via the arm-ffa-user driver and the message |
| 118 | # payload is forwarded in a carveout memory area. Adding reserved-memory node to |
| 119 | # the device tree to prevent Linux from using the carveout area for other |
| 120 | # purposes. |
| 121 | |
| 122 | ORIGINAL_DTB := $(FVP_LINUX_DTB) |
| 123 | CARVEOUT_ENTRY = $(ROOT)/build/fvp/mm_communicate_carveout.dtsi |
| 124 | FVP_LINUX_DTB = $(ROOT)/out/fvp_with_mm_carveout.dtb |
| 125 | |
| 126 | $(FVP_LINUX_DTB): $(CARVEOUT_ENTRY) | linux |
| 127 | { dtc -Idtb -Odts $(ORIGINAL_DTB); cat $(CARVEOUT_ENTRY); } | dtc -Idts -Odtb -o $(FVP_LINUX_DTB) |
| 128 | |
| 129 | boot-img: $(FVP_LINUX_DTB) |
| 130 | |
| 131 | .PHONY: carveout-dtb-clean |
| 132 | carveout-dtb-clean: |
| 133 | rm -f $(FVP_LINUX_DTB) |
| 134 | |
| 135 | boot-img-clean: carveout-dtb-clean |
Balint Dobszay | c0b8fdf | 2022-06-02 14:41:54 +0200 | [diff] [blame] | 136 | endif |
Gyorgy Szing | 08d6974 | 2023-04-05 07:30:08 +0000 | [diff] [blame] | 137 | |
| 138 | ifeq ($(TS_FW_UPDATE),y) |
| 139 | |
| 140 | # TODO: the fwu-tool is currently not needed. |
Gabor Toth | 22d7063 | 2023-11-09 19:05:17 +0100 | [diff] [blame^] | 141 | $(eval $(call build-ts-host-app,fwu-tool,$(TS_HOST_UEFI_TEST_EXTRA_FLAGS))) |
Gyorgy Szing | 08d6974 | 2023-04-05 07:30:08 +0000 | [diff] [blame] | 142 | |
| 143 | ffa-fwu-sp: ts-host-fwu-tool |
| 144 | |
| 145 | # Copy the disk image used by FWU to the build directory to allow the FVP binary to find it. |
| 146 | $(BINARIES_PATH)/secure-flash.img: |
| 147 | mkdir -p $(BINARIES_PATH) |
| 148 | cp $(ROOT)/trusted-services/components/media/disk/disk_images/multi_location_fw.img $(BINARIES_PATH)/secure-flash.img |
| 149 | |
| 150 | # Add a shortcut to help manually doing the copy. |
| 151 | ffa-fwu-fash-img: $(BINARIES_PATH)/secure-flash.img |
| 152 | |
| 153 | ffa-fwu-sp: $(BINARIES_PATH)/secure-flash.img |
| 154 | |
| 155 | endif |
| 156 | |
| 157 | ffa-fwu-fash-img-clean: |
| 158 | rm -f $(BINARIES_PATH)/secure-flash.img |
| 159 | |
| 160 | clean: ffa-fwu-fash-img-clean |
| 161 | |
Gyorgy Szing | 9715e9d | 2023-04-05 11:04:12 +0000 | [diff] [blame] | 162 | clean: ts-host-all-clean ffa-test-all-clean ffa-sp-all-clean linux-arm-ffa-tee-clean linux-arm-ffa-user-clean |
| 163 | |
Jelle Sels | bb5a536 | 2022-07-18 17:07:05 +0200 | [diff] [blame] | 164 | endif |