blob: c84cb845a377e7d38a5f47c583c31ebbb3cb0c54 [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>
8#include <platform.h>
9#include <stddef.h>
10#include <system_timer.h>
11#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}