1 /*
2  * Arm SCP/MCP Software
3  * Copyright (c) 2020-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_module.h>
16 #include <fwk_module_idx.h>
17 
18 static const struct fwk_element element_table[] = {
19     [CONFIG_PSU_ELEMENT_IDX_CLUS0] =
20         {
21             .name = "CLUSTER_0_CPUS",
22             .data =
23                 &(const struct mod_psu_element_cfg){
24                     .driver_id = FWK_ID_ELEMENT_INIT(
25                         FWK_MODULE_IDX_MOCK_PSU,
26                         CONFIG_MOCK_PSU_ELEMENT_IDX_CLUS0),
27                     .driver_api_id = FWK_ID_API_INIT(
28                         FWK_MODULE_IDX_MOCK_PSU,
29                         MOD_MOCK_PSU_API_IDX_DRIVER),
30                 },
31         },
32     [CONFIG_PSU_ELEMENT_IDX_CLUS1] =
33         {
34             .name = "CLUSTER_1_CPUS",
35             .data =
36                 &(const struct mod_psu_element_cfg){
37                     .driver_id = FWK_ID_ELEMENT_INIT(
38                         FWK_MODULE_IDX_MOCK_PSU,
39                         CONFIG_MOCK_PSU_ELEMENT_IDX_CLUS1),
40                     .driver_api_id = FWK_ID_API_INIT(
41                         FWK_MODULE_IDX_MOCK_PSU,
42                         MOD_MOCK_PSU_API_IDX_DRIVER),
43                 },
44         },
45     { 0 }
46 };
47 
psu_get_element_table(fwk_id_t module_id)48 static const struct fwk_element *psu_get_element_table(fwk_id_t module_id)
49 {
50     return element_table;
51 }
52 
53 struct fwk_module_config config_psu = {
54     .elements = FWK_MODULE_DYNAMIC_ELEMENTS(psu_get_element_table),
55     .data = NULL,
56 };
57