aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBalint Dobszay <balint.dobszay@arm.com>2021-03-26 16:23:18 +0100
committerBalint Dobszay <balint.dobszay@arm.com>2021-09-28 16:44:58 +0200
commit46789a7c711d650ae9b2bad0c2b817c4ba4a214a (patch)
tree7777714c77c43ef91ddf231142259d71c915e719
parent46b13fca491426ae63dd221817345c7d8a371370 (diff)
build(bl2): enable SP pkg loading for S-EL1 SPMC
Currently the SP package loading mechanism is only enabled when S-EL2 SPMC is selected. Remove this limitation. Signed-off-by: Balint Dobszay <balint.dobszay@arm.com> Change-Id: I5bf5a32248e85a26d0345cacff7d539eed824cfc
-rw-r--r--Makefile9
-rw-r--r--docs/getting_started/build-options.rst3
-rw-r--r--make_helpers/defaults.mk3
-rw-r--r--plat/arm/common/arm_bl2_setup.c2
-rw-r--r--plat/arm/common/arm_common.mk2
-rw-r--r--plat/arm/common/arm_image_load.c6
6 files changed, 17 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 9d1e945662..a76d01fce6 100644
--- a/Makefile
+++ b/Makefile
@@ -529,6 +529,10 @@ ifneq (${SPD},none)
ifneq ($(ARM_BL2_SP_LIST_DTS),)
DTC_CPPFLAGS += -DARM_BL2_SP_LIST_DTS=$(ARM_BL2_SP_LIST_DTS)
endif
+
+ ifneq ($(SP_LAYOUT_FILE),)
+ BL2_ENABLE_SP_LOAD := 1
+ endif
else
# All other SPDs in spd directory
SPD_DIR := spd
@@ -902,6 +906,7 @@ endif
$(eval $(call assert_booleans,\
$(sort \
ALLOW_RO_XLAT_TABLES \
+ BL2_ENABLE_SP_LOAD \
COLD_BOOT_SINGLE_CPU \
CREATE_KEYS \
CTX_INCLUDE_AARCH32_REGS \
@@ -1002,6 +1007,7 @@ $(eval $(call add_defines,\
ALLOW_RO_XLAT_TABLES \
ARM_ARCH_MAJOR \
ARM_ARCH_MINOR \
+ BL2_ENABLE_SP_LOAD \
COLD_BOOT_SINGLE_CPU \
CTX_INCLUDE_AARCH32_REGS \
CTX_INCLUDE_FPREGS \
@@ -1103,9 +1109,6 @@ endif
# Generate and include sp_gen.mk if SPD is spmd and SP_LAYOUT_FILE is defined
ifeq (${SPD},spmd)
ifdef SP_LAYOUT_FILE
- ifeq (${SPMD_SPM_AT_SEL2},0)
- $(error "SPMD with SPM at S-EL1 does not require SP_LAYOUT_FILE")
- endif
-include $(BUILD_PLAT)/sp_gen.mk
FIP_DEPS += sp
CRT_DEPS += sp
diff --git a/docs/getting_started/build-options.rst b/docs/getting_started/build-options.rst
index 115b2b2289..42449db0c0 100644
--- a/docs/getting_started/build-options.rst
+++ b/docs/getting_started/build-options.rst
@@ -55,6 +55,9 @@ Common build options
- ``BL2_AT_EL3``: This is an optional build option that enables the use of
BL2 at EL3 execution level.
+- ``BL2_ENABLE_SP_LOAD``: Boolean option to enable loading SP packages from the
+ FIP. Automatically enabled if ``SP_LAYOUT_FILE`` is provided.
+
- ``BL2_IN_XIP_MEM``: In some use-cases BL2 will be stored in eXecute In Place
(XIP) memory, like BL1. In these use-cases, it is necessary to initialize
the RW sections in RAM, while leaving the RO sections in place. This option
diff --git a/make_helpers/defaults.mk b/make_helpers/defaults.mk
index c1886218d7..f26cab649a 100644
--- a/make_helpers/defaults.mk
+++ b/make_helpers/defaults.mk
@@ -32,6 +32,9 @@ BASE_COMMIT := origin/master
# Execute BL2 at EL3
BL2_AT_EL3 := 0
+# Only use SP packages if SP layout JSON is defined
+BL2_ENABLE_SP_LOAD := 0
+
# BL2 image is stored in XIP memory, for now, this option is only supported
# when BL2_AT_EL3 is 1.
BL2_IN_XIP_MEM := 0
diff --git a/plat/arm/common/arm_bl2_setup.c b/plat/arm/common/arm_bl2_setup.c
index 26af383448..5b26a1d3b3 100644
--- a/plat/arm/common/arm_bl2_setup.c
+++ b/plat/arm/common/arm_bl2_setup.c
@@ -233,7 +233,7 @@ int arm_bl2_handle_post_image_load(unsigned int image_id)
******************************************************************************/
int arm_bl2_plat_handle_post_image_load(unsigned int image_id)
{
-#if defined(SPD_spmd) && SPMD_SPM_AT_SEL2
+#if defined(SPD_spmd) && BL2_ENABLE_SP_LOAD
/* For Secure Partitions we don't need post processing */
if ((image_id >= (MAX_NUMBER_IDS - MAX_SP_IDS)) &&
(image_id < MAX_NUMBER_IDS)) {
diff --git a/plat/arm/common/arm_common.mk b/plat/arm/common/arm_common.mk
index 4d5e8b4b1f..58060dbcf4 100644
--- a/plat/arm/common/arm_common.mk
+++ b/plat/arm/common/arm_common.mk
@@ -217,7 +217,7 @@ endif
ARM_IO_SOURCES += plat/arm/common/arm_io_storage.c \
plat/arm/common/fconf/arm_fconf_io.c
ifeq (${SPD},spmd)
- ifeq (${SPMD_SPM_AT_SEL2},1)
+ ifeq (${BL2_ENABLE_SP_LOAD},1)
ARM_IO_SOURCES += plat/arm/common/fconf/arm_fconf_sp.c
endif
endif
diff --git a/plat/arm/common/arm_image_load.c b/plat/arm/common/arm_image_load.c
index ebf6dfff88..c411c6cbb2 100644
--- a/plat/arm/common/arm_image_load.c
+++ b/plat/arm/common/arm_image_load.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2020, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2016-2021, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -32,7 +32,7 @@ void plat_flush_next_bl_params(void)
next_bl_params_cpy_ptr);
}
-#if defined(SPD_spmd) && SPMD_SPM_AT_SEL2
+#if defined(SPD_spmd) && BL2_ENABLE_SP_LOAD
/*******************************************************************************
* This function appends Secure Partitions to list of loadable images.
******************************************************************************/
@@ -76,7 +76,7 @@ static void plat_add_sp_images_load_info(struct bl_load_info *load_info)
******************************************************************************/
struct bl_load_info *plat_get_bl_image_load_info(void)
{
-#if defined(SPD_spmd) && SPMD_SPM_AT_SEL2
+#if defined(SPD_spmd) && BL2_ENABLE_SP_LOAD
bl_load_info_t *bl_load_info;
bl_load_info = get_bl_load_info_from_mem_params_desc();