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 "sgm776_mhu.h"
9 #include "sgm776_mmap.h"
10 
11 #include <mod_mhu2.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 mhu_element_table[] = {
20     [SGM776_MHU_DEVICE_IDX_S] = {
21         .name = "MHU_S",
22         .sub_element_count = 1,
23         .data = &((struct mod_mhu2_channel_config) {
24             .irq = MHU_SECURE_IRQ,
25             .recv = MHU_RECV_S_BASE,
26             .send = MHU_SEND_S_BASE,
27             .channel = 0,
28         })
29     },
30     [SGM776_MHU_DEVICE_IDX_NS_H] = {
31         .name = "MHU_NS_HIGH",
32         .sub_element_count = 1,
33         .data = &((struct mod_mhu2_channel_config) {
34             .irq = MHU_HIGH_PRIO_IRQ,
35             .recv = MHU_RECV_NS_BASE,
36             .send = MHU_SEND_NS_BASE,
37             .channel = 0,
38         })
39     },
40     [SGM776_MHU_DEVICE_IDX_NS_L] = {
41         .name = "MHU_NS_LOW",
42         .sub_element_count = 1,
43         .data = &((struct mod_mhu2_channel_config) {
44             .irq = MHU_LOW_PRIO_IRQ,
45             .recv = MHU_RECV_NS_BASE,
46             .send = MHU_SEND_NS_BASE,
47             .channel = 1,
48         })
49     },
50     [SGM776_MHU_DEVICE_IDX_COUNT] = { 0 },
51 };
52 
mhu_get_element_table(fwk_id_t module_id)53 static const struct fwk_element *mhu_get_element_table(fwk_id_t module_id)
54 {
55     return mhu_element_table;
56 }
57 
58 struct fwk_module_config config_mhu2 = {
59     .elements = FWK_MODULE_DYNAMIC_ELEMENTS(mhu_get_element_table),
60 };
61