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
This commit is contained in:
Balint Dobszay 2021-03-26 16:23:18 +01:00
parent 46b13fca49
commit 46789a7c71
6 changed files with 17 additions and 8 deletions

View file

@ -529,6 +529,10 @@ ifneq (${SPD},none)
ifneq ($(ARM_BL2_SP_LIST_DTS),) ifneq ($(ARM_BL2_SP_LIST_DTS),)
DTC_CPPFLAGS += -DARM_BL2_SP_LIST_DTS=$(ARM_BL2_SP_LIST_DTS) DTC_CPPFLAGS += -DARM_BL2_SP_LIST_DTS=$(ARM_BL2_SP_LIST_DTS)
endif endif
ifneq ($(SP_LAYOUT_FILE),)
BL2_ENABLE_SP_LOAD := 1
endif
else else
# All other SPDs in spd directory # All other SPDs in spd directory
SPD_DIR := spd SPD_DIR := spd
@ -902,6 +906,7 @@ endif
$(eval $(call assert_booleans,\ $(eval $(call assert_booleans,\
$(sort \ $(sort \
ALLOW_RO_XLAT_TABLES \ ALLOW_RO_XLAT_TABLES \
BL2_ENABLE_SP_LOAD \
COLD_BOOT_SINGLE_CPU \ COLD_BOOT_SINGLE_CPU \
CREATE_KEYS \ CREATE_KEYS \
CTX_INCLUDE_AARCH32_REGS \ CTX_INCLUDE_AARCH32_REGS \
@ -1002,6 +1007,7 @@ $(eval $(call add_defines,\
ALLOW_RO_XLAT_TABLES \ ALLOW_RO_XLAT_TABLES \
ARM_ARCH_MAJOR \ ARM_ARCH_MAJOR \
ARM_ARCH_MINOR \ ARM_ARCH_MINOR \
BL2_ENABLE_SP_LOAD \
COLD_BOOT_SINGLE_CPU \ COLD_BOOT_SINGLE_CPU \
CTX_INCLUDE_AARCH32_REGS \ CTX_INCLUDE_AARCH32_REGS \
CTX_INCLUDE_FPREGS \ CTX_INCLUDE_FPREGS \
@ -1103,9 +1109,6 @@ endif
# Generate and include sp_gen.mk if SPD is spmd and SP_LAYOUT_FILE is defined # Generate and include sp_gen.mk if SPD is spmd and SP_LAYOUT_FILE is defined
ifeq (${SPD},spmd) ifeq (${SPD},spmd)
ifdef SP_LAYOUT_FILE 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 -include $(BUILD_PLAT)/sp_gen.mk
FIP_DEPS += sp FIP_DEPS += sp
CRT_DEPS += sp CRT_DEPS += sp

View file

@ -55,6 +55,9 @@ Common build options
- ``BL2_AT_EL3``: This is an optional build option that enables the use of - ``BL2_AT_EL3``: This is an optional build option that enables the use of
BL2 at EL3 execution level. 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 - ``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 (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 the RW sections in RAM, while leaving the RO sections in place. This option

View file

@ -32,6 +32,9 @@ BASE_COMMIT := origin/master
# Execute BL2 at EL3 # Execute BL2 at EL3
BL2_AT_EL3 := 0 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 # BL2 image is stored in XIP memory, for now, this option is only supported
# when BL2_AT_EL3 is 1. # when BL2_AT_EL3 is 1.
BL2_IN_XIP_MEM := 0 BL2_IN_XIP_MEM := 0

View file

@ -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) 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 */ /* For Secure Partitions we don't need post processing */
if ((image_id >= (MAX_NUMBER_IDS - MAX_SP_IDS)) && if ((image_id >= (MAX_NUMBER_IDS - MAX_SP_IDS)) &&
(image_id < MAX_NUMBER_IDS)) { (image_id < MAX_NUMBER_IDS)) {

View file

@ -217,7 +217,7 @@ endif
ARM_IO_SOURCES += plat/arm/common/arm_io_storage.c \ ARM_IO_SOURCES += plat/arm/common/arm_io_storage.c \
plat/arm/common/fconf/arm_fconf_io.c plat/arm/common/fconf/arm_fconf_io.c
ifeq (${SPD},spmd) 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 ARM_IO_SOURCES += plat/arm/common/fconf/arm_fconf_sp.c
endif endif
endif endif

View file

@ -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 * SPDX-License-Identifier: BSD-3-Clause
*/ */
@ -32,7 +32,7 @@ void plat_flush_next_bl_params(void)
next_bl_params_cpy_ptr); 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. * 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) 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_t *bl_load_info;
bl_load_info = get_bl_load_info_from_mem_params_desc(); bl_load_info = get_bl_load_info_from_mem_params_desc();