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 #include "config_psu.h"
10
11 #include <mod_mock_psu.h>
12 #include <mod_psu.h>
13
14 #include <fwk_element.h>
15 #include <fwk_id.h>
16 #include <fwk_module.h>
17 #include <fwk_module_idx.h>
18
19 #include <stddef.h>
20
21 static const struct fwk_element element_table[] = {
22 [CONFIG_PSU_ELEMENT_IDX_CPU_GROUP_LITTLE] = {
23 .name = "CPU_GROUP_LITTLE",
24 .data = &(const struct mod_psu_element_cfg) {
25 .driver_id = FWK_ID_ELEMENT_INIT(
26 FWK_MODULE_IDX_MOCK_PSU,
27 CONFIG_MOCK_PSU_ELEMENT_IDX_CPU_GROUP_LITTLE),
28 .driver_api_id = FWK_ID_API_INIT(
29 FWK_MODULE_IDX_MOCK_PSU,
30 MOD_MOCK_PSU_API_IDX_DRIVER),
31 },
32 },
33 [CONFIG_PSU_ELEMENT_IDX_CPU_GROUP_BIG] = {
34 .name = "CPU_GROUP_BIG",
35 .data = &(const struct mod_psu_element_cfg) {
36 .driver_id = FWK_ID_ELEMENT_INIT(
37 FWK_MODULE_IDX_MOCK_PSU,
38 CONFIG_MOCK_PSU_ELEMENT_IDX_CPU_GROUP_BIG),
39 .driver_api_id = FWK_ID_API_INIT(
40 FWK_MODULE_IDX_MOCK_PSU,
41 MOD_MOCK_PSU_API_IDX_DRIVER),
42 },
43 },
44 [CONFIG_PSU_ELEMENT_IDX_GPU] = {
45 .name = "GPU",
46 .data = &(const struct mod_psu_element_cfg) {
47 .driver_id = FWK_ID_ELEMENT_INIT(
48 FWK_MODULE_IDX_MOCK_PSU,
49 CONFIG_MOCK_PSU_ELEMENT_IDX_GPU),
50 .driver_api_id = FWK_ID_API_INIT(
51 FWK_MODULE_IDX_MOCK_PSU,
52 MOD_MOCK_PSU_API_IDX_DRIVER),
53 },
54 },
55 [CONFIG_PSU_ELEMENT_IDX_VPU] = {
56 .name = "VPU",
57 .data = &(const struct mod_psu_element_cfg) {
58 .driver_id = FWK_ID_ELEMENT_INIT(
59 FWK_MODULE_IDX_MOCK_PSU,
60 CONFIG_MOCK_PSU_ELEMENT_IDX_VPU),
61 .driver_api_id = FWK_ID_API_INIT(
62 FWK_MODULE_IDX_MOCK_PSU,
63 MOD_MOCK_PSU_API_IDX_DRIVER),
64 },
65 },
66 { 0 }
67 };
68
psu_get_element_table(fwk_id_t module_id)69 static const struct fwk_element *psu_get_element_table(fwk_id_t module_id)
70 {
71 return element_table;
72 }
73
74 struct fwk_module_config config_psu = {
75 .elements = FWK_MODULE_DYNAMIC_ELEMENTS(psu_get_element_table),
76 };
77