1 /*
2  * Arm SCP/MCP Software
3  * Copyright (c) 2017-2021, Arm Limited and Contributors. All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  */
7 
8 #include <mod_mock_psu.h>
9 
10 #include <fwk_element.h>
11 #include <fwk_id.h>
12 #include <fwk_module.h>
13 
14 #include <stdbool.h>
15 
16 static const struct fwk_element element_table[] = {
17     {
18         .name = "CPU_GROUP_LITTLE",
19         .data = &(const struct mod_mock_psu_element_cfg) {
20             .async_alarm_id = FWK_ID_NONE_INIT,
21             .async_alarm_api_id = FWK_ID_NONE_INIT,
22 
23             .async_response_id = FWK_ID_NONE_INIT,
24             .async_response_api_id = FWK_ID_NONE_INIT,
25 
26             .default_enabled = true,
27             .default_voltage = 800,
28         },
29     },
30     {
31         .name = "CPU_GROUP_BIG",
32         .data = &(const struct mod_mock_psu_element_cfg) {
33             .async_alarm_id = FWK_ID_NONE_INIT,
34             .async_alarm_api_id = FWK_ID_NONE_INIT,
35 
36             .async_response_id = FWK_ID_NONE_INIT,
37             .async_response_api_id = FWK_ID_NONE_INIT,
38 
39             .default_enabled = true,
40             .default_voltage = 800,
41         },
42     },
43     {
44         .name = "GPU",
45         .data = &(const struct mod_mock_psu_element_cfg) {
46             .async_alarm_id = FWK_ID_NONE_INIT,
47             .async_alarm_api_id = FWK_ID_NONE_INIT,
48 
49             .async_response_id = FWK_ID_NONE_INIT,
50             .async_response_api_id = FWK_ID_NONE_INIT,
51 
52             .default_enabled = true,
53             .default_voltage = 800,
54         },
55     },
56     {
57         .name = "VPU",
58         .data = &(const struct mod_mock_psu_element_cfg) {
59             .async_alarm_id = FWK_ID_NONE_INIT,
60             .async_alarm_api_id = FWK_ID_NONE_INIT,
61 
62             .async_response_id = FWK_ID_NONE_INIT,
63             .async_response_api_id = FWK_ID_NONE_INIT,
64 
65             .default_enabled = true,
66             .default_voltage = 800,
67         },
68     },
69     { 0 }
70 };
71 
get_element_table(fwk_id_t module_id)72 static const struct fwk_element *get_element_table(fwk_id_t module_id)
73 {
74     return element_table;
75 }
76 
77 const struct fwk_module_config config_mock_psu = {
78     .elements = FWK_MODULE_DYNAMIC_ELEMENTS(get_element_table),
79 };
80