blob: f43fdaa0c23adc725bcb6da92bada6dd6a38dbd3 [file] [log] [blame]
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +02001/*
2 * Copyright (c) 2018, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include <assert.h>
Antonio Nino Diaz09a00ef2019-01-11 13:12:58 +00008#include <drivers/arm/system_timer.h>
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +02009#include <platform.h>
10#include <stddef.h>
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020011#include <timer.h>
12
13#pragma weak plat_initialise_timer_ops
14
15static const plat_timer_t plat_timers = {
16 .program = program_systimer,
17 .cancel = cancel_systimer,
18 .handler = handler_systimer,
19 .timer_step_value = 2,
20 .timer_irq = IRQ_CNTPSIRQ1
21};
22
23int plat_initialise_timer_ops(const plat_timer_t **timer_ops)
24{
25 assert(timer_ops != NULL);
26 *timer_ops = &plat_timers;
27
28 /* Initialise the system timer */
29 init_systimer(SYS_CNT_BASE1);
30
31 return 0;
32}