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