Louis Mayencourt | 6d2b573 | 2019-12-17 13:17:25 +0000 | [diff] [blame] | 1 | /* |
Manish V Badarkhe | cad8b29 | 2023-02-07 11:26:38 +0000 | [diff] [blame] | 2 | * Copyright (c) 2019-2023, Arm Limited. All rights reserved. |
Louis Mayencourt | 6d2b573 | 2019-12-17 13:17:25 +0000 | [diff] [blame] | 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 | |
Yann Gautier | 5a57e25 | 2021-12-13 15:22:45 +0100 | [diff] [blame] | 12 | #define FCONF_INVALID_IDX 0xFFFFFFFFU |
| 13 | |
Louis Mayencourt | 6d2b573 | 2019-12-17 13:17:25 +0000 | [diff] [blame] | 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; |
Manish V Badarkhe | a8be3bb | 2020-07-15 04:27:57 +0100 | [diff] [blame] | 19 | uint32_t config_max_size; |
Louis Mayencourt | 6d2b573 | 2019-12-17 13:17:25 +0000 | [diff] [blame] | 20 | unsigned int config_id; |
Manish V Badarkhe | 4c15642 | 2022-03-16 09:34:36 +0000 | [diff] [blame] | 21 | /* |
Manish V Badarkhe | cad8b29 | 2023-02-07 11:26:38 +0000 | [diff] [blame] | 22 | * A platform uses this address to copy the configuration |
| 23 | * to another location during the boot-flow. |
Manish V Badarkhe | 4c15642 | 2022-03-16 09:34:36 +0000 | [diff] [blame] | 24 | * - e.g. HW_CONFIG |
| 25 | */ |
Manish V Badarkhe | cad8b29 | 2023-02-07 11:26:38 +0000 | [diff] [blame] | 26 | uintptr_t secondary_config_addr; |
Louis Mayencourt | 6d2b573 | 2019-12-17 13:17:25 +0000 | [diff] [blame] | 27 | }; |
| 28 | |
Yann Gautier | 5a57e25 | 2021-12-13 15:22:45 +0100 | [diff] [blame] | 29 | unsigned int dyn_cfg_dtb_info_get_index(unsigned int config_id); |
Louis Mayencourt | 6d2b573 | 2019-12-17 13:17:25 +0000 | [diff] [blame] | 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 | |
Manish V Badarkhe | 6a91e59 | 2020-07-15 05:08:37 +0100 | [diff] [blame] | 33 | /* Set config information in global DTB array */ |
Manish V Badarkhe | cad8b29 | 2023-02-07 11:26:38 +0000 | [diff] [blame] | 34 | void set_config_info(uintptr_t config_addr, uintptr_t secondary_config_addr, |
Manish V Badarkhe | 4c15642 | 2022-03-16 09:34:36 +0000 | [diff] [blame] | 35 | uint32_t config_max_size, |
| 36 | unsigned int config_id); |
Manish V Badarkhe | 99a8e14 | 2020-06-11 22:32:11 +0100 | [diff] [blame] | 37 | |
Louis Mayencourt | 6d2b573 | 2019-12-17 13:17:25 +0000 | [diff] [blame] | 38 | #endif /* FCONF_DYN_CFG_GETTER_H */ |