1 /*
2 * Arm SCP/MCP Software
3 * Copyright (c) 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_module.h>
14
15 static const struct fwk_element
16 element_table[CONFIG_MOCK_PSU_ELEMENT_IDX_COUNT + 1] = {
17 [CONFIG_MOCK_PSU_ELEMENT_IDX_CLUS0] = {
18 .name = "CLUSTER_0_CPUS",
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 [CONFIG_MOCK_PSU_ELEMENT_IDX_CLUS1] = {
31 .name = "CLUSTER_1_CPUS",
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 [CONFIG_MOCK_PSU_ELEMENT_IDX_GPU] = {
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 = 1000,
54 },
55 },
56 { 0 }
57 };
58
get_element_table(fwk_id_t module_id)59 static const struct fwk_element *get_element_table(fwk_id_t module_id)
60 {
61 return element_table;
62 }
63
64 struct fwk_module_config config_mock_psu = {
65 .elements = FWK_MODULE_DYNAMIC_ELEMENTS(get_element_table),
66 .data = NULL,
67 };
68