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_clock.h"
9 #include "morello_scp_mmap.h"
10 
11 #include <mod_dmc_bing.h>
12 
13 #include <fwk_element.h>
14 #include <fwk_id.h>
15 #include <fwk_module.h>
16 #include <fwk_module_idx.h>
17 
18 #include <stdbool.h>
19 
20 /* Table of DMC_BING elements descriptions. */
21 static struct fwk_element dmc_bing_element_table[3] = {
22     [0] =
23         {
24             .name = "DMC_BING-0",
25             .data = &((struct mod_dmc_bing_element_config){
26                 .dmc_bing_base = SCP_DMC0,
27                 .ddr_phy_base = SCP_DDR_PHY0,
28                 .clock_id = FWK_ID_ELEMENT_INIT(
29                     FWK_MODULE_IDX_CLOCK,
30                     CLOCK_IDX_INTERCONNECT),
31             }),
32         },
33     [1] =
34         {
35             .name = "DMC_BING-1",
36             .data = &((struct mod_dmc_bing_element_config){
37                 .dmc_bing_base = SCP_DMC1,
38                 .ddr_phy_base = SCP_DDR_PHY1,
39                 .clock_id = FWK_ID_ELEMENT_INIT(
40                     FWK_MODULE_IDX_CLOCK,
41                     CLOCK_IDX_INTERCONNECT),
42             }),
43         },
44     [2] = { 0 }, /* Termination description. */
45 };
46 
dmc_bing_get_element_table(fwk_id_t module_id)47 static const struct fwk_element *dmc_bing_get_element_table(fwk_id_t module_id)
48 {
49     return dmc_bing_element_table;
50 }
51 
52 /* Configuration of the DMC_BING module. */
53 const struct fwk_module_config config_dmc_bing = {
54     .elements = FWK_MODULE_DYNAMIC_ELEMENTS(dmc_bing_get_element_table),
55     .data = &((struct mod_dmc_bing_module_config){
56         .ddr_speed = DDR_CLOCK_MHZ,
57     }),
58 };
59