blob: 35546734d54034913c9a0fddd22574c829bc683f [file] [log] [blame]
Louis Mayencourt6d2b5732019-12-17 13:17:25 +00001/*
Manish V Badarkhecad8b292023-02-07 11:26:38 +00002 * Copyright (c) 2019-2023, Arm Limited. All rights reserved.
Louis Mayencourt6d2b5732019-12-17 13:17:25 +00003 *
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
Yann Gautier5a57e252021-12-13 15:22:45 +010012#define FCONF_INVALID_IDX 0xFFFFFFFFU
13
Louis Mayencourt6d2b5732019-12-17 13:17:25 +000014/* Dynamic configuration related getter */
15#define dyn_cfg__dtb_getter(id) dyn_cfg_dtb_info_getter(id)
16
17struct dyn_cfg_dtb_info_t {
18 uintptr_t config_addr;
Manish V Badarkhea8be3bb2020-07-15 04:27:57 +010019 uint32_t config_max_size;
Louis Mayencourt6d2b5732019-12-17 13:17:25 +000020 unsigned int config_id;
Manish V Badarkhe4c156422022-03-16 09:34:36 +000021 /*
Manish V Badarkhecad8b292023-02-07 11:26:38 +000022 * A platform uses this address to copy the configuration
23 * to another location during the boot-flow.
Manish V Badarkhe4c156422022-03-16 09:34:36 +000024 * - e.g. HW_CONFIG
25 */
Manish V Badarkhecad8b292023-02-07 11:26:38 +000026 uintptr_t secondary_config_addr;
Louis Mayencourt6d2b5732019-12-17 13:17:25 +000027};
28
Yann Gautier5a57e252021-12-13 15:22:45 +010029unsigned int dyn_cfg_dtb_info_get_index(unsigned int config_id);
Louis Mayencourt6d2b5732019-12-17 13:17:25 +000030struct dyn_cfg_dtb_info_t *dyn_cfg_dtb_info_getter(unsigned int config_id);
31int fconf_populate_dtb_registry(uintptr_t config);
32
Manish V Badarkhe6a91e592020-07-15 05:08:37 +010033/* Set config information in global DTB array */
Manish V Badarkhecad8b292023-02-07 11:26:38 +000034void set_config_info(uintptr_t config_addr, uintptr_t secondary_config_addr,
Manish V Badarkhe4c156422022-03-16 09:34:36 +000035 uint32_t config_max_size,
36 unsigned int config_id);
Manish V Badarkhe99a8e142020-06-11 22:32:11 +010037
Louis Mayencourt6d2b5732019-12-17 13:17:25 +000038#endif /* FCONF_DYN_CFG_GETTER_H */