blob: 604a2ddd90b42be213da7a1e642dd9a6f1378c7c [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/sp804.h>
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +02009#include <platform.h>
10#include <platform_def.h>
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020011#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}