mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-15 17:14:21 +00:00
feat(rdv3): enable the support to fetch dynamic config
To enable the support to load Hafnium as BL32, BL31 needs firmware configuration info to get BL32 manifest load location. The load address of BL32 is passed via firmware config info. Add the support to get the address using fconf framework from dynamic config info. Signed-off-by: Nishant Sharma <nishant.sharma@arm.com> Signed-off-by: Rakshit Goyal <rakshit.goyal@arm.com> Change-Id: I3a2a5706789ed290dc7f4a67e62e03751b930c02
This commit is contained in:
parent
4d9b8281f3
commit
37cc7fa539
3 changed files with 55 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2024, Arm Limited and Contributors. All rights reserved.
|
||||
* Copyright (c) 2018-2025, Arm Limited and Contributors. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
@ -13,6 +13,8 @@
|
|||
#include <drivers/arm/css/css_mhu_doorbell.h>
|
||||
#include <drivers/arm/css/scmi.h>
|
||||
#include <drivers/generic_delay_timer.h>
|
||||
#include <lib/fconf/fconf.h>
|
||||
#include <lib/fconf/fconf_dyn_cfg_getter.h>
|
||||
#include <plat/arm/common/plat_arm.h>
|
||||
#include <plat/arm/css/common/css_pm.h>
|
||||
#include <plat/common/platform.h>
|
||||
|
@ -155,6 +157,21 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
|
|||
/* Initialize generic timer */
|
||||
generic_delay_timer_init();
|
||||
|
||||
#if SPMD_SPM_AT_SEL2 && !RESET_TO_BL31
|
||||
INFO("BL31 FCONF: FW_CONFIG address = 0x%lx\n", (uintptr_t)arg1);
|
||||
/* Initialize BL31's copy of the DTB registry because SPMD needs the
|
||||
* TOS_FW_CONFIG's addresses to make a copy.
|
||||
*/
|
||||
fconf_populate("FW_CONFIG", arg1);
|
||||
|
||||
/* arg1 is supposed to point to SOC_FW_CONFIG */
|
||||
const struct dyn_cfg_dtb_info_t *soc_fw_config_info;
|
||||
|
||||
soc_fw_config_info = FCONF_GET_PROPERTY(dyn_cfg, dtb, SOC_FW_CONFIG_ID);
|
||||
if (soc_fw_config_info != NULL) {
|
||||
arg1 = soc_fw_config_info->config_addr;
|
||||
}
|
||||
#endif /* SPMD_SPM_AT_SEL2 && !RESET_TO_BL31 */
|
||||
arm_bl31_early_platform_setup((void *)arg0, arg1, arg2, (void *)arg3);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2024, Arm Limited and Contributors. All rights reserved.
|
||||
* Copyright (c) 2018-2025, Arm Limited and Contributors. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
@ -10,6 +10,8 @@
|
|||
#include <common/debug.h>
|
||||
#include <common/desc_image_load.h>
|
||||
#include <drivers/arm/css/sds.h>
|
||||
#include <lib/fconf/fconf.h>
|
||||
#include <lib/fconf/fconf_dyn_cfg_getter.h>
|
||||
#include <plat/arm/common/plat_arm.h>
|
||||
#include <plat/common/platform.h>
|
||||
#include <platform_def.h>
|
||||
|
@ -145,11 +147,37 @@ static int plat_nrd_append_config_node(void)
|
|||
******************************************************************************/
|
||||
bl_params_t *plat_get_next_bl_params(void)
|
||||
{
|
||||
struct bl_params *arm_bl_params;
|
||||
int ret;
|
||||
|
||||
ret = plat_nrd_append_config_node();
|
||||
if (ret != 0)
|
||||
panic();
|
||||
|
||||
return arm_get_next_bl_params();
|
||||
arm_bl_params = arm_get_next_bl_params();
|
||||
|
||||
#if !EL3_PAYLOAD_BASE
|
||||
const struct dyn_cfg_dtb_info_t *fw_config_info;
|
||||
bl_mem_params_node_t *param_node;
|
||||
uintptr_t fw_config_base = 0UL;
|
||||
|
||||
/* Get BL31 image node */
|
||||
param_node = get_bl_mem_params_node(BL31_IMAGE_ID);
|
||||
assert(param_node != NULL);
|
||||
|
||||
/* Get fw_config load address */
|
||||
fw_config_info = FCONF_GET_PROPERTY(dyn_cfg, dtb, FW_CONFIG_ID);
|
||||
assert(fw_config_info != NULL);
|
||||
|
||||
fw_config_base = fw_config_info->config_addr;
|
||||
assert(fw_config_base != 0UL);
|
||||
|
||||
/*
|
||||
* Get the entry point info of next executable image and override
|
||||
* arg1 of entry point info with fw_config base address
|
||||
*/
|
||||
param_node->ep_info.args.arg1 = (uint64_t)fw_config_base;
|
||||
|
||||
#endif
|
||||
return arm_bl_params;
|
||||
}
|
||||
|
|
|
@ -127,6 +127,13 @@ ifeq (${NRD_PLATFORM_VARIANT}, 2)
|
|||
BL31_SOURCES += drivers/arm/gic/v3/gic600_multichip.c
|
||||
endif
|
||||
|
||||
ifneq (${PLAT_RESET_TO_BL31}, 1)
|
||||
ifeq ($(SPMD_SPM_AT_SEL2),1)
|
||||
# Firmware Configuration Framework sources
|
||||
BL31_SOURCES += ${FCONF_SOURCES} ${FCONF_DYN_SOURCES}
|
||||
endif
|
||||
endif
|
||||
|
||||
# XLAT options for RD-V3 variants
|
||||
BL31_CFLAGS += -DPLAT_XLAT_TABLES_DYNAMIC
|
||||
BL2_CFLAGS += -DPLAT_XLAT_TABLES_DYNAMIC
|
||||
|
|
Loading…
Add table
Reference in a new issue