1 /*
2  * Arm SCP/MCP Software
3  * Copyright (c) 2015-2021, Arm Limited and Contributors. All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  */
7 
8 #include "system_mmap.h"
9 
10 #include <mod_sgm775_dmc500.h>
11 
12 #include <fwk_element.h>
13 #include <fwk_id.h>
14 #include <fwk_module.h>
15 #include <fwk_module_idx.h>
16 
17 static struct fwk_element sgm775_dmc500_element_table[] = {
18     [0] = { .name = "DMC500-0",
19             .data = &((struct mod_sgm775_dmc500_element_config) {
20                 .dmc = DMC_INTERNAL0,
21                 .ddr_phy_id =
22                     FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_SGM775_DDR_PHY500, 0),
23         }),
24     },
25     [1] = { .name = "DMC500-1",
26             .data = &((struct mod_sgm775_dmc500_element_config) {
27                 .dmc = DMC_INTERNAL1,
28                 .ddr_phy_id =
29                     FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_SGM775_DDR_PHY500, 1),
30         }),
31     },
32     [2] = { .name = "DMC500-2",
33             .data = &((struct mod_sgm775_dmc500_element_config) {
34                 .dmc = DMC_INTERNAL2,
35                 .ddr_phy_id =
36                     FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_SGM775_DDR_PHY500, 2),
37         }),
38     },
39     [3] = { .name = "DMC500-3",
40             .data = &((struct mod_sgm775_dmc500_element_config) {
41                 .dmc = DMC_INTERNAL3,
42                 .ddr_phy_id =
43                     FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_SGM775_DDR_PHY500, 3),
44         }),
45     },
46     [4] = { 0 }, /* Termination description. */
47 };
48 
sgm775_dmc500_get_element_table(fwk_id_t module_id)49 static const struct fwk_element *sgm775_dmc500_get_element_table(
50     fwk_id_t module_id)
51 {
52     return sgm775_dmc500_element_table;
53 }
54 
55 /* Configuration of the DMC500 module. */
56 struct fwk_module_config config_sgm775_dmc500 = {
57     .data =
58         &(struct mod_sgm775_dmc500_module_config){
59             .timer_id = FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_TIMER, 0),
60         },
61 
62     .elements = FWK_MODULE_DYNAMIC_ELEMENTS(sgm775_dmc500_get_element_table),
63 };
64