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 <Manish.Badarkhe@arm.com>
This commit is contained in:
Manish V Badarkhe 2023-02-07 11:26:38 +00:00
parent e3df3ffa11
commit 05e5503021
3 changed files with 26 additions and 22 deletions

View file

@ -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.*

View file

@ -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);

View file

@ -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)) {