1 /*
2  * Copyright (c) 2020-2023, Arm Limited. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef FCONF_HW_CONFIG_GETTER_H
8 #define FCONF_HW_CONFIG_GETTER_H
9 
10 #include <lib/fconf/fconf.h>
11 #include <services/rmm_core_manifest.h>
12 
13 #include <plat/arm/common/arm_def.h>
14 
15 /* Hardware Config related getter */
16 #define hw_config__gicv3_config_getter(prop) gicv3_config.prop
17 #define hw_config__topology_getter(prop) soc_topology.prop
18 #define hw_config__uart_serial_config_getter(prop) uart_serial_config.prop
19 #define hw_config__cpu_timer_getter(prop) cpu_timer.prop
20 #define hw_config__dram_layout_getter(prop) dram_layout.prop
21 
22 struct gicv3_config_t {
23 	uint64_t gicd_base;
24 	uint64_t gicr_base;
25 };
26 
27 struct hw_topology_t {
28 	uint32_t plat_cluster_count;
29 	uint32_t cluster_cpu_count;
30 	uint32_t plat_cpu_count;
31 	uint32_t plat_max_pwr_level;
32 };
33 
34 struct uart_serial_config_t {
35 	uint64_t uart_base;
36 	uint32_t uart_clk;
37 };
38 
39 struct cpu_timer_t {
40 	uint32_t clock_freq;
41 };
42 
43 struct ns_dram_layout {
44 	uint64_t num_banks;
45 	struct ns_dram_bank dram_bank[ARM_DRAM_NUM_BANKS];
46 };
47 
48 int fconf_populate_gicv3_config(uintptr_t config);
49 int fconf_populate_topology(uintptr_t config);
50 int fconf_populate_uart_config(uintptr_t config);
51 int fconf_populate_cpu_timer(uintptr_t config);
52 int fconf_populate_dram_layout(uintptr_t config);
53 
54 extern struct gicv3_config_t gicv3_config;
55 extern struct hw_topology_t soc_topology;
56 extern struct uart_serial_config_t uart_serial_config;
57 extern struct cpu_timer_t cpu_timer;
58 extern struct ns_dram_layout dram_layout;
59 
60 #endif /* FCONF_HW_CONFIG_GETTER_H */
61