blob: 1d1ce488402c37977353340a9fa1de496bebe81a [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 <platform_def.h>
10#include <sp804.h>
11#include <stddef.h>
12#include <timer.h>
13
14static const plat_timer_t plat_timers = {
15 .program = sp804_timer_program,
16 .cancel = sp804_timer_cancel,
17 .handler = sp804_timer_handler,
18 .timer_step_value = 2,
19 .timer_irq = MB_TIMER1_IRQ /* Motherboard SP804 timer1 IRQ */
20};
21
22int plat_initialise_timer_ops(const plat_timer_t **timer_ops)
23{
24 assert(timer_ops != NULL);
25 *timer_ops = &plat_timers;
26
27 /* Initialise the system timer */
28 sp804_timer_init(MB_TIMER1_BASE, MB_TIMER1_FREQ);
29
30 return 0;
31}