| 1 |
# Copyright (c) 2024, Arm Limited and Contributors. All rights reserved. |
| 2 |
# |
| 3 |
# SPDX-License-Identifier: BSD-3-Clause |
| 4 |
# |
| 5 |
|
| 6 |
RD_V3_VARIANTS := 0 1 2 |
| 7 |
ifneq ($(NRD_PLATFORM_VARIANT), \ |
| 8 |
$(filter $(NRD_PLATFORM_VARIANT),$(RD_V3_VARIANTS))) |
| 9 |
$(error "NRD_PLATFORM_VARIANT for RD-V3 should be 0, 1, or 2," |
| 10 |
"currently set to ${NRD_PLATFORM_VARIANT}.") |
| 11 |
endif |
| 12 |
|
| 13 |
$(eval $(call CREATE_SEQ,SEQ,4)) |
| 14 |
ifneq ($(NRD_CHIP_COUNT),$(filter $(NRD_CHIP_COUNT),$(SEQ))) |
| 15 |
$(error "Chip count for RD-V3-MC should be either $(SEQ) \ |
| 16 |
currently it is set to ${NRD_CHIP_COUNT}.") |
| 17 |
endif |
| 18 |
|
| 19 |
# Build options |
| 20 |
# Major and Minor versions |
| 21 |
override ARM_ARCH_MAJOR := 8 |
| 22 |
override ARM_ARCH_MINOR := 7 |
| 23 |
|
| 24 |
# Misc options |
| 25 |
override CTX_INCLUDE_AARCH32_REGS := 0 |
| 26 |
|
| 27 |
ifeq (${PLAT_RESET_TO_BL31}, 1) |
| 28 |
# Support for BL31 boot flow |
| 29 |
override RESET_TO_BL31 := 1 |
| 30 |
|
| 31 |
# arm_common.mk sets ENABLE_PIE=1, but Makefile blocks PIE for RME |
| 32 |
override ENABLE_PIE := 0 |
| 33 |
|
| 34 |
# Non Trusted Firmware parameters |
| 35 |
override ARM_PRELOADED_DTB_BASE := 0xF3000000 |
| 36 |
override ARM_LINUX_KERNEL_AS_BL33 := 1 |
| 37 |
override PRELOADED_BL33_BASE := 0xE0000000 |
| 38 |
|
| 39 |
# These are internal build flags but as of now RESET_TO_BL31 won't work without defining them |
| 40 |
override NEED_BL1 := no |
| 41 |
override NEED_BL2 := no |
| 42 |
override NEED_BL32 := no |
| 43 |
endif |
| 44 |
|
| 45 |
# RD-V3 platform uses GIC-700 which is based on GICv4.1 |
| 46 |
GIC_ENABLE_V4_EXTN := 1 |
| 47 |
|
| 48 |
# Enable GIC multichip extension only for multichip platforms |
| 49 |
ifeq (${NRD_PLATFORM_VARIANT}, 2) |
| 50 |
GICV3_IMPL_GIC600_MULTICHIP := 1 |
| 51 |
endif |
| 52 |
|
| 53 |
# RD-V3 uses MHUv3 |
| 54 |
PLAT_MHU_VERSION := 3 |
| 55 |
|
| 56 |
include plat/arm/board/neoverse_rd/common/nrd-common.mk |
| 57 |
include drivers/arm/rse/rse_comms.mk |
| 58 |
include drivers/auth/mbedtls/mbedtls_common.mk |
| 59 |
ifeq (${MEASURED_BOOT},1) |
| 60 |
include drivers/measured_boot/rse/rse_measured_boot.mk |
| 61 |
endif |
| 62 |
|
| 63 |
RDV3_BASE = plat/arm/board/neoverse_rd/platform/rdv3 |
| 64 |
|
| 65 |
PLAT_INCLUDES += -I${NRD_COMMON_BASE}/include/nrd3/ \ |
| 66 |
-I${RDV3_BASE}/include/ \ |
| 67 |
-Iinclude/lib/psa |
| 68 |
|
| 69 |
NRD_CPU_SOURCES := lib/cpus/aarch64/neoverse_v3.S |
| 70 |
|
| 71 |
# Source files for RD-V3 variants |
| 72 |
PLAT_BL_COMMON_SOURCES \ |
| 73 |
+= ${NRD_COMMON_BASE}/nrd_plat3.c \ |
| 74 |
${RDV3_BASE}/rdv3_common.c |
| 75 |
|
| 76 |
PLAT_MEASURED_BOOT_SOURCES \ |
| 77 |
:= ${MEASURED_BOOT_SOURCES} \ |
| 78 |
${RSE_COMMS_SOURCES} \ |
| 79 |
${RDV3_BASE}/rdv3_common_measured_boot.c \ |
| 80 |
lib/psa/measured_boot.c |
| 81 |
|
| 82 |
BL1_SOURCES += ${NRD_CPU_SOURCES} \ |
| 83 |
${RDV3_BASE}/rdv3_err.c \ |
| 84 |
${RDV3_BASE}/rdv3_mhuv3.c |
| 85 |
ifeq (${TRUSTED_BOARD_BOOT}, 1) |
| 86 |
BL1_SOURCES += ${RDV3_BASE}/rdv3_trusted_boot.c |
| 87 |
endif |
| 88 |
ifeq (${MEASURED_BOOT},1) |
| 89 |
BL1_SOURCES += ${PLAT_MEASURED_BOOT_SOURCES} \ |
| 90 |
${RDV3_BASE}/rdv3_bl1_measured_boot.c |
| 91 |
endif |
| 92 |
|
| 93 |
BL2_SOURCES += ${RDV3_BASE}/rdv3_bl2_setup.c \ |
| 94 |
${RDV3_BASE}/rdv3_err.c \ |
| 95 |
${RDV3_BASE}/rdv3_mhuv3.c \ |
| 96 |
${RDV3_BASE}/rdv3_security.c \ |
| 97 |
lib/utils/mem_region.c \ |
| 98 |
plat/arm/common/arm_nor_psci_mem_protect.c |
| 99 |
ifeq (${TRUSTED_BOARD_BOOT}, 1) |
| 100 |
BL2_SOURCES += ${RDV3_BASE}/rdv3_trusted_boot.c |
| 101 |
endif |
| 102 |
ifeq (${MEASURED_BOOT},1) |
| 103 |
BL2_SOURCES += ${PLAT_MEASURED_BOOT_SOURCES} \ |
| 104 |
${RDV3_BASE}/rdv3_bl2_measured_boot.c |
| 105 |
endif |
| 106 |
|
| 107 |
ifeq (${PLAT_RESET_TO_BL31}, 1) |
| 108 |
BL31_SOURCES += ${RDV3_BASE}/rdv3_security.c |
| 109 |
endif |
| 110 |
|
| 111 |
BL31_SOURCES += ${NRD_CPU_SOURCES} \ |
| 112 |
${MBEDTLS_SOURCES} \ |
| 113 |
${RSE_COMMS_SOURCES} \ |
| 114 |
${RDV3_BASE}/rdv3_bl31_setup.c \ |
| 115 |
${RDV3_BASE}/rdv3_mhuv3.c \ |
| 116 |
${RDV3_BASE}/rdv3_topology.c \ |
| 117 |
${RDV3_BASE}/rdv3_plat_attest_token.c \ |
| 118 |
${RDV3_BASE}/rdv3_realm_attest_key.c \ |
| 119 |
drivers/arm/smmu/smmu_v3.c \ |
| 120 |
drivers/cfi/v2m/v2m_flash.c \ |
| 121 |
lib/psa/cca_attestation.c \ |
| 122 |
lib/psa/delegated_attestation.c \ |
| 123 |
lib/utils/mem_region.c \ |
| 124 |
plat/arm/common/arm_dyn_cfg.c \ |
| 125 |
plat/arm/common/arm_nor_psci_mem_protect.c |
| 126 |
ifeq (${NRD_PLATFORM_VARIANT}, 2) |
| 127 |
BL31_SOURCES += drivers/arm/gic/v3/gic600_multichip.c |
| 128 |
endif |
| 129 |
|
| 130 |
# XLAT options for RD-V3 variants |
| 131 |
BL31_CFLAGS += -DPLAT_XLAT_TABLES_DYNAMIC |
| 132 |
BL2_CFLAGS += -DPLAT_XLAT_TABLES_DYNAMIC |
| 133 |
|
| 134 |
# Add the FDT_SOURCES and options for Dynamic Config |
| 135 |
FDT_SOURCES += ${RDV3_BASE}/fdts/${PLAT}_fw_config.dts \ |
| 136 |
${RDV3_BASE}/fdts/${PLAT}_tb_fw_config.dts \ |
| 137 |
${RDV3_BASE}/fdts/${PLAT}_nt_fw_config.dts |
| 138 |
|
| 139 |
FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_fw_config.dtb |
| 140 |
TB_FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_tb_fw_config.dtb |
| 141 |
NT_FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_nt_fw_config.dtb |
| 142 |
|
| 143 |
# Add the FW_CONFIG to FIP and specify the same to certtool |
| 144 |
$(eval $(call TOOL_ADD_PAYLOAD,${FW_CONFIG},--fw-config,${FW_CONFIG})) |
| 145 |
# Add the TB_FW_CONFIG to FIP and specify the same to certtool |
| 146 |
$(eval $(call TOOL_ADD_PAYLOAD,${TB_FW_CONFIG},--tb-fw-config,${TB_FW_CONFIG})) |
| 147 |
# Add the NT_FW_CONFIG to FIP and specify the same to certtool |
| 148 |
$(eval $(call TOOL_ADD_PAYLOAD,${NT_FW_CONFIG},--nt-fw-config)) |
| 149 |
|
| 150 |
# Features for RD-V3 variants |
| 151 |
override ENABLE_FEAT_MPAM := 2 |
| 152 |
override ENABLE_FEAT_AMU := 2 |
| 153 |
override ENABLE_SVE_FOR_SWD := 1 |
| 154 |
override ENABLE_SVE_FOR_NS := 2 |
| 155 |
override ENABLE_FEAT_MTE2 := 2 |
| 156 |
override CTX_INCLUDE_SVE_REGS := 1 |