1 /*
2  * Copyright (c) 2019-2023, Arm Limited. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef FCONF_DYN_CFG_GETTER_H
8 #define FCONF_DYN_CFG_GETTER_H
9 
10 #include <lib/fconf/fconf.h>
11 
12 #define FCONF_INVALID_IDX	0xFFFFFFFFU
13 
14 /* Dynamic configuration related getter */
15 #define dyn_cfg__dtb_getter(id)	dyn_cfg_dtb_info_getter(id)
16 
17 struct dyn_cfg_dtb_info_t {
18 	uintptr_t config_addr;
19 	uint32_t config_max_size;
20 	unsigned int config_id;
21 	/*
22 	 * A platform uses this address to copy the configuration
23 	 * to another location during the boot-flow.
24 	 * - e.g. HW_CONFIG
25 	 */
26 	uintptr_t secondary_config_addr;
27 };
28 
29 unsigned int dyn_cfg_dtb_info_get_index(unsigned int config_id);
30 struct dyn_cfg_dtb_info_t *dyn_cfg_dtb_info_getter(unsigned int config_id);
31 int fconf_populate_dtb_registry(uintptr_t config);
32 
33 /* Set config information in global DTB array */
34 void set_config_info(uintptr_t config_addr, uintptr_t secondary_config_addr,
35 		     uint32_t config_max_size,
36 		     unsigned int config_id);
37 
38 #endif /* FCONF_DYN_CFG_GETTER_H */
39