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 "rd_alarm_idx.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[] = {
23     [0] = {
24         .name = "REFCLK",
25         .data = &((struct mod_timer_dev_config) {
26             .id = FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_GTIMER, 0),
27             .timer_irq = TIMREFCLK_IRQ,
28         }),
29         .sub_element_count = RD_ALARM_IDX_COUNT, /* Number of alarms */
30     },
31     [1] = { 0 },
32 };
33 
timer_get_dev_table(fwk_id_t module_id)34 static const struct fwk_element *timer_get_dev_table(fwk_id_t module_id)
35 {
36     return timer_dev_table;
37 }
38 
39 const struct fwk_module_config config_timer = {
40     .elements = FWK_MODULE_DYNAMIC_ELEMENTS(timer_get_dev_table),
41 };
42