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 "config_mock_psu.h"
9 
10 #include <mod_mock_psu.h>
11 
12 #include <fwk_element.h>
13 #include <fwk_id.h>
14 #include <fwk_module.h>
15 
16 #include <stdbool.h>
17 #include <stddef.h>
18 
19 static const struct fwk_element element_table[] = {
20     [CONFIG_MOCK_PSU_ELEMENT_IDX_CPU_GROUP_LITTLE] = {
21         .name = "CPU_GROUP_LITTLE",
22         .data = &(const struct mod_mock_psu_element_cfg) {
23             .async_alarm_id = FWK_ID_NONE_INIT,
24             .async_alarm_api_id = FWK_ID_NONE_INIT,
25 
26             .async_response_id = FWK_ID_NONE_INIT,
27             .async_response_api_id = FWK_ID_NONE_INIT,
28 
29             .default_enabled = true,
30             .default_voltage = 800,
31         },
32     },
33     [CONFIG_MOCK_PSU_ELEMENT_IDX_CPU_GROUP_BIG] = {
34         .name = "CPU_GROUP_BIG",
35         .data = &(const struct mod_mock_psu_element_cfg) {
36             .async_alarm_id = FWK_ID_NONE_INIT,
37             .async_alarm_api_id = FWK_ID_NONE_INIT,
38 
39             .async_response_id = FWK_ID_NONE_INIT,
40             .async_response_api_id = FWK_ID_NONE_INIT,
41 
42             .default_enabled = true,
43             .default_voltage = 800,
44         },
45     },
46     [CONFIG_MOCK_PSU_ELEMENT_IDX_GPU] = {
47         .name = "GPU",
48         .data = &(const struct mod_mock_psu_element_cfg) {
49             .async_alarm_id = FWK_ID_NONE_INIT,
50             .async_alarm_api_id = FWK_ID_NONE_INIT,
51 
52             .async_response_id = FWK_ID_NONE_INIT,
53             .async_response_api_id = FWK_ID_NONE_INIT,
54 
55             .default_enabled = true,
56             .default_voltage = 800,
57         },
58     },
59     [CONFIG_MOCK_PSU_ELEMENT_IDX_VPU] = {
60         .name = "VPU",
61         .data = &(const struct mod_mock_psu_element_cfg) {
62             .async_alarm_id = FWK_ID_NONE_INIT,
63             .async_alarm_api_id = FWK_ID_NONE_INIT,
64 
65             .async_response_id = FWK_ID_NONE_INIT,
66             .async_response_api_id = FWK_ID_NONE_INIT,
67 
68             .default_enabled = true,
69             .default_voltage = 800,
70         },
71     },
72     { 0 }
73 };
74 
get_element_table(fwk_id_t module_id)75 static const struct fwk_element *get_element_table(fwk_id_t module_id)
76 {
77     return element_table;
78 }
79 
80 struct fwk_module_config config_mock_psu = {
81     .elements = FWK_MODULE_DYNAMIC_ELEMENTS(get_element_table),
82 };
83