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 <morello_scp_mhu.h>
9 #include <morello_scp_mmap.h>
10 
11 #include <mod_mhu.h>
12 
13 #include <fwk_element.h>
14 #include <fwk_id.h>
15 #include <fwk_module.h>
16 
17 #include <fmw_cmsis.h>
18 
19 static const struct fwk_element
20                         mhu_element_table[MORELLO_MHU_DEVICE_IDX_COUNT + 1] = {
21     [MORELLO_MHU_DEVICE_IDX_S_CLUS0] = {
22         .name = "MHU_S_CLUSTER_0",
23         .sub_element_count = 1,
24         .data = &((struct mod_mhu_device_config) {
25             .irq = MHU_AP_SEC_IRQ,
26             .in = MHU_AP_TO_SCP_S(0),
27             .out = MHU_SCP_TO_AP_S(0),
28         }),
29     },
30     [MORELLO_MHU_DEVICE_IDX_NS_CLUS0] = {
31         .name = "MHU_NS_CLUSTER_0",
32         .sub_element_count = 1,
33         .data = &((struct mod_mhu_device_config) {
34           .irq = MHU_AP_NONSEC_IRQ,
35           .in = MHU_AP_TO_SCP_NS(0),
36           .out = MHU_SCP_TO_AP_NS(0),
37         }),
38     },
39     [MORELLO_MHU_DEVICE_IDX_S_MCP] = {
40         .name = "MHU_S_MCP",
41         .sub_element_count = 1,
42         .data = &((struct mod_mhu_device_config) {
43            .irq = MHU_MCP_SEC_IRQ,
44            .in = MHU_MCP_TO_SCP_S,
45            .out = MHU_SCP_TO_MCP_S,
46         }),
47     },
48     [MORELLO_MHU_DEVICE_IDX_COUNT] = { 0 },
49 };
50 
mhu_get_element_table(fwk_id_t module_id)51 static const struct fwk_element *mhu_get_element_table(fwk_id_t module_id)
52 {
53     return mhu_element_table;
54 }
55 
56 struct fwk_module_config config_mhu = {
57     .elements = FWK_MODULE_DYNAMIC_ELEMENTS(mhu_get_element_table),
58 };
59