1 /*
2  * Arm SCP/MCP Software
3  * Copyright (c) 2020-2022, Arm Limited and Contributors. All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  */
7 
8 #include <fwk_element.h>
9 #include <fwk_module.h>
10 #include <fwk_module_idx.h>
11 
12 #include <mod_reset_domain.h>
13 #include <mod_scmi_reset_domain.h>
14 #include <mod_juno_reset_domain.h>
15 
16 static const struct mod_reset_domain_config reset_domain_config = {
17 #ifdef BUILD_HAS_NOTIFICATION
18     .notification_id = FWK_ID_NOTIFICATION_INIT(
19         FWK_MODULE_IDX_RESET_DOMAIN,
20         MOD_RESET_DOMAIN_NOTIFICATION_AUTORESET),
21 #endif
22 };
23 
24 /* Configuration of the reset elements */
25 static const struct fwk_element reset_domain_element_table[] = {
26     [JUNO_RESET_DOMAIN_IDX_UART] = {
27         .name = "JUNO_UART",
28         .data = &((const struct mod_reset_domain_dev_config) {
29             .driver_id = FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_JUNO_RESET_DOMAIN,
30                                              JUNO_RESET_DOMAIN_IDX_UART),
31             .driver_api_id = FWK_ID_API_INIT(
32                                  FWK_MODULE_IDX_JUNO_RESET_DOMAIN,
33                                  MOD_JUNO_RESET_DOMAIN_API_IDX_DRIVER),
34             .modes = MOD_RESET_DOMAIN_AUTO_RESET,
35 #ifdef BUILD_HAS_SCMI_NOTIFICATIONS
36             .capabilities = MOD_RESET_DOMAIN_CAP_NOTIFICATION,
37 #endif
38             .latency = 0xFFFFFFFF
39         }),
40     },
41     [JUNO_RESET_DOMAIN_IDX_COUNT] = { 0 }, /* Termination description */
42 };
43 
get_reset_domain_element_table(fwk_id_t module_id)44 static const struct fwk_element *get_reset_domain_element_table(
45                                      fwk_id_t module_id)
46 {
47     return reset_domain_element_table;
48 }
49 
50 /* Configuration of the reset domain module */
51 struct fwk_module_config config_reset_domain = {
52     .data = &reset_domain_config,
53     .elements = FWK_MODULE_DYNAMIC_ELEMENTS(get_reset_domain_element_table),
54 };
55