sp804_delay_timer.h 662 Bytes
Newer Older
Ryan Harkin's avatar
Ryan Harkin committed
1
2
3
/*
 * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved.
 *
dp-arm's avatar
dp-arm committed
4
 * SPDX-License-Identifier: BSD-3-Clause
Ryan Harkin's avatar
Ryan Harkin committed
5
6
 */

7
8
#ifndef SP804_DELAY_TIMER_H
#define SP804_DELAY_TIMER_H
Ryan Harkin's avatar
Ryan Harkin committed
9
10
11

#include <stdint.h>

12
#include <drivers/delay_timer.h>
Ryan Harkin's avatar
Ryan Harkin committed
13
14
15
16
17
18

uint32_t sp804_get_timer_value(void);

void sp804_timer_ops_init(uintptr_t base_addr, const timer_ops_t *ops);

#define sp804_timer_init(base_addr, clk_mult, clk_div)			\
19
20
21
22
23
24
25
26
	do {								\
		static const timer_ops_t sp804_timer_ops = {		\
			sp804_get_timer_value,				\
			(clk_mult),					\
			(clk_div)					\
		};							\
		sp804_timer_ops_init((base_addr), &sp804_timer_ops);	\
	} while (0)
Ryan Harkin's avatar
Ryan Harkin committed
27

28
#endif /* SP804_DELAY_TIMER_H */