diff --git a/Makefile b/Makefile index 2376b9accb8e5bb1eb2dac303be3895a6b484396..8ddbcdd95e8a2124205faf392cc96d8ca49c7ec7 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) 2013-2021, ARM Limited and Contributors. All rights reserved. +# Copyright (c) 2013-2021, Arm Limited and Contributors. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause # @@ -129,6 +129,19 @@ else $(error Unknown BRANCH_PROTECTION value ${BRANCH_PROTECTION}) endif +# RME requires AARCH64 and other features +ifneq (${ENABLE_RME},0) +ifneq (${ARCH},aarch64) + $(error ENABLE_RME requires AArch64) +endif +# RME requires el2 context to be saved for now. +CTX_INCLUDE_EL2_REGS := 1 +SPD = rmmd +# These arch versions will need to be updated later. +ARM_ARCH_MAJOR := 8 +ARM_ARCH_MINOR := 4 +endif + # USE_SPINLOCK_CAS requires AArch64 build ifeq (${USE_SPINLOCK_CAS},1) ifneq (${ARCH},aarch64) @@ -521,6 +534,14 @@ ifneq (${SPD},none) ifeq ($(findstring optee_sp,$(ARM_SPMC_MANIFEST_DTS)),optee_sp) DTC_CPPFLAGS += -DOPTEE_SP_FW_CONFIG endif + else ifeq (${SPD},rmmd) + $(warning "RMMD is an experimental feature") + # RMMD is located in std_svc directory + SPD_DIR := std_svc + + ifeq ($(CTX_INCLUDE_EL2_REGS),0) + $(error RMM at S-EL2 requires CTX_INCLUDE_EL2_REGS option) + endif else # All other SPDs in spd directory SPD_DIR := spd @@ -906,6 +927,7 @@ $(eval $(call assert_booleans,\ ENABLE_PIE \ ENABLE_PMF \ ENABLE_PSCI_STAT \ + ENABLE_RME \ ENABLE_RUNTIME_INSTRUMENTATION \ ENABLE_SPE_FOR_LOWER_ELS \ ENABLE_SVE_FOR_NS \ @@ -999,6 +1021,7 @@ $(eval $(call add_defines,\ ENABLE_PIE \ ENABLE_PMF \ ENABLE_PSCI_STAT \ + ENABLE_RME \ ENABLE_RUNTIME_INSTRUMENTATION \ ENABLE_SPE_FOR_LOWER_ELS \ ENABLE_SVE_FOR_NS \ diff --git a/docs/getting_started/build-options.rst b/docs/getting_started/build-options.rst index 2c3cd6bb500cf8e73d96a2a2e47a535359e29990..d371c9d1ef933ac502f3fa97d1c1163fb48695af 100644 --- a/docs/getting_started/build-options.rst +++ b/docs/getting_started/build-options.rst @@ -264,6 +264,9 @@ Common build options be enabled. If ``ENABLE_PMF`` is set, the residency statistics are tracked in software. +- ``ENABLE_RME``: Boolean option to enable support for the ARMv9 Realm + Management Extension. + - ``ENABLE_RUNTIME_INSTRUMENTATION``: Boolean option to enable runtime instrumentation which injects timestamp collection points into TF-A to allow runtime performance to be measured. Currently, only PSCI is diff --git a/make_helpers/defaults.mk b/make_helpers/defaults.mk index 8d0cd04774ac3fa3067d98b254aaa691ba35ced1..f844648a090ce99bda15b90c376d8ae49c89fcb0 100644 --- a/make_helpers/defaults.mk +++ b/make_helpers/defaults.mk @@ -1,5 +1,5 @@ # -# Copyright (c) 2016-2021, ARM Limited. All rights reserved. +# Copyright (c) 2016-2021, Arm Limited. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause # @@ -102,6 +102,9 @@ ENABLE_PMF := 0 # Flag to enable PSCI STATs functionality ENABLE_PSCI_STAT := 0 +# Flag to enable Realm Management Extension (RME) +ENABLE_RME := 0 + # Flag to enable runtime instrumentation using PMF ENABLE_RUNTIME_INSTRUMENTATION := 0