Jelle Sels | b2ccc05 | 2022-01-19 15:49:28 +0100 | [diff] [blame] | 1 | # Select which SPMC version to use. Possible values: |
| 2 | # - github: up-stream version from master branch |
| 3 | # - tforg: trustedfirmware.org fork (integration or psa-development branch) |
| 4 | SPMC_VERSION ?= github |
| 5 | |
Imre Kis | b35567d | 2022-03-02 13:52:34 +0100 | [diff] [blame] | 6 | # Select SP deployment type. Possible values: |
| 7 | # - opteesp: legacy OP-TEE specific ELF format |
| 8 | # - sp: generic binary SP, fip packaging method is forced by this option |
| 9 | SP_DEPLOYMENT_TYPE ?= opteesp |
| 10 | |
Jelle Sels | b2ccc05 | 2022-01-19 15:49:28 +0100 | [diff] [blame] | 11 | # Trusted Services build configs. SP_COMMON_FLAGS is passed to each Trusted |
| 12 | # Services SP. |
| 13 | SP_COMMON_FLAGS ?= |
| 14 | #PSA SP specific build configs: |
Balint Dobszay | 5cd7269 | 2022-04-20 10:08:18 +0200 | [diff] [blame] | 15 | ifeq (github, $(SPMC_VERSION)) |
Imre Kis | b35567d | 2022-03-02 13:52:34 +0100 | [diff] [blame] | 16 | ifeq (fip, $(SP_PACKAGING_METHOD)) |
| 17 | $(error Invalid packaging method for github version) |
| 18 | endif |
| 19 | ifeq (sp, $(SP_DEPLOYMENT_TYPE)) |
| 20 | $(error Unsupported deployment type for github version) |
| 21 | endif |
Jelle Sels | b2ccc05 | 2022-01-19 15:49:28 +0100 | [diff] [blame] | 22 | endif |
| 23 | PSA_ITS_EXTRA_FLAGS ?= |
| 24 | PSA_PROTECTED_STORAGE_EXTRA_FLAGS ?= |
Balint Dobszay | 5cd7269 | 2022-04-20 10:08:18 +0200 | [diff] [blame] | 25 | PSA_CRYPTO_EXTRA_FLAGS ?= |
Jelle Sels | b2ccc05 | 2022-01-19 15:49:28 +0100 | [diff] [blame] | 26 | PSA_ATTESTATION_EXTRA_FLAGS ?= |
| 27 | PSA_SMM_GATEWAY_EXTRA_FLAGS ?= |
| 28 | |
Balint Dobszay | 4ee874b | 2022-04-20 10:01:58 +0200 | [diff] [blame] | 29 | DTS_CONFIG ?= |
Balint Dobszay | d777a3e | 2020-07-15 15:53:05 +0200 | [diff] [blame] | 30 | DTS ?= optee_ffa |
| 31 | DTS_PATH ?= $(BUILD_PATH)/fvp |
| 32 | USE_FVP_BASE_PLAT ?= 1 |
| 33 | |
Imre Kis | b35567d | 2022-03-02 13:52:34 +0100 | [diff] [blame] | 34 | ifeq (opteesp, $(SP_DEPLOYMENT_TYPE)) |
| 35 | SP_FILE_EXTENSION=stripped.elf |
| 36 | else ifeq (sp, $(SP_DEPLOYMENT_TYPE)) |
| 37 | SP_FILE_EXTENSION=bin |
| 38 | SP_PACKAGING_METHOD=fip |
| 39 | else |
| 40 | $(error Invalid SP deployment type $(SP_DEPLOYMENT_TYPE)) |
| 41 | endif |
| 42 | |
Balint Dobszay | d520b00 | 2021-03-29 18:54:30 +0200 | [diff] [blame] | 43 | # Use "embedded" or "fip" |
| 44 | SP_PACKAGING_METHOD ?= embedded |
| 45 | |
Balint Dobszay | d777a3e | 2020-07-15 15:53:05 +0200 | [diff] [blame] | 46 | OPTEE_OS_COMMON_EXTRA_FLAGS += CFG_CORE_SEL1_SPMC=y CFG_CORE_FFA=y |
Gyorgy Szing | f3a6712 | 2021-06-28 17:47:14 +0200 | [diff] [blame] | 47 | OPTEE_OS_COMMON_EXTRA_FLAGS += CFG_CORE_HEAP_SIZE=131072 |
Balint Dobszay | d777a3e | 2020-07-15 15:53:05 +0200 | [diff] [blame] | 48 | OPTEE_OS_COMMON_EXTRA_FLAGS += O=out/arm |
Jelle Sels | b2ccc05 | 2022-01-19 15:49:28 +0100 | [diff] [blame] | 49 | ifeq (tforg, $(SPMC_VERSION)) |
| 50 | OPTEE_OS_COMMON_EXTRA_FLAGS += CFG_WITH_SP=y |
Jelle Sels | b2ccc05 | 2022-01-19 15:49:28 +0100 | [diff] [blame] | 51 | else |
Jelle Sels | b2ccc05 | 2022-01-19 15:49:28 +0100 | [diff] [blame] | 52 | OPTEE_OS_COMMON_EXTRA_FLAGS += CFG_SECURE_PARTITION=y |
| 53 | endif |
| 54 | |
Balint Dobszay | 5cd7269 | 2022-04-20 10:08:18 +0200 | [diff] [blame] | 55 | SP_EVENT_LOG ?= y |
| 56 | |
Jelle Sels | d58d027 | 2021-06-04 10:36:22 +0200 | [diff] [blame] | 57 | ifeq (y,$(SP_EVENT_LOG)) |
| 58 | TF_A_FLAGS ?= \ |
| 59 | ARM_TSP_RAM_LOCATION=tdram \ |
| 60 | BL32=$(OPTEE_OS_PAGER_V2_BIN) \ |
| 61 | BL33=$(EDK2_BIN) \ |
| 62 | DEBUG=0 \ |
| 63 | PLAT=fvp \ |
| 64 | SPMD_SPM_AT_SEL2=0 \ |
| 65 | MBEDTLS_DIR=$(ROOT)/mbedtls \ |
| 66 | ARM_ROTPK_LOCATION=devel_rsa \ |
| 67 | ARM_TSP_RAM_LOCATION=tdram \ |
| 68 | FVP_USE_GIC_DRIVER=FVP_GICV3 \ |
| 69 | GENERATE_COT=1 \ |
| 70 | MEASURED_BOOT=1 \ |
| 71 | PLAT=fvp \ |
| 72 | ROT_KEY=plat/arm/board/common/rotpk/arm_rotprivk_rsa.pem \ |
| 73 | TPM_HASH_ALG=sha256 \ |
| 74 | TRUSTED_BOARD_BOOT=1 \ |
| 75 | EVENT_LOG_LEVEL=20 \ |
| 76 | BL2_optee=y \ |
| 77 | SPD=spmd |
| 78 | else |
Balint Dobszay | d777a3e | 2020-07-15 15:53:05 +0200 | [diff] [blame] | 79 | TF_A_FLAGS ?= \ |
| 80 | ARM_TSP_RAM_LOCATION=tdram \ |
| 81 | BL32=$(OPTEE_OS_PAGER_V2_BIN) \ |
| 82 | BL33=$(EDK2_BIN) \ |
| 83 | DEBUG=$(DEBUG) \ |
| 84 | PLAT=fvp \ |
| 85 | SPD=spmd \ |
| 86 | SPMD_SPM_AT_SEL2=0 |
Jelle Sels | d58d027 | 2021-06-04 10:36:22 +0200 | [diff] [blame] | 87 | endif |
Balint Dobszay | d777a3e | 2020-07-15 15:53:05 +0200 | [diff] [blame] | 88 | include fvp.mk |
Gyorgy Szing | 0a5029d | 2020-11-06 00:33:49 +0100 | [diff] [blame] | 89 | |
Jelle Sels | d58d027 | 2021-06-04 10:36:22 +0200 | [diff] [blame] | 90 | TF_A_FLAGS+=ARM_SPMC_MANIFEST_DTS=$(CURDIR)/fvp/spmc_manifest.dts |
Gyorgy Szing | 0a5029d | 2020-11-06 00:33:49 +0100 | [diff] [blame] | 91 | TS_INSTALL_PREFIX:=$(CURDIR)/../out-ts |
| 92 | |
| 93 | # Add machinery allowing to build secure partitions from Trusted Services. |
| 94 | # |
Jelle Sels | e6f9633 | 2022-01-19 15:45:37 +0100 | [diff] [blame] | 95 | # build-sp <sp-name>,<uuid>,<TS build flags> |
Gyorgy Szing | 0a5029d | 2020-11-06 00:33:49 +0100 | [diff] [blame] | 96 | # <sp name> The name of the SP. |
| 97 | # |
| 98 | # When called build and clean targets for the SP will be defined as: |
| 99 | # |
| 100 | # ffa-<sp name>-sp - Build the SP with cmake, and include the SP |
| 101 | # export makefile to make the SP binary part |
| 102 | # of the OP-TEE OS image. |
| 103 | # ffa-<sp name>-sp-clean - run make clean on the cmake project |
| 104 | # ffa-<sp name>-sp-realclean - remove all cmake output |
| 105 | # |
Balint Dobszay | d520b00 | 2021-03-29 18:54:30 +0200 | [diff] [blame] | 106 | # To run these for each SP in one step, the "ffa-sp-all", "ffa-sp-all-clean" and |
| 107 | # "ffa-sp-all-realclean" targets are defined. |
| 108 | # |
Gyorgy Szing | 0a5029d | 2020-11-06 00:33:49 +0100 | [diff] [blame] | 109 | # The build and the clean target are added to the dependency tree of common |
| 110 | # op-tee targets. |
| 111 | # |
Jelle Sels | e6f9633 | 2022-01-19 15:45:37 +0100 | [diff] [blame] | 112 | #example: |
| 113 | #$(eval $(call build-sp,crypto,d9df52d5-16a2-4bb2-9aa4-d26d3b84e8c0, -DTS_PLATFORM=ts/mock)) |
| 114 | #This wil build the crypto_sp with the mock platorm as it backend. |
| 115 | #Don't add spaces between the ',' and the uuid and name. |
Gyorgy Szing | 0a5029d | 2020-11-06 00:33:49 +0100 | [diff] [blame] | 116 | |
Balint Dobszay | d520b00 | 2021-03-29 18:54:30 +0200 | [diff] [blame] | 117 | .PHONY: ffa-sp-all |
| 118 | .PHONY: ffa-sp-all-clean |
| 119 | .PHONY: ffa-sp-all-realclean |
| 120 | |
| 121 | optee-os-common: ffa-sp-all |
| 122 | optee-os-clean: ffa-sp-all-clean |
| 123 | |
| 124 | ffa-sp-all-realclean: |
Imre Kis | b35567d | 2022-03-02 13:52:34 +0100 | [diff] [blame] | 125 | rm -rf $(TS_INSTALL_PREFIX)/$(SP_DEPLOYMENT_TYPE) |
Balint Dobszay | d520b00 | 2021-03-29 18:54:30 +0200 | [diff] [blame] | 126 | |
Jelle Sels | b2ccc05 | 2022-01-19 15:49:28 +0100 | [diff] [blame] | 127 | ifeq (tforg-fip, $(SPMC_VERSION)-$(SP_PACKAGING_METHOD)) |
Balint Dobszay | d520b00 | 2021-03-29 18:54:30 +0200 | [diff] [blame] | 128 | # If FIP packaging method is selected, TF-A requires a number of config options: |
| 129 | # - ARM_BL2_SP_LIST_DTS: This file will be included into the TB_FW_CONFIG DT |
| 130 | # of TF-A. It contains the UUID and load address of SP |
| 131 | # packages present in the FIP, BL2 will load them based |
| 132 | # on this information. |
| 133 | # - ARM_SPMC_MANIFEST_DTS: Contains information about the SPMC: consumed by the |
| 134 | # SPMD at SPMC init. And about the SP packages: the |
| 135 | # SPMC can only know where the packages were loaded by |
| 136 | # BL2 based on this file. |
| 137 | # - SP_LAYOUT_FILE: JSON file which describes the corresponding SP image |
| 138 | # and SP manifest DT pairs, TF-A will create the SP |
| 139 | # packages based on this. However, the TS build |
| 140 | # provides a separate JSON file for each SP. A Python |
| 141 | # snippet is used to merge these JSONs into one file. |
Jelle Sels | e6f9633 | 2022-01-19 15:45:37 +0100 | [diff] [blame] | 142 | define include_sp |
Imre Kis | b35567d | 2022-03-02 13:52:34 +0100 | [diff] [blame] | 143 | TS_SP_JSON_LIST+=${TS_INSTALL_PREFIX}/$(SP_DEPLOYMENT_TYPE)/json/$1.json |
Jelle Sels | e6f9633 | 2022-01-19 15:45:37 +0100 | [diff] [blame] | 144 | endef |
Imre Kis | b35567d | 2022-03-02 13:52:34 +0100 | [diff] [blame] | 145 | SP_LAYOUT_FILE := $(TS_INSTALL_PREFIX)/$(SP_DEPLOYMENT_TYPE)/json/sp_layout.json |
Balint Dobszay | d520b00 | 2021-03-29 18:54:30 +0200 | [diff] [blame] | 146 | |
| 147 | TF_A_FLAGS+=SP_LAYOUT_FILE=$(SP_LAYOUT_FILE) |
| 148 | TF_A_FLAGS+=ARM_BL2_SP_LIST_DTS=$(CURDIR)/fvp/bl2_sp_images.dtsi |
Balint Dobszay | d520b00 | 2021-03-29 18:54:30 +0200 | [diff] [blame] | 149 | OPTEE_OS_COMMON_EXTRA_FLAGS+=CFG_FIP_SP=y |
| 150 | |
| 151 | MERGE_JSON_PY := import json, sys |
| 152 | MERGE_JSON_PY += \ncombined = {} |
| 153 | MERGE_JSON_PY += \nfor path in sys.stdin.read().split(): |
| 154 | MERGE_JSON_PY += \n with open(path) as f: |
| 155 | MERGE_JSON_PY += \n current = json.load(f) |
| 156 | MERGE_JSON_PY += \n combined = {**combined, **current} |
| 157 | MERGE_JSON_PY += \nprint(json.dumps(combined, indent=4)) |
| 158 | |
| 159 | $(SP_LAYOUT_FILE): ffa-sp-all |
| 160 | @echo $(TS_SP_JSON_LIST) | python3 -c "$$(echo -e '$(MERGE_JSON_PY)')" > $(SP_LAYOUT_FILE) |
| 161 | |
| 162 | .PHONY: ffa-sp-layout-clean |
| 163 | ffa-sp-layout-clean: |
| 164 | @rm -f $(SP_LAYOUT_FILE) |
| 165 | |
| 166 | arm-tf: $(SP_LAYOUT_FILE) |
| 167 | ffa-sp-all-clean: ffa-sp-layout-clean |
| 168 | endif |
Balint Dobszay | 7700109 | 2021-02-15 13:52:55 +0100 | [diff] [blame] | 169 | |
Jelle Sels | b2ccc05 | 2022-01-19 15:49:28 +0100 | [diff] [blame] | 170 | ifeq (embedded, $(SP_PACKAGING_METHOD)) |
Jelle Sels | 4c1375b | 2022-02-24 14:00:00 +0100 | [diff] [blame] | 171 | |
| 172 | # build_fdt converts the SP manifest dts file to have the proper |
| 173 | # UUID format and builds the fdt into a dtb file which can be used by |
| 174 | # OP-TEE. |
| 175 | define build_fdt |
| 176 | ffa-$1-dts: ffa-$1-sp |
| 177 | python3 fvp/fdt_uuid_conversion.py --fdt ${TS_INSTALL_PREFIX}/opteesp/manifest/$2.dts |
| 178 | dtc -I dts -O dtb -o ${TS_INSTALL_PREFIX}/opteesp/manifest/$2.dtb ${TS_INSTALL_PREFIX}/opteesp/manifest/$2.dts |
| 179 | ffa-sp-all: ffa-$1-dts |
| 180 | endef |
| 181 | |
| 182 | |
| 183 | # If the SPMC version is tforg and embedded packaging method is selected then |
| 184 | # the SP manifest files from TS have to be merged into a common DTS file, which |
| 185 | # is passed to OP-TEE as the embedded DT file. For each SP a dtsi file is |
| 186 | # exported from TS, which contains a single node, representing that SP. |
Balint Dobszay | 5c7c058 | 2021-04-13 13:02:22 +0200 | [diff] [blame] | 187 | # The TS_SP_DTSI_LIST parameter contains a line like this for each SP: |
| 188 | # |
| 189 | # #include "<absolute_path_to_dtsi>/<sp_uuid>.dtsi" |
| 190 | # |
Jelle Sels | e6f9633 | 2022-01-19 15:45:37 +0100 | [diff] [blame] | 191 | define include_sp |
Jelle Sels | b2ccc05 | 2022-01-19 15:49:28 +0100 | [diff] [blame] | 192 | ifeq (tforg, $(SPMC_VERSION)) |
Imre Kis | b35567d | 2022-03-02 13:52:34 +0100 | [diff] [blame] | 193 | OPTEE_OS_COMMON_EXTRA_FLAGS+=EARLY_TA_PATHS+=${TS_INSTALL_PREFIX}/$(SP_DEPLOYMENT_TYPE)/bin/$2.$(SP_FILE_EXTENSION) |
| 194 | TS_SP_DTSI_LIST+="\\n\#include \"${TS_INSTALL_PREFIX}/$(SP_DEPLOYMENT_TYPE)/manifest/$2.dtsi\"" |
Jelle Sels | b2ccc05 | 2022-01-19 15:49:28 +0100 | [diff] [blame] | 195 | else |
Imre Kis | b35567d | 2022-03-02 13:52:34 +0100 | [diff] [blame] | 196 | OPTEE_OS_COMMON_EXTRA_FLAGS+=SP_PATHS+=${TS_INSTALL_PREFIX}/$(SP_DEPLOYMENT_TYPE)/bin/$2.$(SP_FILE_EXTENSION) |
Jelle Sels | 4c1375b | 2022-02-24 14:00:00 +0100 | [diff] [blame] | 197 | $(eval $(call build_fdt,$1,$2)) |
Jelle Sels | b2ccc05 | 2022-01-19 15:49:28 +0100 | [diff] [blame] | 198 | endif |
Jelle Sels | e6f9633 | 2022-01-19 15:45:37 +0100 | [diff] [blame] | 199 | endef |
| 200 | |
Jelle Sels | b2ccc05 | 2022-01-19 15:49:28 +0100 | [diff] [blame] | 201 | ifeq (tforg, $(SPMC_VERSION)) |
Balint Dobszay | 5c7c058 | 2021-04-13 13:02:22 +0200 | [diff] [blame] | 202 | SP_MANIFEST_FILE := $(OUT_PATH)/sp_manifest.dts |
| 203 | OPTEE_OS_COMMON_EXTRA_FLAGS+=CFG_EMBED_DTB_SOURCE_FILE=$(SP_MANIFEST_FILE) |
| 204 | |
| 205 | $(SP_MANIFEST_FILE): ffa-sp-all |
| 206 | @echo -e "/dts-v1/;\n/ {$(TS_SP_DTSI_LIST)\n};" > $(SP_MANIFEST_FILE) |
| 207 | |
Jelle Sels | e6f9633 | 2022-01-19 15:45:37 +0100 | [diff] [blame] | 208 | optee-os-common: $(SP_MANIFEST_FILE) |
| 209 | |
Balint Dobszay | 5c7c058 | 2021-04-13 13:02:22 +0200 | [diff] [blame] | 210 | .PHONY: ffa-sp-manifest-clean |
| 211 | ffa-sp-manifest-clean: |
| 212 | @rm -f $(SP_MANIFEST_FILE) |
Balint Dobszay | 5c7c058 | 2021-04-13 13:02:22 +0200 | [diff] [blame] | 213 | ffa-sp-all-clean: ffa-sp-manifest-clean |
| 214 | endif |
Jelle Sels | b2ccc05 | 2022-01-19 15:49:28 +0100 | [diff] [blame] | 215 | endif |
Balint Dobszay | 5c7c058 | 2021-04-13 13:02:22 +0200 | [diff] [blame] | 216 | |
Jelle Sels | e6f9633 | 2022-01-19 15:45:37 +0100 | [diff] [blame] | 217 | define build-sp |
| 218 | .PHONY: ffa-$1-sp |
| 219 | ffa-$1-sp: |
Jelle Sels | e6f9633 | 2022-01-19 15:45:37 +0100 | [diff] [blame] | 220 | CROSS_COMPILE="$$(AARCH64_CROSS_COMPILE)" cmake -G"Unix Makefiles" -DCMAKE_INSTALL_PREFIX=$${TS_INSTALL_PREFIX} \ |
Imre Kis | b35567d | 2022-03-02 13:52:34 +0100 | [diff] [blame] | 221 | -S $$(CURDIR)/../trusted-services/deployments/$1/$(SP_DEPLOYMENT_TYPE) -B $$(CURDIR)/../ts-build/$1 \ |
Jelle Sels | b2ccc05 | 2022-01-19 15:49:28 +0100 | [diff] [blame] | 222 | ${SP_COMMON_FLAGS} $3 |
Jelle Sels | e6f9633 | 2022-01-19 15:45:37 +0100 | [diff] [blame] | 223 | cmake --build $$(CURDIR)/../ts-build/$1 -- -j$$(nproc) |
| 224 | cmake --install $$(CURDIR)/../ts-build/$1 |
Jelle Sels | 4c1375b | 2022-02-24 14:00:00 +0100 | [diff] [blame] | 225 | $(eval $(call include_sp,$1,$2)) |
| 226 | |
Jelle Sels | e6f9633 | 2022-01-19 15:45:37 +0100 | [diff] [blame] | 227 | |
| 228 | .PHONY: ffa-$1-sp-clean |
| 229 | ffa-$1-sp-clean: |
| 230 | cmake --build $$(CURDIR)/../ts-build/$1 -- clean -j$$(nproc) |
| 231 | |
| 232 | .PHONY: ffa-$1-sp-realclean |
| 233 | ffa-$1-sp-realclean: |
| 234 | rm -rf $$(CURDIR)/../ts-build/$1 |
| 235 | |
| 236 | ffa-sp-all: ffa-$1-sp |
| 237 | ffa-sp-all-clean: ffa-$1-sp-clean |
| 238 | ffa-sp-all-realclean: ffa-$1-sp-realclean |
| 239 | endef |
| 240 | |
Jelle Sels | b2ccc05 | 2022-01-19 15:49:28 +0100 | [diff] [blame] | 241 | $(eval $(call build-sp,internal-trusted-storage,dc1eef48-b17a-4ccf-ac8b-dfcff7711b14, ${PSA_ITS_EXTRA_FLAGS})) |
| 242 | $(eval $(call build-sp,protected-storage,751bf801-3dde-4768-a514-0f10aeed1790, ${PSA_PROTECTED_STORAGE_EXTRA_FLAGS})) |
| 243 | $(eval $(call build-sp,crypto,d9df52d5-16a2-4bb2-9aa4-d26d3b84e8c0, ${PSA_CRYPTO_EXTRA_FLAGS})) |
Jelle Sels | b2ccc05 | 2022-01-19 15:49:28 +0100 | [diff] [blame] | 244 | $(eval $(call build-sp,attestation,a1baf155-8876-4695-8f7c-54955e8db974, ${PSA_ATTESTATION_EXTRA_FLAGS})) |
Balint Dobszay | 5cd7269 | 2022-04-20 10:08:18 +0200 | [diff] [blame] | 245 | ifeq (tforg, $(SPMC_VERSION)) |
Jelle Sels | b2ccc05 | 2022-01-19 15:49:28 +0100 | [diff] [blame] | 246 | $(eval $(call build-sp,smm-gateway,ed32d533-99e6-4209-9cc0-2d72cdd998a7, ${PSA_SMM_GATEWAY_EXTRA_FLAGS})) |
| 247 | endif |
Jelle Sels | e6f9633 | 2022-01-19 15:45:37 +0100 | [diff] [blame] | 248 | |
| 249 | .PHONY: sp_uuid_list |
| 250 | sp_uuid_list: $(SHARED_DIR)/sp_uuid_list.txt |
| 251 | |
| 252 | .PHONY: sp_uuid_list_clean |
| 253 | sp_uuid_list_clean: |
| 254 | rm -rf $(SHARED_DIR)/sp_uuid_list.txt |
| 255 | |
| 256 | ffa-sp-all-clean: sp_uuid_list_clean |
| 257 | |
Gyorgy Szing | d2d555a | 2022-05-11 11:34:51 +0200 | [diff] [blame] | 258 | $(SHARED_DIR)/sp_uuid_list.txt: ffa-sp-all | shared_directory |
Imre Kis | b35567d | 2022-03-02 13:52:34 +0100 | [diff] [blame] | 259 | find $(TS_INSTALL_PREFIX)/$(SP_DEPLOYMENT_TYPE)/bin -name "[0-9a-f-]*.$(SP_FILE_EXTENSION)" -type f | \ |
| 260 | sed -n "s@.*/\(.*\).$(SP_FILE_EXTENSION)@\1@gp" | tr '\n' ',' | \ |
Balint Dobszay | 1cd203b | 2021-04-28 13:24:12 +0200 | [diff] [blame] | 261 | head -c -1 > $(SHARED_DIR)/sp_uuid_list.txt |
Gyorgy Szing | 7d8a64b | 2020-11-10 15:54:01 +0100 | [diff] [blame] | 262 | |
Jelle Sels | e6f9633 | 2022-01-19 15:45:37 +0100 | [diff] [blame] | 263 | # Add targets to build the "arm_ffa_user" Linux Kernel module. |
Gyorgy Szing | 1723937 | 2022-05-11 11:53:15 +0200 | [diff] [blame] | 264 | arm_ffa_user: sp_uuid_list linux | $(OUT_PATH) |
Jelle Sels | e6f9633 | 2022-01-19 15:45:37 +0100 | [diff] [blame] | 265 | $(eval ROOT:=$(CURDIR)/..) |
Gyorgy Szing | 1723937 | 2022-05-11 11:53:15 +0200 | [diff] [blame] | 266 | mkdir -p $(OUT_PATH)/arm_ffa_user |
| 267 | make -C $(CURDIR)/../linux_poc $(LINUX_COMMON_FLAGS) install TARGET_DIR=$(OUT_PATH)/arm_ffa_user |
Jelle Sels | e6f9633 | 2022-01-19 15:45:37 +0100 | [diff] [blame] | 268 | |
Gyorgy Szing | 7d8a64b | 2020-11-10 15:54:01 +0100 | [diff] [blame] | 269 | arm_ffa_user_clean: |
| 270 | make -C $(CURDIR)/../linux_poc clean |
| 271 | |
Gyorgy Szing | 1723937 | 2022-05-11 11:53:15 +0200 | [diff] [blame] | 272 | arm_ffa_tee: linux | $(OUT_PATH) |
| 273 | $(eval ROOT:=$(CURDIR)/..) |
| 274 | mkdir -p $(OUT_PATH)/arm_ffa_tee |
| 275 | make -C $(CURDIR)/../linux_tee $(LINUX_COMMON_FLAGS) install TARGET_DIR=$(OUT_PATH)/arm_ffa_tee |
| 276 | |
| 277 | arm_ffa_tee_clean: |
| 278 | make -C $(CURDIR)/../linux_tee clean |
| 279 | |
| 280 | # Copy out-of-tree kernel modules to shared directory and concatenate module load scripts. |
| 281 | arm_ffa_drivers: arm_ffa_tee arm_ffa_user | shared_directory |
| 282 | cat $(OUT_PATH)/arm_ffa_tee/load_module.sh $(OUT_PATH)/arm_ffa_user/load_module.sh > $(SHARED_DIR)/load_module.sh |
| 283 | chmod 775 $(SHARED_DIR)/load_module.sh |
| 284 | cp -u $(OUT_PATH)/arm_ffa_tee/arm-ffa-tee.ko $(SHARED_DIR) |
| 285 | cp -u $(OUT_PATH)/arm_ffa_user/arm-ffa-user.ko $(SHARED_DIR) |
| 286 | |
| 287 | all: arm_ffa_drivers |
Gyorgy Szing | c3408cd | 2022-05-11 11:42:50 +0200 | [diff] [blame] | 288 | |
| 289 | # Disable CONFIG_STRICT_DEVMEM option in the Linux kernel config. This allows userspace access to |
| 290 | # the whole NS physical address space through /dev/mem. |
| 291 | linux-defconfig: |
| 292 | cd $(LINUX_PATH) && ./scripts/config --disable CONFIG_STRICT_DEVMEM |