diff --git a/docs/components/fconf/fconf_properties.rst b/docs/components/fconf/fconf_properties.rst index 20cc75892..3479576c9 100644 --- a/docs/components/fconf/fconf_properties.rst +++ b/docs/components/fconf/fconf_properties.rst @@ -20,7 +20,9 @@ contains, and must be formed with the following fields: - load-address [mandatory] - value type: <u64> - - Physical loading base address of the configuration. + - Physical loading base address of the configuration. + If secondary-load-address is also provided (see below), then this is the + primary load address. - max-size [mandatory] - value type: <u32> @@ -30,10 +32,11 @@ contains, and must be formed with the following fields: - value type: <u32> - Image ID of the configuration. -- ns-load-address [optional] +- secondary-load-address [optional] - value type: <u64> - - Physical loading base address of the configuration in the non-secure - memory. - Only needed by those configuration files which require being loaded - in secure memory (at load-address) as well as in non-secure memory - e.g. HW_CONFIG + - A platform uses this physical address to copy the configuration to + another location during the boot-flow. + +-------------- + +*Copyright (c) 2023, Arm Limited and Contributors. All rights reserved.* diff --git a/include/lib/fconf/fconf_dyn_cfg_getter.h b/include/lib/fconf/fconf_dyn_cfg_getter.h index 43f298eb9..35546734d 100644 --- a/include/lib/fconf/fconf_dyn_cfg_getter.h +++ b/include/lib/fconf/fconf_dyn_cfg_getter.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2022, Arm Limited. All rights reserved. + * Copyright (c) 2019-2023, Arm Limited. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -19,12 +19,11 @@ struct dyn_cfg_dtb_info_t { uint32_t config_max_size; unsigned int config_id; /* - * Load address in non-secure memory. Only needed by those - * configuration files which require being loaded in secure - * memory (at config_addr) as well as in non-secure memory + * A platform uses this address to copy the configuration + * to another location during the boot-flow. * - e.g. HW_CONFIG */ - uintptr_t ns_config_addr; + uintptr_t secondary_config_addr; }; unsigned int dyn_cfg_dtb_info_get_index(unsigned int config_id); @@ -32,7 +31,7 @@ struct dyn_cfg_dtb_info_t *dyn_cfg_dtb_info_getter(unsigned int config_id); int fconf_populate_dtb_registry(uintptr_t config); /* Set config information in global DTB array */ -void set_config_info(uintptr_t config_addr, uintptr_t ns_config_addr, +void set_config_info(uintptr_t config_addr, uintptr_t secondary_config_addr, uint32_t config_max_size, unsigned int config_id); diff --git a/lib/fconf/fconf_dyn_cfg_getter.c b/lib/fconf/fconf_dyn_cfg_getter.c index 351772e11..13081b06c 100644 --- a/lib/fconf/fconf_dyn_cfg_getter.c +++ b/lib/fconf/fconf_dyn_cfg_getter.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2022, Arm Limited. All rights reserved. + * Copyright (c) 2019-2023, Arm Limited. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -31,7 +31,7 @@ static OBJECT_POOL_ARRAY(dtb_info_pool, dtb_infos); * This function is used to alloc memory for config information from * global pool and set the configuration information. */ -void set_config_info(uintptr_t config_addr, uintptr_t ns_config_addr, +void set_config_info(uintptr_t config_addr, uintptr_t secondary_config_addr, uint32_t config_max_size, unsigned int config_id) { @@ -39,7 +39,7 @@ void set_config_info(uintptr_t config_addr, uintptr_t ns_config_addr, dtb_info = pool_alloc(&dtb_info_pool); dtb_info->config_addr = config_addr; - dtb_info->ns_config_addr = ns_config_addr; + dtb_info->secondary_config_addr = secondary_config_addr; dtb_info->config_max_size = config_max_size; dtb_info->config_id = config_id; } @@ -106,7 +106,7 @@ int fconf_populate_dtb_registry(uintptr_t config) fdt_for_each_subnode(child, dtb, node) { uint32_t config_max_size, config_id; uintptr_t config_addr; - uintptr_t ns_config_addr = ~0UL; + uintptr_t secondary_config_addr = ~0UL; uint64_t val64; /* Read configuration dtb information */ @@ -134,14 +134,16 @@ int fconf_populate_dtb_registry(uintptr_t config) VERBOSE("\tmax-size = 0x%x\n", config_max_size); VERBOSE("\tconfig-id = %u\n", config_id); - rc = fdt_read_uint64(dtb, child, "ns-load-address", &val64); + rc = fdt_read_uint64(dtb, child, "secondary-load-address", + &val64); if (rc == 0) { - ns_config_addr = (uintptr_t)val64; - VERBOSE("\tns-load-address = %lx\n", ns_config_addr); + secondary_config_addr = (uintptr_t)val64; + VERBOSE("\tsecondary-load-address = %lx\n", + secondary_config_addr); } - set_config_info(config_addr, ns_config_addr, config_max_size, - config_id); + set_config_info(config_addr, secondary_config_addr, + config_max_size, config_id); } if ((child < 0) && (child != -FDT_ERR_NOTFOUND)) { diff --git a/plat/arm/board/fvp/fdts/fvp_fw_config.dts b/plat/arm/board/fvp/fdts/fvp_fw_config.dts index 577ac749c..4adf5d58f 100644 --- a/plat/arm/board/fvp/fdts/fvp_fw_config.dts +++ b/plat/arm/board/fvp/fdts/fvp_fw_config.dts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2022, Arm Limited. All rights reserved. + * Copyright (c) 2019-2023, Arm Limited. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -22,7 +22,7 @@ load-address = <0x0 0x07f00000>; max-size = <0x00100000>; id = <HW_CONFIG_ID>; - ns-load-address = <0x0 0x82000000>; + secondary-load-address = <0x0 0x82000000>; }; /* @@ -40,7 +40,11 @@ /* If required, SPD should enable loading of trusted OS fw config */ #if defined(SPD_tspd) || defined(SPD_spmd) tos_fw-config { + load-address = <0x0 0x04001500>; +#if ENABLE_RME + secondary-load-address = <0x0 0x7e00000>; +#endif /* ENABLE_RME */ max-size = <0xB00>; id = <TOS_FW_CONFIG_ID>; }; diff --git a/plat/arm/board/fvp/fvp_bl2_setup.c b/plat/arm/board/fvp/fvp_bl2_setup.c index 74e5d72f7..4c71d816f 100644 --- a/plat/arm/board/fvp/fvp_bl2_setup.c +++ b/plat/arm/board/fvp/fvp_bl2_setup.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2022, Arm Limited and Contributors. All rights reserved. + * Copyright (c) 2013-2023, Arm Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -82,7 +82,7 @@ struct bl_params *plat_get_next_bl_params(void) assert(param_node != NULL); /* Copy HW config from Secure address to NS address */ - memcpy((void *)hw_config_info->ns_config_addr, + memcpy((void *)hw_config_info->secondary_config_addr, (void *)hw_config_info->config_addr, (size_t)param_node->image_info.image_size); @@ -91,14 +91,14 @@ struct bl_params *plat_get_next_bl_params(void) * a possibility to use HW-config without cache and MMU enabled * at BL33 */ - flush_dcache_range(hw_config_info->ns_config_addr, + flush_dcache_range(hw_config_info->secondary_config_addr, param_node->image_info.image_size); param_node = get_bl_mem_params_node(BL33_IMAGE_ID); assert(param_node != NULL); /* Update BL33's ep info with NS HW config address */ - param_node->ep_info.args.arg1 = hw_config_info->ns_config_addr; + param_node->ep_info.args.arg1 = hw_config_info->secondary_config_addr; #endif /* !BL2_AT_EL3 && !EL3_PAYLOAD_BASE */ return arm_bl_params; diff --git a/plat/arm/board/fvp/fvp_bl31_setup.c b/plat/arm/board/fvp/fvp_bl31_setup.c index dd9096543..57865eb86 100644 --- a/plat/arm/board/fvp/fvp_bl31_setup.c +++ b/plat/arm/board/fvp/fvp_bl31_setup.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2022, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2013-2023, Arm Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -45,8 +45,8 @@ void __init bl31_early_platform_setup2(u_register_t arg0, */ hw_config_info = FCONF_GET_PROPERTY(dyn_cfg, dtb, HW_CONFIG_ID); assert(hw_config_info != NULL); - assert(hw_config_info->ns_config_addr != 0UL); - arg2 = hw_config_info->ns_config_addr; + assert(hw_config_info->secondary_config_addr != 0UL); + arg2 = hw_config_info->secondary_config_addr; #endif /* !RESET_TO_BL31 && !BL2_AT_EL3 */ arm_bl31_early_platform_setup((void *)arg0, arg1, arg2, (void *)arg3); diff --git a/plat/common/plat_spmd_manifest.c b/plat/common/plat_spmd_manifest.c index b1fc13cee..5f7d1428d 100644 --- a/plat/common/plat_spmd_manifest.c +++ b/plat/common/plat_spmd_manifest.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Arm Limited. All rights reserved. + * Copyright (c) 2020-2023, Arm Limited. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -150,7 +150,7 @@ int plat_spm_core_manifest_load(spmc_manifest_attribute_t *manifest, rc = mmap_add_dynamic_region((unsigned long long)pm_base_align, pm_base_align, PAGE_SIZE, - MT_RO_DATA); + MT_RO_DATA | EL3_PAS); if (rc != 0) { ERROR("Error while mapping SPM Core manifest (%d).\n", rc); return rc;