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