1 /*
2  * Arm SCP/MCP Software
3  * Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  */
7 
8 #include <mod_timer.h>
9 
10 #include <fwk_element.h>
11 #include <fwk_id.h>
12 #include <fwk_module.h>
13 #include <fwk_module_idx.h>
14 
15 #include <fmw_cmsis.h>
16 
17 /*
18  * Timer HAL config
19  */
20 static const struct fwk_element timer_dev_table[] = {
21     [0] =
22         {
23             .name = "REFCLK",
24             .data = &((struct mod_timer_dev_config){
25                 .id = FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_GTIMER, 0),
26                 .timer_irq = TIMREFCLK_IRQ,
27             }),
28             .sub_element_count = 8, /* Number of alarms */
29         },
30     [1] = { 0 },
31 };
32 
timer_get_dev_table(fwk_id_t module_id)33 static const struct fwk_element *timer_get_dev_table(fwk_id_t module_id)
34 {
35     return timer_dev_table;
36 }
37 
38 const struct fwk_module_config config_timer = {
39     .elements = FWK_MODULE_DYNAMIC_ELEMENTS(timer_get_dev_table),
40 };
41