laurenw-arm | 2ce1e35 | 2023-02-07 13:40:05 -0600 | [diff] [blame] | 1 | # Copyright (c) 2021-2023, 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 | |
Manish V Badarkhe | 9bd1193 | 2022-11-11 09:36:29 +0000 | [diff] [blame] | 8 | ifeq ($(TARGET_PLATFORM), 0) |
| 9 | $(warning Platform ${PLAT}$(TARGET_PLATFORM) is deprecated. \ |
| 10 | Some of the features might not work as expected) |
| 11 | endif |
| 12 | |
Rupinderjit Singh | 820b3b6 | 2022-04-04 17:28:41 +0100 | [diff] [blame] | 13 | ifeq ($(shell expr $(TARGET_PLATFORM) \<= 2), 0) |
| 14 | $(error TARGET_PLATFORM must be less than or equal to 2) |
Usama Arif | f151362 | 2021-04-09 17:07:41 +0100 | [diff] [blame] | 15 | endif |
| 16 | |
Olivier Deprez | 7e5597c | 2022-07-20 17:37:23 +0200 | [diff] [blame] | 17 | $(eval $(call add_define,TARGET_PLATFORM)) |
| 18 | |
Usama Arif | f151362 | 2021-04-09 17:07:41 +0100 | [diff] [blame] | 19 | CSS_LOAD_SCP_IMAGES := 1 |
| 20 | |
| 21 | CSS_USE_SCMI_SDS_DRIVER := 1 |
| 22 | |
| 23 | RAS_EXTENSION := 0 |
| 24 | |
| 25 | SDEI_SUPPORT := 0 |
| 26 | |
| 27 | EL3_EXCEPTION_HANDLING := 0 |
| 28 | |
Manish Pandey | 0e3379d | 2022-10-10 11:43:08 +0100 | [diff] [blame] | 29 | HANDLE_EA_EL3_FIRST_NS := 0 |
Usama Arif | f151362 | 2021-04-09 17:07:41 +0100 | [diff] [blame] | 30 | |
| 31 | # System coherency is managed in hardware |
| 32 | HW_ASSISTED_COHERENCY := 1 |
| 33 | |
| 34 | # When building for systems with hardware-assisted coherency, there's no need to |
| 35 | # use USE_COHERENT_MEM. Require that USE_COHERENT_MEM must be set to 0 too. |
| 36 | USE_COHERENT_MEM := 0 |
| 37 | |
| 38 | GIC_ENABLE_V4_EXTN := 1 |
| 39 | |
| 40 | # GIC-600 configuration |
| 41 | GICV3_SUPPORT_GIC600 := 1 |
| 42 | |
Usama Arif | 1925c78 | 2021-08-20 20:53:34 +0100 | [diff] [blame] | 43 | # Enable SVE |
Jayanth Dodderi Chidanand | 4e169e7 | 2023-03-31 10:39:22 +0100 | [diff] [blame] | 44 | ENABLE_SVE_FOR_NS := 2 |
Usama Arif | 1925c78 | 2021-08-20 20:53:34 +0100 | [diff] [blame] | 45 | ENABLE_SVE_FOR_SWD := 1 |
Usama Arif | f151362 | 2021-04-09 17:07:41 +0100 | [diff] [blame] | 46 | |
Davidson K | 6536105 | 2021-10-13 18:49:41 +0530 | [diff] [blame] | 47 | # enable trace buffer control registers access to NS by default |
| 48 | ENABLE_TRBE_FOR_NS := 1 |
| 49 | |
| 50 | # enable trace system registers access to NS by default |
| 51 | ENABLE_SYS_REG_TRACE_FOR_NS := 1 |
| 52 | |
| 53 | # enable trace filter control registers access to NS by default |
| 54 | ENABLE_TRF_FOR_NS := 1 |
| 55 | |
Usama Arif | f151362 | 2021-04-09 17:07:41 +0100 | [diff] [blame] | 56 | # Include GICv3 driver files |
| 57 | include drivers/arm/gic/v3/gicv3.mk |
| 58 | |
| 59 | ENT_GIC_SOURCES := ${GICV3_SOURCES} \ |
| 60 | plat/common/plat_gicv3.c \ |
| 61 | plat/arm/common/arm_gicv3.c |
| 62 | |
| 63 | override NEED_BL2U := no |
| 64 | |
| 65 | override ARM_PLAT_MT := 1 |
| 66 | |
| 67 | TC_BASE = plat/arm/board/tc |
| 68 | |
| 69 | PLAT_INCLUDES += -I${TC_BASE}/include/ |
| 70 | |
Usama Arif | f151362 | 2021-04-09 17:07:41 +0100 | [diff] [blame] | 71 | # CPU libraries for TARGET_PLATFORM=0 |
| 72 | ifeq (${TARGET_PLATFORM}, 0) |
Rupinderjit Singh | 820b3b6 | 2022-04-04 17:28:41 +0100 | [diff] [blame] | 73 | TC_CPU_SOURCES += lib/cpus/aarch64/cortex_a510.S \ |
| 74 | lib/cpus/aarch64/cortex_a710.S \ |
Usama Arif | f151362 | 2021-04-09 17:07:41 +0100 | [diff] [blame] | 75 | lib/cpus/aarch64/cortex_x2.S |
| 76 | endif |
| 77 | |
| 78 | # CPU libraries for TARGET_PLATFORM=1 |
| 79 | ifeq (${TARGET_PLATFORM}, 1) |
Rupinderjit Singh | 820b3b6 | 2022-04-04 17:28:41 +0100 | [diff] [blame] | 80 | TC_CPU_SOURCES += lib/cpus/aarch64/cortex_a510.S \ |
Rupinderjit Singh | 7e46555 | 2022-08-23 11:55:27 +0100 | [diff] [blame] | 81 | lib/cpus/aarch64/cortex_a715.S \ |
| 82 | lib/cpus/aarch64/cortex_x3.S |
Usama Arif | f151362 | 2021-04-09 17:07:41 +0100 | [diff] [blame] | 83 | endif |
| 84 | |
Rupinderjit Singh | 820b3b6 | 2022-04-04 17:28:41 +0100 | [diff] [blame] | 85 | # CPU libraries for TARGET_PLATFORM=2 |
| 86 | ifeq (${TARGET_PLATFORM}, 2) |
| 87 | TC_CPU_SOURCES += lib/cpus/aarch64/cortex_hayes.S \ |
Harrison Mutai | 2205f9a | 2022-10-03 12:48:35 +0100 | [diff] [blame] | 88 | lib/cpus/aarch64/cortex_hunter.S \ |
| 89 | lib/cpus/aarch64/cortex_hunter_elp_arm.S |
Rupinderjit Singh | 820b3b6 | 2022-04-04 17:28:41 +0100 | [diff] [blame] | 90 | endif |
| 91 | |
Usama Arif | f151362 | 2021-04-09 17:07:41 +0100 | [diff] [blame] | 92 | INTERCONNECT_SOURCES := ${TC_BASE}/tc_interconnect.c |
| 93 | |
| 94 | PLAT_BL_COMMON_SOURCES += ${TC_BASE}/tc_plat.c \ |
| 95 | ${TC_BASE}/include/tc_helpers.S |
| 96 | |
| 97 | BL1_SOURCES += ${INTERCONNECT_SOURCES} \ |
| 98 | ${TC_CPU_SOURCES} \ |
| 99 | ${TC_BASE}/tc_trusted_boot.c \ |
| 100 | ${TC_BASE}/tc_err.c \ |
| 101 | drivers/arm/sbsa/sbsa.c |
| 102 | |
Usama Arif | f151362 | 2021-04-09 17:07:41 +0100 | [diff] [blame] | 103 | BL2_SOURCES += ${TC_BASE}/tc_security.c \ |
| 104 | ${TC_BASE}/tc_err.c \ |
| 105 | ${TC_BASE}/tc_trusted_boot.c \ |
Usama Arif | a49bd49 | 2021-08-17 17:57:10 +0100 | [diff] [blame] | 106 | ${TC_BASE}/tc_bl2_setup.c \ |
Usama Arif | f151362 | 2021-04-09 17:07:41 +0100 | [diff] [blame] | 107 | lib/utils/mem_region.c \ |
| 108 | drivers/arm/tzc/tzc400.c \ |
| 109 | plat/arm/common/arm_tzc400.c \ |
| 110 | plat/arm/common/arm_nor_psci_mem_protect.c |
| 111 | |
| 112 | BL31_SOURCES += ${INTERCONNECT_SOURCES} \ |
| 113 | ${TC_CPU_SOURCES} \ |
| 114 | ${ENT_GIC_SOURCES} \ |
| 115 | ${TC_BASE}/tc_bl31_setup.c \ |
| 116 | ${TC_BASE}/tc_topology.c \ |
Usama Arif | a49bd49 | 2021-08-17 17:57:10 +0100 | [diff] [blame] | 117 | lib/fconf/fconf.c \ |
| 118 | lib/fconf/fconf_dyn_cfg_getter.c \ |
Usama Arif | f151362 | 2021-04-09 17:07:41 +0100 | [diff] [blame] | 119 | drivers/cfi/v2m/v2m_flash.c \ |
| 120 | lib/utils/mem_region.c \ |
Madhukar Pappireddy | e108df2 | 2023-03-22 15:40:40 -0500 | [diff] [blame] | 121 | plat/arm/common/arm_nor_psci_mem_protect.c \ |
| 122 | drivers/arm/sbsa/sbsa.c |
Usama Arif | f151362 | 2021-04-09 17:07:41 +0100 | [diff] [blame] | 123 | |
Chris Kay | e927215 | 2021-09-28 15:52:14 +0100 | [diff] [blame] | 124 | BL31_SOURCES += ${FDT_WRAPPERS_SOURCES} |
| 125 | |
Usama Arif | f151362 | 2021-04-09 17:07:41 +0100 | [diff] [blame] | 126 | # Add the FDT_SOURCES and options for Dynamic Config |
| 127 | FDT_SOURCES += ${TC_BASE}/fdts/${PLAT}_fw_config.dts \ |
| 128 | ${TC_BASE}/fdts/${PLAT}_tb_fw_config.dts |
| 129 | FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_fw_config.dtb |
| 130 | TB_FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_tb_fw_config.dtb |
| 131 | |
| 132 | # Add the FW_CONFIG to FIP and specify the same to certtool |
| 133 | $(eval $(call TOOL_ADD_PAYLOAD,${FW_CONFIG},--fw-config,${FW_CONFIG})) |
| 134 | # Add the TB_FW_CONFIG to FIP and specify the same to certtool |
| 135 | $(eval $(call TOOL_ADD_PAYLOAD,${TB_FW_CONFIG},--tb-fw-config,${TB_FW_CONFIG})) |
| 136 | |
| 137 | ifeq (${SPD},spmd) |
| 138 | ifeq ($(ARM_SPMC_MANIFEST_DTS),) |
| 139 | ARM_SPMC_MANIFEST_DTS := ${TC_BASE}/fdts/${PLAT}_spmc_manifest.dts |
| 140 | endif |
| 141 | |
| 142 | FDT_SOURCES += ${ARM_SPMC_MANIFEST_DTS} |
| 143 | TC_TOS_FW_CONFIG := ${BUILD_PLAT}/fdts/$(notdir $(basename ${ARM_SPMC_MANIFEST_DTS})).dtb |
| 144 | |
| 145 | # Add the TOS_FW_CONFIG to FIP and specify the same to certtool |
| 146 | $(eval $(call TOOL_ADD_PAYLOAD,${TC_TOS_FW_CONFIG},--tos-fw-config,${TC_TOS_FW_CONFIG})) |
| 147 | endif |
| 148 | |
| 149 | #Device tree |
| 150 | TC_HW_CONFIG_DTS := fdts/tc.dts |
| 151 | TC_HW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}.dtb |
| 152 | FDT_SOURCES += ${TC_HW_CONFIG_DTS} |
| 153 | $(eval TC_HW_CONFIG := ${BUILD_PLAT}/$(patsubst %.dts,%.dtb,$(TC_HW_CONFIG_DTS))) |
| 154 | |
| 155 | # Add the HW_CONFIG to FIP and specify the same to certtool |
| 156 | $(eval $(call TOOL_ADD_PAYLOAD,${TC_HW_CONFIG},--hw-config,${TC_HW_CONFIG})) |
| 157 | |
| 158 | override CTX_INCLUDE_AARCH32_REGS := 0 |
| 159 | |
| 160 | override CTX_INCLUDE_PAUTH_REGS := 1 |
| 161 | |
Andre Przywara | 30661a9 | 2023-02-03 15:30:14 +0000 | [diff] [blame] | 162 | override ENABLE_SPE_FOR_NS := 0 |
Usama Arif | f151362 | 2021-04-09 17:07:41 +0100 | [diff] [blame] | 163 | |
Andre Przywara | 0b7f1b0 | 2023-03-21 13:53:19 +0000 | [diff] [blame] | 164 | override ENABLE_FEAT_AMU := 1 |
Chris Kay | c2d29ba | 2021-05-18 18:49:51 +0100 | [diff] [blame] | 165 | override ENABLE_AMU_AUXILIARY_COUNTERS := 1 |
| 166 | override ENABLE_AMU_FCONF := 1 |
| 167 | |
| 168 | override ENABLE_MPMM := 1 |
| 169 | override ENABLE_MPMM_FCONF := 1 |
Usama Arif | f151362 | 2021-04-09 17:07:41 +0100 | [diff] [blame] | 170 | |
Tamas Ban | ede4f05 | 2022-09-16 16:26:15 +0200 | [diff] [blame] | 171 | # Include Measured Boot makefile before any Crypto library makefile. |
| 172 | # Crypto library makefile may need default definitions of Measured Boot build |
| 173 | # flags present in Measured Boot makefile. |
| 174 | ifeq (${MEASURED_BOOT},1) |
| 175 | MEASURED_BOOT_MK := drivers/measured_boot/rss/rss_measured_boot.mk |
| 176 | $(info Including ${MEASURED_BOOT_MK}) |
| 177 | include ${MEASURED_BOOT_MK} |
| 178 | $(info Including rss_comms.mk) |
| 179 | include drivers/arm/rss/rss_comms.mk |
| 180 | |
| 181 | BL1_SOURCES += ${MEASURED_BOOT_SOURCES} \ |
| 182 | plat/arm/board/tc/tc_common_measured_boot.c \ |
| 183 | plat/arm/board/tc/tc_bl1_measured_boot.c \ |
| 184 | lib/psa/measured_boot.c \ |
| 185 | ${RSS_COMMS_SOURCES} |
| 186 | |
| 187 | BL2_SOURCES += ${MEASURED_BOOT_SOURCES} \ |
| 188 | plat/arm/board/tc/tc_common_measured_boot.c \ |
| 189 | plat/arm/board/tc/tc_bl2_measured_boot.c \ |
| 190 | lib/psa/measured_boot.c \ |
| 191 | ${RSS_COMMS_SOURCES} |
| 192 | |
| 193 | PLAT_INCLUDES += -Iinclude/lib/psa |
| 194 | |
| 195 | endif |
| 196 | |
laurenw-arm | 2ce1e35 | 2023-02-07 13:40:05 -0600 | [diff] [blame] | 197 | ifeq (${PLATFORM_TEST},rss-nv-counters) |
| 198 | include drivers/arm/rss/rss_comms.mk |
| 199 | |
| 200 | # Test code. |
| 201 | BL31_SOURCES += plat/arm/board/tc/nv_counter_test.c |
| 202 | |
| 203 | # Code under testing. |
| 204 | BL31_SOURCES += lib/psa/rss_platform.c \ |
| 205 | drivers/arm/rss/rss_comms.c \ |
| 206 | ${RSS_COMMS_SOURCES} |
| 207 | |
| 208 | PLAT_INCLUDES += -Iinclude/lib/psa |
| 209 | |
Tamas Ban | 15b79da | 2023-04-21 09:31:48 +0200 | [diff] [blame] | 210 | $(eval $(call add_define,PLATFORM_TEST_NV_COUNTERS)) |
laurenw-arm | 2ce1e35 | 2023-02-07 13:40:05 -0600 | [diff] [blame] | 211 | else ifeq (${PLATFORM_TEST},tfm-testsuite) |
| 212 | # Add this include as first, before arm_common.mk. This is necessary |
| 213 | # because arm_common.mk builds Mbed TLS, and platform_test.mk can |
| 214 | # change the list of Mbed TLS files that are to be compiled |
| 215 | # (LIBMBEDTLS_SRCS). |
| 216 | include plat/arm/board/tc/platform_test.mk |
| 217 | else ifneq (${PLATFORM_TEST},) |
| 218 | $(error "Unsupported PLATFORM_TEST value") |
| 219 | endif |
| 220 | |
Mate Toth-Pal | 14ba4af | 2022-10-21 14:24:49 +0200 | [diff] [blame] | 221 | |
Usama Arif | f151362 | 2021-04-09 17:07:41 +0100 | [diff] [blame] | 222 | include plat/arm/common/arm_common.mk |
| 223 | include plat/arm/css/common/css_common.mk |
| 224 | include plat/arm/soc/common/soc_css.mk |
| 225 | include plat/arm/board/common/board_common.mk |