From 05e550302103a527b9f8d3869942c203c7b2dd65 Mon Sep 17 00:00:00 2001 From: Manish V Badarkhe Date: Tue, 7 Feb 2023 11:26:38 +0000 Subject: [PATCH] feat(fconf): rename 'ns-load-address' to 'secondary-load-address' The 'ns-load-address' property has been renamed to 'secondary-load- address' in order to make it more generic. It can be used to copy the configuration to any location, be it root, secure, or non-secure. Change-Id: I122508e155ccd99082296be3f6b8db2f908be221 Signed-off-by: Manish V Badarkhe --- docs/components/fconf/fconf_properties.rst | 17 ++++++++++------- include/lib/fconf/fconf_dyn_cfg_getter.h | 11 +++++------ lib/fconf/fconf_dyn_cfg_getter.c | 20 +++++++++++--------- 3 files changed, 26 insertions(+), 22 deletions(-) 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: - - 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: @@ -30,10 +32,11 @@ contains, and must be formed with the following fields: - value type: - Image ID of the configuration. -- ns-load-address [optional] +- secondary-load-address [optional] - value type: - - 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)) {