Davidson K | d103f00 | 2023-07-03 11:54:45 +0530 | [diff] [blame] | 1 | # Copyright (c) 2021-2024, Arm Limited. All rights reserved. |
Usama Arif | f151362 | 2021-04-09 17:07:41 +0100 | [diff] [blame] | 2 | # |
| 3 | # SPDX-License-Identifier: BSD-3-Clause |
| 4 | # |
| 5 | |
Chris Kay | e927215 | 2021-09-28 15:52:14 +0100 | [diff] [blame] | 6 | include common/fdt_wrappers.mk |
| 7 | |
Boyan Karatotev | 192ad5d | 2023-12-12 15:59:01 +0000 | [diff] [blame] | 8 | TARGET_FLAVOUR := fvp |
Boyan Karatotev | 9556276 | 2023-11-15 11:54:33 +0000 | [diff] [blame] | 9 | # DPU with SCMI may not necessarily work, so allow its independence |
| 10 | TC_DPU_USE_SCMI_CLK := 1 |
Kshitij Sisodia | 090a6aa | 2023-11-22 17:03:45 +0000 | [diff] [blame] | 11 | # SCMI power domain control enable |
| 12 | TC_SCMI_PD_CTRL_EN := 1 |
| 13 | # IOMMU: Enable the use of system or individual MMUs |
| 14 | TC_IOMMU_EN := 1 |
Boyan Karatotev | 192ad5d | 2023-12-12 15:59:01 +0000 | [diff] [blame] | 15 | |
Boyan Karatotev | baff799 | 2023-12-27 15:49:18 +0000 | [diff] [blame] | 16 | # System setup |
| 17 | CSS_USE_SCMI_SDS_DRIVER := 1 |
| 18 | HW_ASSISTED_COHERENCY := 1 |
| 19 | USE_COHERENT_MEM := 0 |
| 20 | GIC_ENABLE_V4_EXTN := 1 |
| 21 | GICV3_SUPPORT_GIC600 := 1 |
| 22 | override NEED_BL2U := no |
| 23 | override ARM_PLAT_MT := 1 |
| 24 | |
| 25 | # CPU setup |
| 26 | ARM_ARCH_MINOR := 7 |
| 27 | BRANCH_PROTECTION := 1 |
| 28 | ENABLE_FEAT_MPAM := 1 # default is 2, optimise |
| 29 | ENABLE_SVE_FOR_NS := 2 # to show we use it |
| 30 | ENABLE_SVE_FOR_SWD := 1 |
| 31 | ENABLE_TRBE_FOR_NS := 1 |
| 32 | ENABLE_SYS_REG_TRACE_FOR_NS := 1 |
| 33 | ENABLE_FEAT_AMU := 1 |
| 34 | ENABLE_AMU_FCONF := 1 |
| 35 | ENABLE_AMU_AUXILIARY_COUNTERS := 1 |
| 36 | ENABLE_MPMM := 1 |
| 37 | ENABLE_MPMM_FCONF := 1 |
| 38 | |
| 39 | CTX_INCLUDE_AARCH32_REGS := 0 |
| 40 | |
| 41 | ifeq (${SPD},spmd) |
| 42 | SPMD_SPM_AT_SEL2 := 1 |
Leo Yan | 1ee60eb | 2024-04-29 14:20:35 +0100 | [diff] [blame] | 43 | ENABLE_FEAT_MTE2 := 1 |
Boyan Karatotev | baff799 | 2023-12-27 15:49:18 +0000 | [diff] [blame] | 44 | CTX_INCLUDE_PAUTH_REGS := 1 |
| 45 | endif |
| 46 | |
| 47 | |
Boyan Karatotev | 6ed3bf6 | 2023-07-07 13:33:19 +0000 | [diff] [blame] | 48 | ifneq ($(shell expr $(TARGET_PLATFORM) \<= 1), 0) |
Manish V Badarkhe | c7570d1 | 2023-11-20 18:25:49 +0000 | [diff] [blame] | 49 | $(warning Platform ${PLAT}$(TARGET_PLATFORM) is deprecated. \ |
| 50 | Some of the features might not work as expected) |
| 51 | endif |
| 52 | |
Boyan Karatotev | 6ed3bf6 | 2023-07-07 13:33:19 +0000 | [diff] [blame] | 53 | ifeq ($(shell expr $(TARGET_PLATFORM) \<= 3), 0) |
| 54 | $(error TARGET_PLATFORM must be less than or equal to 3) |
Usama Arif | f151362 | 2021-04-09 17:07:41 +0100 | [diff] [blame] | 55 | endif |
| 56 | |
Boyan Karatotev | 192ad5d | 2023-12-12 15:59:01 +0000 | [diff] [blame] | 57 | ifeq ($(filter ${TARGET_FLAVOUR}, fvp fpga),) |
| 58 | $(error TARGET_FLAVOUR must be fvp or fpga) |
| 59 | endif |
| 60 | |
| 61 | $(eval $(call add_defines, \ |
| 62 | TARGET_PLATFORM \ |
| 63 | TARGET_FLAVOUR_$(call uppercase,${TARGET_FLAVOUR}) \ |
Boyan Karatotev | 9556276 | 2023-11-15 11:54:33 +0000 | [diff] [blame] | 64 | TC_DPU_USE_SCMI_CLK \ |
Kshitij Sisodia | 090a6aa | 2023-11-22 17:03:45 +0000 | [diff] [blame] | 65 | TC_SCMI_PD_CTRL_EN \ |
| 66 | TC_IOMMU_EN \ |
Boyan Karatotev | 192ad5d | 2023-12-12 15:59:01 +0000 | [diff] [blame] | 67 | )) |
Olivier Deprez | 7e5597c | 2022-07-20 17:37:23 +0200 | [diff] [blame] | 68 | |
Usama Arif | f151362 | 2021-04-09 17:07:41 +0100 | [diff] [blame] | 69 | CSS_LOAD_SCP_IMAGES := 1 |
| 70 | |
Arvind Ram Prakash | b441920 | 2024-05-07 10:33:46 -0500 | [diff] [blame^] | 71 | # Save DSU PMU registers on cluster off and restore them on cluster on |
| 72 | PRESERVE_DSU_PMU_REGS := 1 |
| 73 | |
Usama Arif | f151362 | 2021-04-09 17:07:41 +0100 | [diff] [blame] | 74 | # Include GICv3 driver files |
| 75 | include drivers/arm/gic/v3/gicv3.mk |
| 76 | |
| 77 | ENT_GIC_SOURCES := ${GICV3_SOURCES} \ |
| 78 | plat/common/plat_gicv3.c \ |
| 79 | plat/arm/common/arm_gicv3.c |
| 80 | |
Usama Arif | f151362 | 2021-04-09 17:07:41 +0100 | [diff] [blame] | 81 | TC_BASE = plat/arm/board/tc |
| 82 | |
Boyan Karatotev | 8dec1f5 | 2023-12-20 16:28:23 +0000 | [diff] [blame] | 83 | PLAT_INCLUDES += -I${TC_BASE}/include/ \ |
| 84 | -I${TC_BASE}/fdts/ |
Usama Arif | f151362 | 2021-04-09 17:07:41 +0100 | [diff] [blame] | 85 | |
Usama Arif | f151362 | 2021-04-09 17:07:41 +0100 | [diff] [blame] | 86 | # CPU libraries for TARGET_PLATFORM=1 |
| 87 | ifeq (${TARGET_PLATFORM}, 1) |
Rupinderjit Singh | 820b3b6 | 2022-04-04 17:28:41 +0100 | [diff] [blame] | 88 | TC_CPU_SOURCES += lib/cpus/aarch64/cortex_a510.S \ |
Rupinderjit Singh | 7e46555 | 2022-08-23 11:55:27 +0100 | [diff] [blame] | 89 | lib/cpus/aarch64/cortex_a715.S \ |
| 90 | lib/cpus/aarch64/cortex_x3.S |
Usama Arif | f151362 | 2021-04-09 17:07:41 +0100 | [diff] [blame] | 91 | endif |
| 92 | |
Rupinderjit Singh | 820b3b6 | 2022-04-04 17:28:41 +0100 | [diff] [blame] | 93 | # CPU libraries for TARGET_PLATFORM=2 |
| 94 | ifeq (${TARGET_PLATFORM}, 2) |
Govindraj Raja | ca3caf0 | 2023-06-28 08:49:21 -0500 | [diff] [blame] | 95 | TC_CPU_SOURCES += lib/cpus/aarch64/cortex_a520.S \ |
Govindraj Raja | 37012fb | 2023-06-23 11:28:05 -0500 | [diff] [blame] | 96 | lib/cpus/aarch64/cortex_a720.S \ |
Govindraj Raja | 0a12091 | 2023-06-23 11:09:31 -0500 | [diff] [blame] | 97 | lib/cpus/aarch64/cortex_x4.S |
Rupinderjit Singh | 820b3b6 | 2022-04-04 17:28:41 +0100 | [diff] [blame] | 98 | endif |
| 99 | |
Boyan Karatotev | 6ed3bf6 | 2023-07-07 13:33:19 +0000 | [diff] [blame] | 100 | # CPU libraries for TARGET_PLATFORM=3 |
| 101 | ifeq (${TARGET_PLATFORM}, 3) |
| 102 | TC_CPU_SOURCES += lib/cpus/aarch64/cortex_a520.S \ |
| 103 | lib/cpus/aarch64/cortex_chaberton.S \ |
| 104 | lib/cpus/aarch64/cortex_blackhawk.S |
| 105 | endif |
| 106 | |
Usama Arif | f151362 | 2021-04-09 17:07:41 +0100 | [diff] [blame] | 107 | INTERCONNECT_SOURCES := ${TC_BASE}/tc_interconnect.c |
| 108 | |
| 109 | PLAT_BL_COMMON_SOURCES += ${TC_BASE}/tc_plat.c \ |
| 110 | ${TC_BASE}/include/tc_helpers.S |
| 111 | |
| 112 | BL1_SOURCES += ${INTERCONNECT_SOURCES} \ |
| 113 | ${TC_CPU_SOURCES} \ |
| 114 | ${TC_BASE}/tc_trusted_boot.c \ |
| 115 | ${TC_BASE}/tc_err.c \ |
| 116 | drivers/arm/sbsa/sbsa.c |
| 117 | |
Usama Arif | f151362 | 2021-04-09 17:07:41 +0100 | [diff] [blame] | 118 | BL2_SOURCES += ${TC_BASE}/tc_security.c \ |
| 119 | ${TC_BASE}/tc_err.c \ |
| 120 | ${TC_BASE}/tc_trusted_boot.c \ |
Usama Arif | a49bd49 | 2021-08-17 17:57:10 +0100 | [diff] [blame] | 121 | ${TC_BASE}/tc_bl2_setup.c \ |
Usama Arif | f151362 | 2021-04-09 17:07:41 +0100 | [diff] [blame] | 122 | lib/utils/mem_region.c \ |
| 123 | drivers/arm/tzc/tzc400.c \ |
| 124 | plat/arm/common/arm_tzc400.c \ |
| 125 | plat/arm/common/arm_nor_psci_mem_protect.c |
| 126 | |
| 127 | BL31_SOURCES += ${INTERCONNECT_SOURCES} \ |
| 128 | ${TC_CPU_SOURCES} \ |
| 129 | ${ENT_GIC_SOURCES} \ |
| 130 | ${TC_BASE}/tc_bl31_setup.c \ |
| 131 | ${TC_BASE}/tc_topology.c \ |
Usama Arif | a49bd49 | 2021-08-17 17:57:10 +0100 | [diff] [blame] | 132 | lib/fconf/fconf.c \ |
| 133 | lib/fconf/fconf_dyn_cfg_getter.c \ |
Arvind Ram Prakash | b441920 | 2024-05-07 10:33:46 -0500 | [diff] [blame^] | 134 | drivers/arm/css/dsu/dsu.c \ |
Usama Arif | f151362 | 2021-04-09 17:07:41 +0100 | [diff] [blame] | 135 | drivers/cfi/v2m/v2m_flash.c \ |
| 136 | lib/utils/mem_region.c \ |
Madhukar Pappireddy | e108df2 | 2023-03-22 15:40:40 -0500 | [diff] [blame] | 137 | plat/arm/common/arm_nor_psci_mem_protect.c \ |
| 138 | drivers/arm/sbsa/sbsa.c |
Usama Arif | f151362 | 2021-04-09 17:07:41 +0100 | [diff] [blame] | 139 | |
Chris Kay | e927215 | 2021-09-28 15:52:14 +0100 | [diff] [blame] | 140 | BL31_SOURCES += ${FDT_WRAPPERS_SOURCES} |
| 141 | |
Usama Arif | f151362 | 2021-04-09 17:07:41 +0100 | [diff] [blame] | 142 | # Add the FDT_SOURCES and options for Dynamic Config |
| 143 | FDT_SOURCES += ${TC_BASE}/fdts/${PLAT}_fw_config.dts \ |
Tamas Ban | f879bf1 | 2023-06-12 11:26:28 +0200 | [diff] [blame] | 144 | ${TC_BASE}/fdts/${PLAT}_tb_fw_config.dts \ |
| 145 | ${TC_BASE}/fdts/${PLAT}_nt_fw_config.dts |
Usama Arif | f151362 | 2021-04-09 17:07:41 +0100 | [diff] [blame] | 146 | FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_fw_config.dtb |
| 147 | TB_FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_tb_fw_config.dtb |
Tamas Ban | f879bf1 | 2023-06-12 11:26:28 +0200 | [diff] [blame] | 148 | FVP_NT_FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_nt_fw_config.dtb |
Usama Arif | f151362 | 2021-04-09 17:07:41 +0100 | [diff] [blame] | 149 | |
| 150 | # Add the FW_CONFIG to FIP and specify the same to certtool |
| 151 | $(eval $(call TOOL_ADD_PAYLOAD,${FW_CONFIG},--fw-config,${FW_CONFIG})) |
| 152 | # Add the TB_FW_CONFIG to FIP and specify the same to certtool |
| 153 | $(eval $(call TOOL_ADD_PAYLOAD,${TB_FW_CONFIG},--tb-fw-config,${TB_FW_CONFIG})) |
Tamas Ban | f879bf1 | 2023-06-12 11:26:28 +0200 | [diff] [blame] | 154 | # Add the NT_FW_CONFIG to FIP and specify the same to certtool |
| 155 | $(eval $(call TOOL_ADD_PAYLOAD,${FVP_NT_FW_CONFIG},--nt-fw-config,${FVP_NT_FW_CONFIG})) |
Usama Arif | f151362 | 2021-04-09 17:07:41 +0100 | [diff] [blame] | 156 | |
| 157 | ifeq (${SPD},spmd) |
| 158 | ifeq ($(ARM_SPMC_MANIFEST_DTS),) |
Boyan Karatotev | 8dec1f5 | 2023-12-20 16:28:23 +0000 | [diff] [blame] | 159 | ARM_SPMC_MANIFEST_DTS := ${TC_BASE}/fdts/${PLAT}_spmc_test_manifest.dts |
Usama Arif | f151362 | 2021-04-09 17:07:41 +0100 | [diff] [blame] | 160 | endif |
| 161 | |
| 162 | FDT_SOURCES += ${ARM_SPMC_MANIFEST_DTS} |
| 163 | TC_TOS_FW_CONFIG := ${BUILD_PLAT}/fdts/$(notdir $(basename ${ARM_SPMC_MANIFEST_DTS})).dtb |
| 164 | |
| 165 | # Add the TOS_FW_CONFIG to FIP and specify the same to certtool |
| 166 | $(eval $(call TOOL_ADD_PAYLOAD,${TC_TOS_FW_CONFIG},--tos-fw-config,${TC_TOS_FW_CONFIG})) |
| 167 | endif |
| 168 | |
| 169 | #Device tree |
Leo Yan | b4d7134 | 2024-04-14 08:27:39 +0100 | [diff] [blame] | 170 | TC_HW_CONFIG_DTS := fdts/${PLAT}${TARGET_PLATFORM}.dts |
Usama Arif | f151362 | 2021-04-09 17:07:41 +0100 | [diff] [blame] | 171 | TC_HW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}.dtb |
| 172 | FDT_SOURCES += ${TC_HW_CONFIG_DTS} |
| 173 | $(eval TC_HW_CONFIG := ${BUILD_PLAT}/$(patsubst %.dts,%.dtb,$(TC_HW_CONFIG_DTS))) |
| 174 | |
| 175 | # Add the HW_CONFIG to FIP and specify the same to certtool |
| 176 | $(eval $(call TOOL_ADD_PAYLOAD,${TC_HW_CONFIG},--hw-config,${TC_HW_CONFIG})) |
| 177 | |
Tamas Ban | ede4f05 | 2022-09-16 16:26:15 +0200 | [diff] [blame] | 178 | # Include Measured Boot makefile before any Crypto library makefile. |
| 179 | # Crypto library makefile may need default definitions of Measured Boot build |
| 180 | # flags present in Measured Boot makefile. |
Tamas Ban | dc15bf4 | 2024-02-22 11:35:28 +0100 | [diff] [blame] | 181 | $(info Including rse_comms.mk) |
Tamas Ban | ede4f05 | 2022-09-16 16:26:15 +0200 | [diff] [blame] | 182 | ifeq (${MEASURED_BOOT},1) |
Tamas Ban | dc15bf4 | 2024-02-22 11:35:28 +0100 | [diff] [blame] | 183 | $(info Including rse_comms.mk) |
| 184 | include drivers/arm/rse/rse_comms.mk |
Tamas Ban | ede4f05 | 2022-09-16 16:26:15 +0200 | [diff] [blame] | 185 | |
Tamas Ban | dc15bf4 | 2024-02-22 11:35:28 +0100 | [diff] [blame] | 186 | BL1_SOURCES += ${RSE_COMMS_SOURCES} |
| 187 | BL2_SOURCES += ${RSE_COMMS_SOURCES} |
Tamas Ban | a426089 | 2023-06-07 13:35:04 +0200 | [diff] [blame] | 188 | PLAT_INCLUDES += -Iinclude/lib/psa |
| 189 | |
| 190 | ifeq (${DICE_PROTECTION_ENVIRONMENT},1) |
| 191 | $(info Including qcbor.mk) |
Tamas Ban | dc15bf4 | 2024-02-22 11:35:28 +0100 | [diff] [blame] | 192 | include drivers/measured_boot/rse/qcbor.mk |
Tamas Ban | a426089 | 2023-06-07 13:35:04 +0200 | [diff] [blame] | 193 | $(info Including dice_prot_env.mk) |
Tamas Ban | dc15bf4 | 2024-02-22 11:35:28 +0100 | [diff] [blame] | 194 | include drivers/measured_boot/rse/dice_prot_env.mk |
Tamas Ban | a426089 | 2023-06-07 13:35:04 +0200 | [diff] [blame] | 195 | |
| 196 | BL1_SOURCES += ${QCBOR_SOURCES} \ |
| 197 | ${DPE_SOURCES} \ |
| 198 | plat/arm/board/tc/tc_common_dpe.c \ |
| 199 | plat/arm/board/tc/tc_bl1_dpe.c \ |
Tamas Ban | ae33fa9 | 2023-06-07 14:18:46 +0200 | [diff] [blame] | 200 | lib/psa/dice_protection_environment.c \ |
| 201 | drivers/arm/css/sds/sds.c \ |
| 202 | drivers/delay_timer/delay_timer.c \ |
| 203 | drivers/delay_timer/generic_delay_timer.c |
Tamas Ban | a426089 | 2023-06-07 13:35:04 +0200 | [diff] [blame] | 204 | |
| 205 | BL2_SOURCES += ${QCBOR_SOURCES} \ |
| 206 | ${DPE_SOURCES} \ |
| 207 | plat/arm/board/tc/tc_common_dpe.c \ |
| 208 | plat/arm/board/tc/tc_bl2_dpe.c \ |
| 209 | lib/psa/dice_protection_environment.c |
| 210 | |
| 211 | PLAT_INCLUDES += -I${QCBOR_INCLUDES} \ |
| 212 | -Iinclude/lib/dice |
| 213 | else |
Tamas Ban | dc15bf4 | 2024-02-22 11:35:28 +0100 | [diff] [blame] | 214 | $(info Including rse_measured_boot.mk) |
| 215 | include drivers/measured_boot/rse/rse_measured_boot.mk |
Tamas Ban | a426089 | 2023-06-07 13:35:04 +0200 | [diff] [blame] | 216 | |
| 217 | BL1_SOURCES += ${MEASURED_BOOT_SOURCES} \ |
Tamas Ban | ede4f05 | 2022-09-16 16:26:15 +0200 | [diff] [blame] | 218 | plat/arm/board/tc/tc_common_measured_boot.c \ |
| 219 | plat/arm/board/tc/tc_bl1_measured_boot.c \ |
Tamas Ban | a426089 | 2023-06-07 13:35:04 +0200 | [diff] [blame] | 220 | lib/psa/measured_boot.c |
Tamas Ban | ede4f05 | 2022-09-16 16:26:15 +0200 | [diff] [blame] | 221 | |
Tamas Ban | a426089 | 2023-06-07 13:35:04 +0200 | [diff] [blame] | 222 | BL2_SOURCES += ${MEASURED_BOOT_SOURCES} \ |
Tamas Ban | ede4f05 | 2022-09-16 16:26:15 +0200 | [diff] [blame] | 223 | plat/arm/board/tc/tc_common_measured_boot.c \ |
| 224 | plat/arm/board/tc/tc_bl2_measured_boot.c \ |
Tamas Ban | a426089 | 2023-06-07 13:35:04 +0200 | [diff] [blame] | 225 | lib/psa/measured_boot.c |
| 226 | endif |
Tamas Ban | ede4f05 | 2022-09-16 16:26:15 +0200 | [diff] [blame] | 227 | endif |
| 228 | |
David Vincze | 2cbc56b | 2024-01-04 18:37:12 +0100 | [diff] [blame] | 229 | ifeq (${TRNG_SUPPORT},1) |
| 230 | BL31_SOURCES += plat/arm/board/tc/tc_trng.c |
| 231 | endif |
| 232 | |
laurenw-arm | 4c4181c | 2023-05-04 14:55:37 -0500 | [diff] [blame] | 233 | ifneq (${PLATFORM_TEST},) |
laurenw-arm | 15aac38 | 2023-07-17 12:32:46 -0500 | [diff] [blame] | 234 | # Add this include as first, before arm_common.mk. This is necessary |
| 235 | # because arm_common.mk builds Mbed TLS, and platform_test.mk can |
| 236 | # change the list of Mbed TLS files that are to be compiled |
| 237 | # (LIBMBEDTLS_SRCS). |
| 238 | include plat/arm/board/tc/platform_test.mk |
laurenw-arm | 2ce1e35 | 2023-02-07 13:40:05 -0600 | [diff] [blame] | 239 | endif |
| 240 | |
Mate Toth-Pal | 14ba4af | 2022-10-21 14:24:49 +0200 | [diff] [blame] | 241 | |
Usama Arif | f151362 | 2021-04-09 17:07:41 +0100 | [diff] [blame] | 242 | include plat/arm/common/arm_common.mk |
| 243 | include plat/arm/css/common/css_common.mk |
| 244 | include plat/arm/soc/common/soc_css.mk |
| 245 | include plat/arm/board/common/board_common.mk |