blob: 2bc23221a40fbf18f33379817f0f09bcba945833 [file] [log] [blame]
Scott Brandenc4b45002014-08-11 13:58:22 -07001/*
2 * Copyright 2014 Broadcom Corporation.
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#ifndef __TIMER_H
8#define __TIMER_H
9
10#include <linux/types.h>
11
12void timer_systick_init(uint32_t tick_ms);
13void timer_global_init(void);
14
15/* ARM A9 Private Timer */
16#define TIMER_PVT_LOAD_OFFSET 0x00000000
17#define TIMER_PVT_COUNTER_OFFSET 0x00000004
18#define TIMER_PVT_CTRL_OFFSET 0x00000008
19#define TIMER_PVT_STATUS_OFFSET 0x0000000C
20#define TIMER_PVT_TIM_CTRL_TIM_EN 0x00000001
21#define TIMER_PVT_TIM_CTRL_AUTO_RELD 0x00000002
22#define TIMER_PVT_TIM_CTRL_INT_EN 0x00000004
23#define TIMER_PVT_TIM_CTRL_PRESC_MASK 0x0000FF00
24#define TIMER_PVT_TIM_INT_STATUS_SET 0x00000001
25
26/* Global timer */
27#define TIMER_GLB_LOW_OFFSET 0x00000000
28#define TIMER_GLB_HI_OFFSET 0x00000004
29#define TIMER_GLB_CTRL_OFFSET 0x00000008
30#define TIMER_GLB_TIM_CTRL_TIM_EN 0x00000001
31#define TIMER_GLB_TIM_CTRL_COMP_EN 0x00000002
32#define TIMER_GLB_TIM_CTRL_INT_EN 0x00000004
33#define TIMER_GLB_TIM_CTRL_AUTO_INC 0x00000008
34#define TIMER_GLB_TIM_CTRL_PRESC_MASK 0x0000FF00
35#define TIMER_GLB_TIM_INT_STATUS_SET 0x00000001
36
37#endif /*__TIMER_H */